/setskin help!! Errors [rep+]
#7

Quote:
Originally Posted by belhot1992
Посмотреть сообщение
I tested it like this and it compiled fine in my script
pawn Код:
if(strcmp(cmd, "/setskin", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [Playerid/PartOfName] [skin id]");
            return 1;
        }
        new string[128]; //remove this line if it gives errors about shadowed variables, etc
        new para1 = ReturnUser(tmp);
        new level = strval(tmp);
        new giveplayer[MAX_PLAYER_NAME];
        tmp = strtok(cmdtext, idx);
        if(level > 299 || level < 1)
        {
            SendClientMessage(playerid, COLOR_GREY, "Wrong skin ID!");
            return 1;
        }
        if (PlayerInfo[playerid][pAdmin] >= 2)
        {
            if(IsPlayerConnected(para1))
            {
                if(para1 != INVALID_PLAYER_ID)
                {
                    GetPlayerName(para1, giveplayer, sizeof(giveplayer));
                    format(string, sizeof(string), "You have set %s's skin to %d.", giveplayer,level);
                    SendClientMessage(playerid, COLOR_GRAD2, string);
                    SetPlayerSkin(para1, level);
                }
            }
        }
        else
        {
                SendClientMessage(playerid, COLOR_GRAD1, "You are not authorised to use that command.");
        }
    }
    return 1;
}
I already got the cmd done from Kostas!! Thanks alot for the help mate.

Which cmd system should i use? zcmd/y_cmd/sscanf? which is easy to use?
Reply


Messages In This Thread
/setskin help!! Errors [rep+] - by Ballu Miaa - 15.12.2011, 15:30
Re: /setskin help!! Errors [rep+] - by JackT - 15.12.2011, 15:37
Re: /setskin help!! Errors [rep+] - by JackT - 15.12.2011, 15:55
Re: /setskin help!! Errors [rep+] - by Kostas' - 15.12.2011, 16:04
Re: /setskin help!! Errors [rep+] - by HB - 15.12.2011, 16:11
Re: /setskin help!! Errors [rep+] - by Ballu Miaa - 16.12.2011, 02:52
Re: /setskin help!! Errors [rep+] - by Ballu Miaa - 16.12.2011, 03:08
Re: /setskin help!! Errors [rep+] - by Ballu Miaa - 16.12.2011, 03:19
Re: /setskin help!! Errors [rep+] - by Ballu Miaa - 16.12.2011, 03:24
Re: /setskin help!! Errors [rep+] - by Ballu Miaa - 16.12.2011, 03:32

Forum Jump:


Users browsing this thread: 1 Guest(s)