SA-MP Forums Archive
script help (error) - 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: script help (error) (/showthread.php?tid=437292)



script help (error) - Marcus181 - 15.05.2013

CMDetscore(playerid, params[])
{
new targetid, amount;
if(PlayerInfo[playerid][pAdmin] > 3)
{
if(sscanf(params,"ii", targetid, amount)) return SendClientMessage(playerid, 0xFFFFFFF,"error.Correct usage: /setscore [PlayerID] [Amount]");
else
{
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, 0xFFFFFFF,"You need an admin level of 3+ to use this command");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFF,"That player is not connected to the server!");
SetPlayerScore(targetid, amount);
}
return 1;
}
}

ok guys i just started to script 1 day ago so i am very new at this and i am having trouble why is telling me to return a value to CMD "setscore" ?? can u help me fix this one error please i would greatly appreciate it .

error : "cmd_setscore" should return a value


Re: script help (error) - DeMoX - 15.05.2013

pawn Код:
CMD:setscore(playerid, params[])
{
    new targetid, amount;
    if(PlayerInfo[playerid][pAdmin] > 3)
    {
        if(sscanf(params,"ii", targetid, amount)) return SendClientMessage(playerid, 0xFFFFFFF,"error.Correct usage: /setscore [PlayerID] [Amount]");
        else
        {
            if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, 0xFFFFFFF,"You need an admin level of 3+ to use this command");
            if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFF,"That player is not connected to the server!");
            SetPlayerScore(targetid, amount);
        }      
   }
   return 1;
}
Return position wasn't right.

Advice: Use [pawn][/ pawn] when you past a pawn code