Need Somes Helps
#1

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

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

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

BUMB! Thanks for the help 2
Reply
#5

Try it: http://pastebin.com/qv6TjmcX
Reply
#6

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

Yeah, using strcmp is bad.

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

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

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

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

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 ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)