What go's wrong here
#1

Hello guys,

i scripted a RefundBox for new players with this pawn:

pawn Код:
CMD:getrefund(playerid, params[])
{
    {
        if(IsAtRefundBox(playerid))
        {
            if(PlayerInfo[playerid][pLevel] == 1)
            {

                new giveplayerid;
                if(sscanf(params, "udd", giveplayerid))
                {
                    PlayerInfo[giveplayerid][pCrack] += 25;
                }
                {
                    PlayerInfo[giveplayerid][pPot] += 25;
                }
                {
                    PlayerInfo[giveplayerid][pAccount] += 1000000;
                }
                {
                    GivePlayerCash(giveplayerid, 300000);
                }
                {
                    PlayerInfo[giveplayerid][pMats] += 50000;
                }
                {
                    PlayerInfo[giveplayerid][pTokens] += 50;
                }
                {
                    PlayerInfo[giveplayerid][pDonateRank] = 1;
                    PlayerInfo[giveplayerid][pTempVIP] = 43200;
                    PlayerInfo[giveplayerid][pBuddyInvited] = 1; // Temp vip 43200 30 dagen
                }
                {
                    PlayerInfo[giveplayerid][pLevel] = 4;
                    SetPlayerScore(giveplayerid, PlayerInfo[giveplayerid][pLevel]);
                }
                {
                    format(PlayerInfo[giveplayerid][pFlag], 128, "Free Car (New Player Refund)");
                }
                {
                    SendClientMessageEx(playerid, COLOR_GREEN, "You received your Refund. Check /stats for what you got.");
                    SendClientMessageEx(playerid, COLOR_GREEN, "We hope you have a nice stay.");
                }
            }
        }
    }
    return 1;
}
The command works.
But id 0 gets the stuff if id 1 or 2 or 3 typs /getrefund

What do i need to change about this ??
Please HEEELP!

Greets:
Reply
#2

pawn Код:
CMD:getrefund(playerid, params[])
{
    {
        if(IsAtRefundBox(playerid))
        {
            if(PlayerInfo[playerid][pLevel] == 1)
            {
                if(sscanf(params, "udd", playerid))
                {
                    PlayerInfo[playerid][pCrack] += 25;
                }
                {
                    PlayerInfo[playerid][pPot] += 25;
                }
                {
                    PlayerInfo[playerid][pAccount] += 1000000;
                }
                {
                    GivePlayerCash(playerid, 300000);
                }
                {
                    PlayerInfo[playerid][pMats] += 50000;
                }
                {
                    PlayerInfo[playerid][pTokens] += 50;
                }
                {
                    PlayerInfo[playerid][pDonateRank] = 1;
                    PlayerInfo[playerid][pTempVIP] = 43200;
                    PlayerInfo[playerid][pBuddyInvited] = 1; // Temp vip 43200 30 dagen
                }
                {
                    PlayerInfo[playerid][pLevel] = 4;
                    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
                }
                {
                    format(PlayerInfo[playerid][pFlag], 128, "Free Car (New Player Refund)");
                }
                {
                    SendClientMessageEx(playerid, COLOR_GREEN, "You received your Refund. Check /stats for what you got.");
                    SendClientMessageEx(playerid, COLOR_GREEN, "We hope you have a nice stay.");
                }
            }
        }
    }
    return 1;
}
Reply
#3

You got one opening-bracket too much after creating the CMD, I'll comment it:

pawn Код:
CMD:getrefung(playerid,params[])
{
   { //this one is too much!
    //rest of code
Reply
#4

Ok i putted one of that { away but still the same problem.
And xkirill did you change something there or ? {{ sorry already saw what you changed }}
Reply
#5

Thanks. fast helping
The thing from xkirill works

Ty ty +rep

Close
Reply
#6

Quote:
Originally Posted by Just rp
Посмотреть сообщение
Ok i putted one of that { away but still the same problem.
And xkirill did you change something there or ? {{ sorry already saw what you changed }}
yea,i mistakly added another ' { '
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)