07.12.2010, 07:33
(
Последний раз редактировалось [Aka]Dragonu; 07.12.2010 в 07:46.
)
Ok i made a command , but i want it to be used by team army (pRank 2) also . Here is the command :
And when i compile it gives me loads of errors !
pawn Код:
if(strcmp(cmd, "/stun", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /stun [playerid]");
return 1;
}
giveplayerid = strval(tmp);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(gTeam[playerid] == TEAM_COP)
{
if(PlayerToPoint(8.0, giveplayerid, x , y, z))
{
if(gTeam[playerid] != TEAM_COP && PlayerInfo[playerid][pRank] == 1 || gTeam[playerid] != TEAM_ARMY && PlayerInfo[playerid][pRank] == 2)
{
Stunned[giveplayerid] = 1;
KillTimer(StunTimer[giveplayerid]);
StunTimer[giveplayerid] = SetTimerEx("SetPlayerUnstun", 10000, false, "d", giveplayerid);
if(gTeam[playerid] == TEAM_COP)(format string, sizeof(string), "Officer %s has stunned (suspect) %s.", PlayerName[playerid], PlayerName[giveplayerid]);
SendClientMessageToAll(COLOR_BLUE, string);
if(gTeam[playerid] == TEAM_ARMY){format string, sizeof(string), "Soldier %s has stunned (suspect) %s.", PlayerName[playerid], PlayerName[giveplayerid]);
SendClientMessageToAll(COLOR_BLUE, string);
ApplyAnimation(playerid,"PED","ARRESTgun",4.1,0,1,1,1,1);
ApplyAnimation(giveplayerid,"PED","KO_shot_stom",4.1,0,1,1,1,1);
TogglePlayerControllable(giveplayerid, false);
KillTimer(StunTimer2[playerid]);
StunTimer2[playerid] = SetTimerEx("ClearPlayerAnimations", 5000, false, "d", playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You could not stun an officer that follows the law to.");
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "That playerid is not close (enough) to you!");
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_RED,"You are not a part of the cops team.");
}
return 1;
}