SA-MP Forums Archive
What go's wrong here - 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: What go's wrong here (/showthread.php?tid=320704)



What go's wrong here - Just rp - 24.02.2012

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:


Re: What go's wrong here - Kaperstone - 24.02.2012

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;
}



Re: What go's wrong here - Twisted_Insane - 24.02.2012

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



Re: What go's wrong here - Just rp - 24.02.2012

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 }}


Re: What go's wrong here - Just rp - 24.02.2012

Thanks. fast helping
The thing from xkirill works

Ty ty +rep

Close


Re: What go's wrong here - Kaperstone - 24.02.2012

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 ' { '