well this is my command maybe you can fix it or give me a better idea
Код:
if(strcmp(cmd, "/tk", true) == 0)
{
if(gTeam[playerid] == TEAM_COPS)
{
new id;
tmp = strtok(cmdtext, idx);
if(strlen(tmp))
{
id = strval(tmp);
if(IsPlayerConnected(id))
{
if(Jailed[id] == false)
{
if(GetPlayerWantedLevel(id) >= 1 && GetPlayerWantedLevel(id) <= 3)
{
if(GetDistanceBetweenPlayers(playerid,id) < 15)
{
if(playerspawned[playerid] == true)
{
GetPlayerName(id,sName, MAX_PLAYER_NAME);
GetPlayerName(playerid,fName, MAX_PLAYER_NAME);
format(string, sizeof(string), "You have gave a ticket to Suspect %s [%i]",sName,id);
SendClientMessage(playerid, 0xE4BC1BFF,string);
format(string, sizeof(string), "Officer %s [%i] have fined you $3000. You have paid the ticket.",fName,playerid);
SendClientMessage(id, 0xE4BC1BFF,string);
format(string, sizeof(string), "Suspect %s [%i] has been fined by %s [%i].",sName,id,fName,playerid);
SendClientMessageToAll(0x80FF00FF,string);
SetPlayerWantedLevel(id, 0);
GivePlayerMoney(id, -3000);
GivePlayerMoney(playerid, 3000);
SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "You are dead, you cannot arrest a suspect.");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player is not close enough to ticket!");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player is not ticketable!");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "This player is in jail, you cannot ticket him.");
}
}
else
{
SendClientMessage(playerid, RED, "Player Not Found.");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "USAGE: /tk [id]");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Only Law enforcement agents can use this command!");
}
return 1;
}