SA-MP Forums Archive
Need Somes Helps - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need Somes Helps (/showthread.php?tid=159207)



Need Somes Helps - willsuckformoney - 12.07.2010

moo! i need some help making this so that you can do

/HBet [1 - 3]

And it Picks Horse 1 Horse 2 Horse 3

each takes different values of cash

But i need to get it so that there is a timer so when you pick your horse you wait the timer limit (1 minute)

and make it so you can win and lose here is the whole script basically not really big

pawn Код:
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

#define COLOR_PINK 0xFF66FFAA
#define COLOR_GREEN 0x18FF18FF
#define COLOR_BLUE 0x0000FFFF

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Horse Bets by WillsuckformoneY");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmd,"/HBet",true)){
    if(!strlen(tmp)||strval(tmp)<0||strval(tmp)>3) return SendClientMessage(playerid,COLOR_PINK,"FAIL! Do /Bet [1 - 3]");
    switch(strval(tmp))
    {
        case 1:
        {
            SendClientMessage(playerid, COLOR_BLUE, "You Selected Horse 1");
            SetPlayerMoney(playerid, -100);
            SetTimer("BETS", 60000, true);
            SendClientMessage(playerid, COLOR_PINK, "Congratulations, You won $200 From your Horse Bet");
            SetPlayerMoney(playerid, +200);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREEN, "Sorry! You did NOT win From your Horse Bet, Better luck next time!!");
        }
        case 2:
        {
            SendClientMessage(playerid, COLOR_BLUE, "You Selected Horse 2");
            SetPlayerMoney(playerid, -200);
            SetTimer("BETS", 60000, true);
            SendClientMessage(playerid, COLOR_PINK, "Congratulations, You won $400 From your Horse Bet");
            SetPlayerMoney(playerid, +400);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREEN, "Sorry! You did NOT win From your Horse Bet, Better luck next time!!");
        }
        case 3:
        {
            SendClientMessage(playerid, COLOR_BLUE, "You Selected Horse 3");
            SetPlayerMoney(playerid, -300);
            SetTimer("BETS", 60000, true);
            SendClientMessage(playerid, COLOR_PINK, "Congratulations, You won $600 From your Horse Bet");
            SetPlayerMoney(playerid, +600);
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREEN, "Sorry! You did NOT win From your Horse Bet, Better luck next time!!");
        }
    }
        return 1;
    }

return 0;
}
I think im somewhere near right but dont think i am either


Re: Need Somes Helps - Jeffry - 12.07.2010

I edited it a bit: http://pastebin.com/q3UseUSh

Tell me if there are any bugs. And tell me if you like it like this.

Greetz,
Jeffry


Re: Need Somes Helps - willsuckformoney - 13.07.2010

It works, just can you make this back to the strcmp way??


Re: Need Somes Helps - willsuckformoney - 13.07.2010

BUMB! Thanks for the help 2


Re: Need Somes Helps - Jeffry - 13.07.2010

Try it: http://pastebin.com/qv6TjmcX


Re: Need Somes Helps - willsuckformoney - 13.07.2010

Doesn't work, It just sends my error message...


Re: Need Somes Helps - Jeffry - 13.07.2010

Yeah, using strcmp is bad.

Use the dcmd one. dcmd is even better, and easier to use.


Re: Need Somes Helps - willsuckformoney - 13.07.2010

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
Yeah, using strcmp is bad.

Use the dcmd one. dcmd is even better, and easier to use.
I hear that all time and i would LOOVE to but i dont know how to use it yet...


Re: Need Somes Helps - Jeffry - 13.07.2010

You have a good example here.
Just use the dcmd instead of the strcmp.

Try to make a simple command. It is really easy!


Re: Need Somes Helps - willsuckformoney - 13.07.2010

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
You have a good example here.
Just use the dcmd instead of the strcmp.

Try to make a simple command. It is really easy!
Will try but uhh how to make that /hbet to be used at a certain spot, like how to use the IsPlayerInRangeOfPoint ?