Bet command help
#1

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;
}
Reply
#2

What is the error?? please specify that too
Reply
#3

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.
Reply
#4

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

NVM this answer, it was stupid.

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

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.
Reply
#7

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);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)