chack this which mistake in this:
[pawn]new Cop[MAX_PLAYERS];
new Criminal[MAX_PLAYERS];[/pawn]
[pawn]public OnPlayerSpawn( playerid,classid,teamid )
{
if(classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 98 || classid == 100 || classid == 102 || classid == 103) {
SendClientMessage(playerid,COLOR_YELLOW,"*** You have spawned as a law enforcement person.");
Cop[playerid] = 1;
}
if(classid == 27 || classid == 29 || classid == 30 || classid == 46 || classid == 51 || classid == 87 || classid == 85 || classid == 149) {
SendClientMessage(playerid,COLOR_YELLOW,"*** You have spawned as a criminal.");
Criminal[playerid] = 1;
}[/pawn]
[pawn]//------------------------------------------------------------------------------
else if(strcmp(cmd,"suspect",true) == 0 || strcmp(cmd,"sus",true) == 0) {
new szMsg[256], plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if (GetPlayerDistance(plr) == 0.50 || GetPlayerDistance(plr) == 1.0 || GetPlayerDistance(plr) == 1.5 || GetPlayerDistance(plr) == 2.0 || GetPlayerDistance(plr) == 2.5 || GetPlayerDistance(plr) == 3.0 || GetPlayerDistance(plr) == 3.5 || GetPlayerDistance(plr) == 4.0 || GetPlayerDistance(plr) == 4.5 ||GetPlayerDistance(plr) == 5) SendClientMessage(playerid, COLOR_RED, "You are too far!");
else if(Cop[playerid] == 0) SendClientMessage(playerid,COLOR_RED,"You need to be cop to can use this cmd !");
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c suspect [Nick/ID] or /c sus [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else if (Cop[plr] == 1 || Criminal[plr] == 0) SendClientMessage(playerid,COLOR_RED,"Error: He is not criminal!");
else
{
GameTextForPlayerBottom(plr, "Suspected!");
SendClientMessage(plr, COLOR_RED, "You are Suspected by Cop!");
TogglePlayerControllable(plr,0);
SetPlayerPos(plr, 387.0193,-510.2893,9.3956 );
SetTimer("CriminalSuspect",60000,0);
}
return 1;
}
//------------------------------------------------------------------------------
else if(strcmp(cmd,"killcrim",true) == 0 || strcmp(cmd,"killc",true) == 0) {
new szMsg[256], plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if (GetPlayerDistance(plr) == 0.50 || GetPlayerDistance(plr) == 1.0 || GetPlayerDistance(plr) == 1.5 || GetPlayerDistance(plr) == 2.0 || GetPlayerDistance(plr) == 2.5 || GetPlayerDistance(plr) == 3.0 || GetPlayerDistance(plr) == 3.5 || GetPlayerDistance(plr) == 4.0 || GetPlayerDistance(plr) == 4.5 ||GetPlayerDistance(plr) == 5) SendClientMessage(playerid, COLOR_RED, "You are too far!");
else if(Cop[playerid] == 0) SendClientMessage(playerid,COLOR_RED,"You need to be cop to can use this cmd !");
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c killcrim [Nick/ID] or /c killc [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else if (Cop[plr] == 1 || Criminal[plr] == 0) SendClientMessage(playerid,COLOR_RED,"Error: He is not criminal!");
else
{
SetPlayerHealth( plr, 0.0 );
GameTextForPlayerBottom(plr, "Killed!");
SendClientMessage(plr, COLOR_RED, "You are killed by Cop!");
}
return 1;
}
//------------------------------------------------------------------------------
else if(strcmp(cmd,"kidnap",true) == 0 || strcmp(cmd,"kid",true) == 0) {
new szMsg[256], plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if (GetPlayerDistance(plr) == 0.50 || GetPlayerDistance(plr) == 1.0 || GetPlayerDistance(plr) == 1.5 || GetPlayerDistance(plr) == 2.0 || GetPlayerDistance(plr) == 2.5 || GetPlayerDistance(plr) == 3.0 || GetPlayerDistance(plr) == 3.5 || GetPlayerDistance(plr) == 4.0 || GetPlayerDistance(plr) == 4.5 ||GetPlayerDistance(plr) == 5) SendClientMessage(playerid, COLOR_RED, "You are too far!");
else if(Cop[playerid] == 0) SendClientMessage(playerid,COLOR_RED,"You need to be criminal to can use this cmd !");
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c kidnap [Nick/ID] or /c kid [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else if (Criminal[plr] == 1 || Cop[plr] == 0) SendClientMessage(playerid,COLOR_RED,"Error: He is not cop!");
else
{
GameTextForPlayerBottom(plr, "Kidnapped!");
SendClientMessage(plr, COLOR_RED, "You are kidnapped by Criminal!");
SetPlayerPos(plr, -961.8445,149.3515,9.3955);
SetPlayerAnimation(plr, 33 );
TogglePlayerControllable(playerid, 0);
SetTimer("CopKidnap",60000,0);
}
return 1;
}
//------------------------------------------------------------------------------
else if(strcmp(cmd,"killcop",true) == 0 || strcmp(cmd,"killcp",true) == 0) {
new szMsg[256], plr;
tmp = strtok(cmdtext, idx), plr = FindPlayerIDFromString(tmp);
if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!");
else if (GetPlayerDistance(plr) == 0.50 || GetPlayerDistance(plr) == 1.0 || GetPlayerDistance(plr) == 1.5 || GetPlayerDistance(plr) == 2.0 || GetPlayerDistance(plr) == 2.5 || GetPlayerDistance(plr) == 3.0 || GetPlayerDistance(plr) == 3.5 || GetPlayerDistance(plr) == 4.0 || GetPlayerDistance(plr) == 4.5 ||GetPlayerDistance(plr) == 5) SendClientMessage(playerid, COLOR_RED, "You are too far!");
else if(Cop[playerid] == 0) SendClientMessage(playerid,COLOR_RED,"You need to be criminal to can use this cmd !");
else if (!strlen(tmp)) SendClientMessage(playerid,COLOR_RED,"USAGE: /c killcop [Nick/ID] or /c killcp [Nick/ID]");
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Unknown player");
else if (Criminal[plr] == 1 || Cop[plr] == 0) SendClientMessage(playerid,COLOR_RED,"Error: He is not cop!");
else
{
SetPlayerHealth( plr, 0.0 );
GameTextForPlayerBottom(plr, "Killed!");
SendClientMessage(plr, COLOR_RED, "You are killed by Criminal!");
}
return 1;
}
//------------------------------------------------------------------------------[/pawn]
[pawn]//==============================================================================
public CriminalSuspect(plr)
{
TogglePlayerControllable(plr, 1 );
SetPlayerPos(plr, 399.5581,-468.9074,11.7367 );
SendClientMessage(plr, COLOR_GREEN,"You are now un suspect!");
SendClientMessage(plr, COLOR_GREEN,"Now go and kill the cops!");
}
//==============================================================================
public CopKidnap(plr)
{
TogglePlayerControllable(plr, 1 );
SetPlayerPos(plr, 399.5581,-468.9074,11.7367 );
SendClientMessage(plr, COLOR_GREEN,"You are now un kidnap!");
SendClientMessage(plr, COLOR_GREEN,"Now go and kill the criminals!");
}
//==============================================================================[/pawn]
if any mistake plz tell me