13.03.2011, 12:49
Hey, i have this stun cmd, but i can use it anywhere, even if i am in LS and suspect in LV! I want it, to only stun if player is near me...
CMD is this:
THANKS
CMD is this:
pawn Код:
COMMAND:stun(playerid, params[])
{
if(GetPlayerColor(playerid) == 0x0259EAAA)
{
new toplayer;
if(!sscanf(params, "ui", toplayer))
{
if(IsPlayerConnected(toplayer))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(toplayer, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Cop %s Has Stun You", name);
SendClientMessage(playerid, 0x0259EAAA, string);
format(string, sizeof(string), "You Has Stun %s", PlayerName);
SendClientMessage(playerid, 0x0259EAAA, string);
TogglePlayerControllable(playerid, 0);
return 1;
}
else return SendClientMessage(playerid, 0x0259EAAA, "Player Is Not Conected.");
}
else return SendClientMessage(playerid, 0x0259EAAA, "USAGE: /stun [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0x0259EAAA, "Only Cops Can Use This Command.");
}