Is possible, but you need to add a variable.
Put this in the top of script:
new Cop[MAX_PLAYERS];
new Criminal[MAX_PLAYERS];
Now, need to set the variable to playerid to can see if is Cop or not:
(From your last topic "A little help plz")
if(classid == 1 || classid == 2 || classid == 3 || classid == 4) {
SendClientMessage(playerid,COLOR_YELLOW,"*** You have spawned as a law enforcement person.");
Cop[playerid] = 1;
}
if(classid == 11) {
SendClientMessage(playerid,COLOR_YELLOW,"*** You have spawned as a criminal.");
Criminal[playerid] = 1;
}
And now, to remove the status (Cop/Criminal) of player when he die cuse:
Add this at OnPlayerDeath:
Cop[playerid] = 0;
Criminal[playerid] = 0;
Need to reset the variables and when the player left the server.
Put this at OnPlayerDisconnect:
Cop[playerid] = 0;
Criminal[playerid] = 0;
And if you want to make a command just for Cops or just for Criminals you will need the variable.
Something like this:
//This cmd is just for cops
else if(strcmp(cmd,"heal",true) == 0) {
if(Cop[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"Cop, you was healed");
SetPlayerHealth(playerid,100.0);
} else {
SendClientMessage(playerid,COLOR_YELLOW,"Or you aren't spawned, or you aren't cop !");
}
return 1;
}
//This cmd is just for criminals
else if(strcmp(cmd, "armour", true) == 0) {
if(Criminal[playerid] == 1) {
SendClientMessage(playerid,COLOR_YELLOW,"Criminal, you get armour");
SetPlayerArmour(playerid,100.0);
} else {
SendClientMessage(playerid,COLOR_YELLOW,"Or you aren't spawned, or you aren't criminal !");
}
return 1;
}