saveskin
#1

Код:
CMD:saveskin(playerid, params[], help)
{
    new skinid, string[256];
    if(skinid > 299) return SendClientMessage(playerid,COLOR_RED,"ERROR: Available Skin: 0 - 299 !");
    format(string, sizeof(string), "You have saved your correct skin!"COL_YELLOW" use /deleteskin to unsave it.");
    SendClientMessage(playerid, COLOR_GREY, string);
    skinid = GetPlayerSkin(playerid);
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"SavedSkin",skinid);
    INI_Close(File);
   return 1;
}
On DialogResponse (register dialog):
Код:
INI_WriteInt(File,"SavedSkin",-1);
Now, when I try to put that code:
Код:
if(PlayerInfo[playerid][pSavedSkin] >=0 ) return SetPlayerSkin(playerid,PlayerInfo[playerid][pSavedSkin]);
OnPlayerConnect it makes the skinid to '0'
And when I'm trying to make it OnPlayerSpawn, it makes the skinid to '0' and changes the virtual world or interior idk.

If someone knows how to fix that problem I will be thankful!
Reply
#2

When is the next time you set the players skin to something? If you're registering it at -1 and then disallowing the player to load negative skins, their skin will be by default (0) being the CJ skin.
Reply
#3

Quote:
Originally Posted by Meller
Посмотреть сообщение
When is the next time you set the players skin to something? If you're registering it at -1 and then disallowing the player to load negative skins, their skin will be by default (0) being the CJ skin.
So how can I fix it?

if I won't make for new registered players a savedskin id, then when they will join the server they'll get a

random new skin.

And where is the best public to put that:
Код:
if(PlayerInfo[playerid][pSavedSkin] >=0 ) return SetPlayerSkin(playerid,PlayerInfo[playerid][pSavedSkin]);
?
Reply
#4

It really depends on your gamemode and where you want it. By my guesses, place it at OnPlayerSpawn.
Reply
#5

Quote:
Originally Posted by Meller
Посмотреть сообщение
It really depends on your gamemode and where you want it. By my guesses, place it at OnPlayerSpawn.
I've made it OnPlayerSpawn and it still when a player spawns his skin id is 0 (cj skin).

btw, I've tried it on some other publics too..
Reply
#6

Quote:
Originally Posted by rakinz
Посмотреть сообщение
I've made it OnPlayerSpawn and it still when a player spawns his skin id is 0 (cj skin).

btw, I've tried it on some other publics too..
That doesn't matter if you're setting the default skin to -1. Set it to 299 and you'll get a white male with a black leather jacket.

INI_WriteInt(File,"SavedSkin",299);
Reply
#7

Quote:
Originally Posted by Meller
Посмотреть сообщение
That doesn't matter if you're setting the default skin to -1. Set it to 299 and you'll get a white male with a black leather jacket.

INI_WriteInt(File,"SavedSkin",299);
I've done it already, and made that:
Код:
SetPlayerSkin(playerid,PlayerInfo[playerid][pSavedSkin]);
OnPlayerSpawn()

Still getting cj skin :E
Reply
#8

So debug it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)