script help (error)
#1

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
Reply
#2

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)