16.06.2013, 00:26
Try this for your /cuff command.
pawn Код:
if(strcmp(cmd, "/cuff", true) == 0 || strcmp(cmd, "/stavilisice", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gTeam[playerid] == 2 || IsACop(playerid))
{
if(KnockedDown[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Ne mozete zamahnuti kada ste vec oboreni.");
return 1;
}
if(PlayerTied[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vezani ste!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /stavilisice [ID Igraca/Dio Imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " Ne mozete staviti lisice Policajcu!");
return 1;
}
if(PlayerCuffed[giveplayerid] > 1)
{
SendClientMessage(playerid, COLOR_GREY, " Igracu su vec stavljene lisice !");
return 1;
}
// Changes Begin.
if(GetPlayerWantedLevel(giveplayerid) <= 0) // This will make it give an error if the playerid's wanted level is 0 or lower.
{
SendClientMessage(playerid, COLOR_GREY, " This player is not wanted!");
return 1;
}
if(PlayerInfo[giveplayerid][pTazovan] != 1) // This will give an error if the playerid is not tazed.
{
SendClientMessage(playerid, COLOR_GREY, " That player is not tazed!");
return 1;
}
// Changes End.
if (ProxDetectorS(3.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Ne mozete staviti lisice sebi!"); return 1; }
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s vam je stavio lisice.", sendername);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "* Stavili ste lisice %s-u.", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s stavlja lisice %s-u.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Stavljene su vam lisice", 2500, 3);
TogglePlayerControllable(giveplayerid, 0);
PlayerCuffed[giveplayerid] = 2;
PlayerCuffedTime[giveplayerid] = 99999999999999;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Taj igrac nije blizu vas !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Igrac je offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Niste Policajac / FBI / SWAT !");
}
}
return 1;
}