skin cmd
#1

How can i script if a player type /skin ID then he should get the skin which he typed.
Reply
#2

Depending whats your saving system, just change it to yours and use sscanf+ zcmd

pawn Код:
CMD:skin(playerid, params[])
{
    new amount, name[MAX_PLAYER_NAME], string[128];
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        if(sscanf(params,"i",amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [skinmodel]");
        else if(amount> 299 || amount< 1) return SendClientMessage(playerid,COLOR_GREY,"Invalid skinid [1-299].");
        else
        {
            GetPlayerName(playerid, name, sizeof(name));
            strreplace(name, '_', ' ');
            format(string, sizeof(string),"You have set %s's money to %d.", name, amount);
            SendClientMessage(playerid,COLOR_WHITE,string);
            PlayerInfo[playerid][pSkin] = amount;
            SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
        }
    }
    else return SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use that command!");
    return 1;
}
Reply
#3

pawn Код:
if(strcmp(cmd, "/skin", true) == 0)
{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
        SendClientMessage(playerid, red, "Usage: /skin [skinid]");
        return 1;
    }
    new skin;
    skin = strval(tmp);
    if(skin > 299 || skin < 1) return SendClientMessage(playerid, COLOR_GREY, "Invalid skin ID!");
    format(string, sizeof(string), "You have changed your skin to this skin ID: %d", skin);
    SendClientMessage(playerid, COLOR_GREEN, string);
    SetPlayerSkin(playerid, skin);
    return 1;
}
Reply
#4

by Vernz . . Edited
Quote:

if a player type /skin ID then he should get the skin which he typed.

pawn Код:
CMD:skin(playerid, params[])
{
    new amount, name[MAX_PLAYER_NAME], string[128];
    if(sscanf(params,"i",amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [skinmodel]");
    else if(amount> 299 || amount< 1) return SendClientMessage(playerid,COLOR_GREY,"Invalid skinid [1-299].");
    else
    {
        GetPlayerName(playerid, name, sizeof(name));
        strreplace(name, '_', ' ');
        format(string, sizeof(string),"You have set %s's money to %d.", name, amount);
        SendClientMessage(playerid,COLOR_WHITE,string);
        PlayerInfo[playerid][pSkin] = amount;
        SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    }
    return 1;
}
Reply
#5

undefined symbol "pSkin"
Reply
#6

add this

pawn Код:
enum pInfo
{
    pSkin
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#7

this cmd is not working
pawn Код:
CMD:skin(playerid, params[])
{
    new amount,skin, string[128];
    if(sscanf(params,"i",amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /skin [skinmodel]");
    else if(amount> 299 || amount< 1) return SendClientMessage(playerid,COLOR_GREY,"Invalid skinid [1-299].");
    else
    {
        format(string, sizeof(string),"You have set skin to %d.", amount);
        SendClientMessage(playerid,COLOR_WHITE,string);
        SetPlayerSkin(playerid, skin);
    }
    return 1;
}
When ever i set then cj skin only coming
Reply
#8

just a suggestion , use this FS this is more great
https://sampforum.blast.hk/showthread.php?tid=59832
Reply
#9

Quote:
Originally Posted by vernz
Посмотреть сообщение
Depending whats your saving system, just change it to yours and use sscanf+ zcmd

pawn Код:
CMD:skin(playerid, params[])
{
    new amount, name[MAX_PLAYER_NAME], string[128];
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        if(sscanf(params,"i",amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [skinmodel]");
        else if(amount> 299 || amount< 1) return SendClientMessage(playerid,COLOR_GREY,"Invalid skinid [1-299].");
        else
        {
            GetPlayerName(playerid, name, sizeof(name));
            strreplace(name, '_', ' ');
            format(string, sizeof(string),"You have set %s's money to %d.", name, amount);
            SendClientMessage(playerid,COLOR_WHITE,string);
            PlayerInfo[playerid][pSkin] = amount;
            SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
        }
    }
    else return SendClientMessage(playerid,COLOR_GREY,"You're not authorized to use that command!");
    return 1;
}
Ta tu besoins d'aide mon chaton ? <3
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)