23.06.2013, 17:22
Hey guys.
I don't understand why this is happening but.....
This is the code
What happens is that whenever i type in the command nothing happens. I checked my ProxDetector, I verified this script 1,000 times.
Basically what is suppose to happen is you flip a coin it grabs Heads or Tales as a random value and displays it to players within 15 meters.
Get back to me if u guys have an idea.
I don't understand why this is happening but.....
This is the code
PHP Code:
CMD:flipcoin(playerid, params[]) // or CMD:mycommand(playerid, params[])
{
new string[128];
new rc = random(sizeof(Coinside));
new pname[24];
GetPlayerName(playerid, pname, 24);
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, ERROR_COLOR, "[ *** ERROR *** ] You cannot use commands because you are not logged in.");
if(IsDead[playerid] == 1) return SendClientMessage(playerid, ERROR_COLOR, "[ *** ERROR *** ] You cannot use commands because you are dead.");
{
format(string, sizeof(string), "%s Flips a coin into the air and the coin lands on %s",pname, Coinside[rc]);
ProxDetector(15.0, playerid, string, -1);
}
return 1;
}
Basically what is suppose to happen is you flip a coin it grabs Heads or Tales as a random value and displays it to players within 15 meters.
Get back to me if u guys have an idea.