SA-MP Forums Archive
Bet command help - 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: Bet command help (/showthread.php?tid=604228)



Bet command help - fuckingcruse - 02.04.2016

Probably i have being trying this thing yesterday night. And again came up with it today. But i don't think it's working.
The codes are here. The system doesn't work.
Код:
CMD:bet(playerid,params[])
{
    if(IsPlayerInRangeOfPoint(playerid,3.0,1961.3129,1025.3032,992.4688))
    {
        if(pInfo[playerid][pActivity] > 0 || pInfo[playerid][pFCash] > 0)
        {
            new number;
            if(sscanf(params,"d",number)) return SendClientMessage(playerid,colorexit,"[ ! ] /bet number");
            new betnumber = random(1);
            if(number < 0 || number > 1) return SendClientMessage(playerid,colorexit,"[ ! ] Choose number");
            if(number == betnumber)
            {
                SendClientMessage(playerid,colorexit,"[ ! ] You win!");
            }
	   else
	   {
                SendClientMessage(playerid,colorexit,"[ ! ] You lose!");
	   }
	   return 1;
        }
        else SendClientMessage(playerid,colorexit,"[ ! ] Please check your /activity or /fcash for betting your pot!");
    }
    else SendClientMessage(playerid,colorexit,"[ ! ] You must be near the casino table to bet your pot!");
	return 1;
}



Re: Bet command help - SyS - 02.04.2016

What is the error?? please specify that too


Re: Bet command help - fuckingcruse - 02.04.2016

I thought you may understand it by seeing the codes. Ok the error is that when ever i type /bet it always show /bet <number> and when i type /bet 0 it again show the same msg. It doesn't show that you win or lose.


Re: Bet command help - fuckingcruse - 02.04.2016

It is still the same problem it is showing /bet number when what ever I type. I tried strval it didn't work.


Re: Bet command help - introzen - 02.04.2016

NVM this answer, it was stupid.

Try describing your problem better. I don't understand it completely.


Re: Bet command help - fuckingcruse - 02.04.2016

Ok so think i typed /bet . It will show me /bet <number>
If i type /bet 1 it still shows /bet number. What it must do is. If he types /bet command, he have to write any number ( 0 or 1 ) , there is a random value running. If the random value == the number he typed then he wins else he loses.


Re: Bet command help - SyS - 03.04.2016

Hmm i think this code will generate only 0
Quote:

new betnumber = random(1);

if want numbers 0 or 1
it should be
Quote:

new betnumber = random(2);