Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Command error

$
0
0
Hello, I'm trying to fix this command but it I use { or return it give both errors.


Code:

CMD:giverefund(playerid, params[])
{
        if (PlayerInfo[playerid][pAdmin] >= 4)
        {
                new string[128], giveplayerid, szMessage[128];
                if(sscanf(params, "ud", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /giverefund [player]");

                if(PlayerInfo[playerid][pConnectHours] > 5) {
            SendClientMessageEx(playerid, COLOR_GREY, "You cannot give this person a refund, this player has more then 5 playing hours!");
            format(szMessage, sizeof(szMessage), "[ADMIN] %s tried to give %s a refund ", string, GetPlayerNameEx(playerid), GetPlayerNameEx(playerid));
                ABroadCast(COLOR_LIGHTRED,szMessage, 4)
            return 1;
                }
                if(IsPlayerConnected(giveplayerid))
                {
                        PlayerInfo[playerid][pAccount] = 50000000;
                        PlayerInfo[giveplayerid][pPVIPVoucher] = 1;
                        PlayerInfo[giveplayerid][pLevel] = 5;
                        PlayerInfo[giveplayerid][pPot] = 50;
                        PlayerInfo[giveplayerid][pCrack] = 50;
                        PlayerInfo[playerid][pMats] = 50000;
                        PlayerInfo[playerid][pVehVoucher] = 2;
                        format(string, sizeof(string), "You have given a refund by administrator %s !",GetPlayerNameEx(giveplayerid));
                        SendClientMessageEx(playerid, COLOR_WHITE, string);
                          format(szMessage, sizeof(szMessage), "[AdmCmd] %s has given %s a refund!", string, GetPlayerNameEx(playerid), GetPlayerNameEx(playerid));
                        ABroadCast(COLOR_LIGHTRED,szMessage, 4);
                        Log("logs/refund", string);
                }
        }
        else
        {
                SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
        }
        return 1;
}

the green is line: gamemode.pwn( 39738 ) : error 001: expected token: ";", but found "return"

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>