05.03.2011, 02:56
Oh, ok, so, you should create a variable in the top of your gamemode to checks if the player was already robbed
Put:
I hope that i have helped
Put:
pawn Код:
//In The Top of your GameMode:
new Robbed[MAX_PLAYERS];
//So, here a example using strtok:
if(strcmp(cmd, "/rob", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFFFFFFAA, "Type: /rob [id]");
return 1;
}
new targetid = strval(tmp);
new targetname[MAX_PLAYER_NAME];
GetPlayerName(targetid, targetname, MAX_PLAYER_NAME);
if(Robbed[targetid] == 1)//IF the player was already robbed
{
format(string, sizeof(string), "%s(%d) has been robbed by SOMEONE ELSE, please wait...", targetname, targetid);
SendClientMessage(playerid, COLOR_ERROR, string);//will show the error message
}
else//else if the player was not already robbed..
{
Robbed[targetid] = 1;//Will set the player as a robbed player
}
return 1;
}
I hope that i have helped