Jump to content
  • 0

New Skin in 0.3.7


Stefan F.

Question

5 answers to this question

Recommended Posts

  • 0

Salut.Am incercat sa pun cuiva unul dintre noile skin-uri aparute in 0.3.7 dar nu functioneaza.

 

Cum ai încercat să îi setezi skin-ul?

 

Arată-ne te rog comanda /setskin (sau cum o ai tu definită), folosește

 [//code]
Edited by Gawitkkk
Link to comment
Share on other sites

  • 0

Uite comanda

CMD:setskin(playerid,params[])
{
    if(playerVariables[playerid][pAdminLevel] >= 1)
    {
        new id, string[256], giveplayer[25],skin;
        if(sscanf(params, "ui", id,skin)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/setskin [playerid] [skin id]");
        {
            if(id != INVALID_PLAYER_ID)
            {
                if(skin < 300 && skin >= 0)
                {
                    GetPlayerName(id, giveplayer, sizeof(giveplayer));
                    format(string, sizeof(string), "You set %s's skin to %d.", giveplayer, skin);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    playerVariables[id][pSkin] = skin;
                    SetPlayerSkin(id, skin);
                    new wakaname[25];
                    GetPlayerName(id,wakaname,25);
                    new str[128];
                    format(str,128,"UPDATE `playeraccounts` SET `playerSkin`='%d' WHERE `playerID`='%d'",skin,playerVariables[id][pInternalID]);
                    mysql_tquery(handle,str);
                }
            }
        }
    }
    else return SendClientMessage(playerid, COLOR_WHITE, AdminOnly);
    return 1;
}

 

Edited by ..::STeFaNN::..
Link to comment
Share on other sites

  • 0

Uite comanda

CMD:setskin(playerid,params[])
{
    if(playerVariables[playerid][pAdminLevel] >= 1)
    {
        new id, string[256], giveplayer[25],skin;
        if(sscanf(params, "ui", id,skin)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/setskin [playerid] [skin id]");
        {
            if(id != INVALID_PLAYER_ID)
            {
                if(skin < 300 && skin >= 0)
                {
                    GetPlayerName(id, giveplayer, sizeof(giveplayer));
                    format(string, sizeof(string), "You set %s's skin to %d.", giveplayer, skin);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    playerVariables[id][pSkin] = skin;
                    SetPlayerSkin(id, skin);
                    new wakaname[25];
                    GetPlayerName(id,wakaname,25);
                    new str[128];
                    format(str,128,"UPDATE `playeraccounts` SET `playerSkin`='%d' WHERE `playerID`='%d'",skin,playerVariables[id][pInternalID]);
                    mysql_tquery(handle,str);
                }
            }
        }
    }
    else return SendClientMessage(playerid, COLOR_WHITE, AdminOnly);
    return 1;
}

 

Salut ! Uite, pune așa în gamemode și va merge:

 

CMD:setskin(playerid,params[])
{
    if(playerVariables[playerid][pAdminLevel] >= 1)
    {
        new id, string[256], giveplayer[25],skin;
        if(sscanf(params, "ui", id,skin)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/setskin [playerid] [skin id]");
        {
            if(id != INVALID_PLAYER_ID)
            {
                if(skin < 311 && skin >= 0)
                {
                    GetPlayerName(id, giveplayer, sizeof(giveplayer));
                    format(string, sizeof(string), "You set %s's skin to %d.", giveplayer, skin);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    playerVariables[id][pSkin] = skin;
                    SetPlayerSkin(id, skin);
                    new wakaname[25];
                    GetPlayerName(id,wakaname,25);
                    new str[128];
                    format(str,128,"UPDATE `playeraccounts` SET `playerSkin`='%d' WHERE `playerID`='%d'",skin,playerVariables[id][pInternalID]);
                    mysql_tquery(handle,str);
                }
            }
        }
    }
    else return SendClientMessage(playerid, COLOR_WHITE, AdminOnly);
    return 1;
}

 

Problema era de la if(skin < 311 && skin >= 0), aceasta este o protecție ce nu te lasă să pui skin-uri cu ID-uri mai mare de 300. Acum numărul maxim este 311, numărul total de skin-uri.

Edited by Gawitkkk
Link to comment
Share on other sites

  • 0

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.