30.06.2012, 11:03
Just put some variables if there's command or key.
and where player start's to gamble you have to put
where player stop with gambling you put
Command to check
Stock GetName is
And you have to reset variable under onplayerdisconnect
Quote:
new PlayerGambling[MAX_PLAYERS]; |
Quote:
PlayerGambling[playerid] = 1; |
Quote:
if(PlayerGambling[playerid] < 1) return SendClientMessage(playerid, -1, "You aren't gambling"); PlayerGambling[playerid] = 0; |
Code:
CMD:pg(playerid,params[]) { new string[64],pID,gtext[16]; if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1 ," You aren't RCON Admin "); if(sscanf(params, "r",pID)) return SendClientMessage(playerid, -1, "Usage: /pg [playerid/Part of Name]"); if(PlayerGambling[playerid] == 1) { gtext = "gambling"; } else if(PlayerGambling[playerid] == 0) { gtext = "not gambling"; } format(string,sizeof(string),"%s is %s",GetName(pID),gtext); SendClientMessage(playerid, -1, string); return true; }
Quote:
stock GetName(playerid) // thank you Gagi! { new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, MAX_PLAYER_NAME); return pName; } |