[HELP] How to know if a player is gambling?
#4

Just put some variables if there's command or key.

Quote:

new PlayerGambling[MAX_PLAYERS];

and where player start's to gamble you have to put

Quote:

PlayerGambling[playerid] = 1;

where player stop with gambling you put

Quote:

if(PlayerGambling[playerid] < 1) return SendClientMessage(playerid, -1, "You aren't gambling");
PlayerGambling[playerid] = 0;

Command to check

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;
}
Stock GetName is

Quote:

stock GetName(playerid) // thank you Gagi!
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
return pName;
}

And you have to reset variable under onplayerdisconnect
Reply


Messages In This Thread
[HELP] How to know if a player is gambling? - by _DucK_ - 29.06.2012, 17:52
Re: [HELP] How to know if a player is gambling? - by _DucK_ - 30.06.2012, 10:34
Re: [HELP] How to know if a player is gambling? - by WillyP - 30.06.2012, 10:42
Re: [HELP] How to know if a player is gambling? - by ivanVU - 30.06.2012, 11:03
Re: [HELP] How to know if a player is gambling? - by milanosie - 30.06.2012, 11:48
Re: [HELP] How to know if a player is gambling? - by _DucK_ - 30.06.2012, 16:45

Forum Jump:


Users browsing this thread: 1 Guest(s)