SA-MP Forums Archive
Help me with this ! - 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: Help me with this ! (/showthread.php?tid=626928)



Help me with this ! - FizzyWalshy - 22.01.2017

Remove -Fixed.


Re: Help me with this ! - xTURBOx - 22.01.2017

PHP Code:
CMD:dicebet(playerid, params[])
{
    new 
string[128], giveplayerid, money;
    if(
sscanf(params, "ud", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /dicebet [playerid/partofname] [price]");
    if(
GetPVarInt(playerid, "GuardTimer") > 0)
    {
        
format(string, sizeof(string), "   You must wait %d seconds before again doing dice bet.", GetPVarInt(playerid, "GuardTimer"));
        
SendClientMessage(playerid,COLOR_GREY,string);
        return 
1;
    }

    if(
money > PlayerInfo[playerid][pCash]) return SendClientMessage(playerid, COLOR_GREY, "You don't have that many cash!");

    if(
IsPlayerConnected(giveplayerid))
    {
        if(
giveplayerid != INVALID_PLAYER_ID)
        {
            if(
ProxDetectorS(8.0, playerid, giveplayerid))
            {
               
SetPVarInt(playerid, "GuardTimer", 10); SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_GUARDTIMER);
               
format(string, sizeof(string), "* You offered %s a bet for $%d.", GetPlayerNameEx(giveplayerid), money);
               
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
               
format(string, sizeof(string), "* %s wants to gamble with you for $%d, type (/accept dicebet) to accept it.", GetPlayerNameEx(playerid), money);
               
SendClientMessage(giveplayerid, COLOR_WHITE, string);
               
CoinOffer[giveplayerid] = playerid;
               
CoinPrice[giveplayerid] = money;
               
//format(string, sizeof(string), "* %s has offered the dice bet to %s for %d.",GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), money);
               //ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
}
            else
            {
                
SendClientMessage(playerid, COLOR_GREY, "That player isn't near you.");
            }
        }
    }
    else
    {
        
SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
    }
    return 
1;
} 



Re: Help me with this ! - FizzyWalshy - 22.01.2017

Can Someone tell me how to define this because i dont know how to script or just give me a code ?



This is after i define CoinOffer




Re: Help me with this ! - xTURBOx - 22.01.2017

change
#define CoinOffer
to

PHP Code:
new CoinOffer[MAX_PLAYERS];