Need help with command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help with command (
/showthread.php?tid=445921)
Need help with command -
thistooshallpass93 - 23.06.2013
Hey guys.
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;
}
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.