Puliukot
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Plugins by nahkanukke sm_slappia

Siirry alas

Plugins by nahkanukke sm_slappia Empty Plugins by nahkanukke sm_slappia

Viesti kirjoittaja Puliukko Su Elo 25, 2013 12:17 pm

#include <sourcemod>
#include <sdktools>

new Handle:sm_slappia_damage = INVALID_HANDLE

public Plugin:myinfo =
{
name = "Nahkanakukke",
author = "nahkanukke",
description = "nahkanukke",
version = "1.0.0.0",
url = "http://puliukot.omapalsta.com/t105-plugins-by-nahkanukke-sm_slappia"
}

public OnPluginStart()
{
LoadTranslations("common.phrases");
RegAdminCmd("sm_slappia", Command_slappia, ADMFLAG_SLAY);

sm_slappia_damage = CreateConVar("sm_slappia_damage", "2", "Default slap damage");
AutoExecConfig(true, "plugin_slappia");
}

public Action:Command_slappia(client, args)
{
new String:arg1[32], String:arg2[32];
new damage = GetConVarInt(sm_slappia_damage);

/* Get the first argument */
GetCmdArg(1, arg1, sizeof(arg1));

/* If there are 2 or more arguments, and the second argument fetch
* is successful, convert it to an integer.
*/
if (args >= 2 && GetCmdArg(2, arg2, sizeof(arg2)))
{
damage = StringToInt(arg2);
}

/**
* target_name - stores the noun identifying the target(s)
* target_list - array to store clients
* target_count - variable to store number of clients
* tn_is_ml - stores whether the noun must be translated
*/
new String:target_name[MAX_TARGET_LENGTH];
new target_list[MAXPLAYERS], target_count;
new bool:tn_is_ml;

if ((target_count = ProcessTargetString(
arg1,
client,
target_list,
MAXPLAYERS,
COMMAND_FILTER_ALIVE, /* Only allow alive players */
target_name,
sizeof(target_name),
tn_is_ml)) <= 0)
{
/* This function replies to the admin with a failure message */
ReplyToTargetError(client, target_count);
return Plugin_Handled;
}

for (new i = 0; i < target_count; i++)
{
SlapPlayer(target_list[i], damage);
LogAction(client, target_list[i], "\"%L\" napsautti \"%L\" (damage %d)", client, target_list[i], damage);
}

if (tn_is_ml)
{
ShowActivity2(client, "[SM] ", "napsautti %t Sinulle %d damagea!", target_name, damage);
}
else
{
ShowActivity2(client, "[SM] ", "napsautti %s Sinulle %d damagea!", target_name, damage);
}

return Plugin_Handled;

Puliukko

Viestien lukumäärä : 9
Join date : 20.02.2013

Takaisin alkuun Siirry alas

Takaisin alkuun


 
Oikeudet tällä foorumilla:
Et voi vastata viesteihin tässä foorumissa