/saveskin problem
#1

I want to make this /saveskin cmd to normal players.This cmd i taken from ladmin
pawn Код:
CMD:saveskin(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 1 && PlayerInfo[playerid][LoggedIn] == 1) {
        if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /saveskin [skinid]");
        new string[128], SkinID = strval(params);
        if((SkinID == 0)||(SkinID == 7)||(SkinID >= 9 && SkinID <= 41)||(SkinID >= 43 && SkinID <= 64)||(SkinID >= 66 && SkinID <= 73)||(SkinID >= 75 && SkinID <= 85)||(SkinID >= 87 && SkinID <= 118)||(SkinID >= 120 && SkinID <= 148)||(SkinID >= 150 && SkinID <= 207)||(SkinID >= 209 && SkinID <= 264)||(SkinID >= 274 && SkinID <= 288)||(SkinID >= 290 && SkinID <= 299))
        {
            dUserSetINT(PlayerName2(playerid)).("FavSkin",SkinID);
            format(string, sizeof(string), "You have successfully saved this skin (ID %d)",SkinID);
            SendClientMessage(playerid,yellow,string);
            SendClientMessage(playerid,yellow,"Type: /useskin to use this skin when you spawn or /dontuseskin to stop using skin");
            dUserSetINT(PlayerName2(playerid)).("UseSkin",1);
            return CMDMessageToAdmins(playerid,"SAVESKIN");
        } else return SendClientMessage(playerid, green, "ERROR: Invalid Skin ID");
    } else return SendClientMessage(playerid,red,"ERROR: You must be an administrator to use this command");
}
I tryed to make it for normal playersand it didnt showed any errors or warnings.But when i use that command and relog, the skin isnt saved.But if a admin use that cmd then it will save.
I want to make it for normal players, please anyone help me .
Reply
#2

Just change this:

Код:
if(PlayerInfo[playerid][Level] >= 1 && PlayerInfo[playerid][LoggedIn] == 1)
To this:

Код:
if(PlayerInfo[playerid][LoggedIn] == 1)
Reply
#3

yes i did but it isnt working
Reply
#4

try if(PlayerInfo[playerid][Level] >= 1 && PlayerInfo[playerid][LoggedIn] == 1)
to
if(PlayerInfo[playerid][Level] >= 0 && PlayerInfo[playerid][LoggedIn] == 1)
Reply
#5

The problem is this then:
PlayerInfo[playerid][LoggedIn] == 1

But without that, any player at all would be able to save thier save then

When you tested, was the player logged in?!
Reply
#6

Skin is saving in file but when a player spawn , then the player skin wont change to the saved skin
Reply
#7

Well in that case you're going to have to check OnPlayerSpawn then
Reply
#8

Quote:
Originally Posted by XGh0stz
Посмотреть сообщение
Well in that case you're going to have to check OnPlayerSpawn then
Like he said, in onplayerspawn you can see like this
pawn Код:
if((dUserINT(PlayerName2(playerid)).("UseSkin")) == 1)
    if((PlayerInfo[playerid][Level] >= 1) && (PlayerInfo[playerid][LoggedIn] == 1))
    SetPlayerSkin(playerid,(dUserINT(PlayerName2(playerid)).("FavSkin")) );
Change it to
pawn Код:
if((dUserINT(PlayerName2(playerid)).("UseSkin")) == 1)
    if((PlayerInfo[playerid][LoggedIn] == 1))
    SetPlayerSkin(playerid,(dUserINT(PlayerName2(playerid)).("FavSkin")) );
Reply
#9

ok ty very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)