Players
#1

How to create a function on cmd /robbank(if 15 Police Officers are not online to Show EROR:You can't rob today.)
Reply
#2

You'll have to loop trough all players and see if they are polices and if there are, you make a variable ++, like this:

pawn Код:
//add this to your command
new polices;
for(new i = 0; i<MAX_PLAYERS; i++){
if(playerinfo[i[police] == 1){//make your variables here
polices ++;
}
}
if(polices < 15)return SendClientMessage(playerid, COLOR_ERROR, "There are not enought polices online at this moment, you can't rob a bank!");
Hope I helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)