Some help
#1

Hey, i made a /playdice command which is implemented when /accept dice is used, but After once we have done /playdice [playerid] it is continiously possible to /accept dice rather it should return Nobody invited you to play dice, here is my /accept dice code.
pawn Код:
else if(!strcmp(params, "dice", true))
    {
        new playerb = DiceBy[playerid], gal1, gal2;
        if(playerb == -1) return SendClientMessage(playerid, COLOR_GREY, "Nobody has offered you to play dice.");
        new price = DiceMoney[playerb][playerid];
        if(PlayerInfo[playerid][pMoney] < price) return SendClientMessage(playerid, COLOR_GREY, "You don't have that much money on you.");
        gal1 = 1+random(6);
        gal2 = 1+random(6);
        format(string, sizeof(string), "* God rolls a pair of dice on the floor, the first dice shows %d while the other shows %d.", gal1, gal2);
        SendNearbyMessage(playerid, 4, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
        if(gal1 > gal2)
        {
            GivePlayerMoney(playerid, -price);
            GivePlayerMoney(playerb, price);
            format(string, sizeof(string), "%s has paid $%d to you as he lost in the dice!", RPN(playerid), price);
            SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
        }
        else
        {
            GivePlayerMoney(playerb, -price);
            GivePlayerMoney(playerid, price);
            format(string, sizeof(string), "%s has paid $%d to you as he lost in the dice!", RPN(playerb), price);
            SendClientMessage(playerb, COLOR_LIGHTBLUE, string);
        }
        DiceMoney[playerb][playerid] = 0;
        DiceBy[playerb] = -1;
    }
Help will be really appreciated.
Reply
#2

C'mon someone.
Reply
#3

pawn Код:
DiceBy[playerb] = -1;
replace this with the following
pawn Код:
DiceBy[playerid] = -1;
Reply
#4

Hmmm well try using a false cmd. So see how you wrote 'true' for if somebody is actually invite, and then he can play dice. Well make a cmd with 'false', that if he tries to /accept dice, but is not invited as it is 'false' then the SendClientMessage pops up
Reply
#5

No, didnt work.
Reply
#6

BUMP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)