SetPlayerSkin problem. -
BaubaS - 10.05.2013
Good day. Does anybody haves an idea why it prints the correct skin ID, but sets as CJ (0)? Code:
pawn Код:
printf("userSkin: %d", userSkin);
SetSpawnInfo(playerid, 0, userSkin, userPos[0], userPos[1], userPos[2], 0, 0, 0, 0, 0, 0, 0);
SpawnPlayer (playerid);
printf("userSkin: %d", userSkin);
SetPlayerSkin(playerid, userSkin);
FreezePlayer(playerid, 2);
Both times it prints the correct skin ID (for example, 37).
Thanks in advance!
Re: SetPlayerSkin problem. -
Kwarde - 10.05.2013
Perhaps you have functions or something in OnPlayerSpawn (or any other callback that has to do with connecting and spawning and stuff) that resets the skin.
This code just seems to be right (and since userSkin doesn't have value 0 since it's printing the right ID).. Search for
SetPlayerSkin(playerid or for
SetPlayerSkin(playerid, 0) and so on!
Re: SetPlayerSkin problem. -
BaubaS - 10.05.2013
Erm, I've checked whole gamemode and its clear. Im using SetPlayerSkin only after registration, when player buys a skin and when a registered player logins.
Re: SetPlayerSkin problem. -
Kwarde - 10.05.2013
Hmm...
Have you tried it under OnPlayerSpawn already then?
Re: SetPlayerSkin problem. -
BaubaS - 10.05.2013
You mean to set the player's skin in OnPlayerSpawn callback?
Re: SetPlayerSkin problem. -
Kwarde - 10.05.2013
Precisely. I never use SetPlayerSkin if the player is not spawned. Just store the ID into a user variable (if you haven't done that yet), and then on OnPlayerSpawn you should set the skin.
If you haven't done that yet, try it, and I hope it'll work
Re: SetPlayerSkin problem. -
BaubaS - 10.05.2013
Okay, I'll try later. I'll say if it worked out or not.
Thank you.
Re: SetPlayerSkin problem. -
Kwarde - 10.05.2013
Good luck!
Re: SetPlayerSkin problem. -
BaubaS - 10.05.2013
By the way, as I dont want to create a new topic.. Have anyone used
this include with cars menu? What rotation coordinates should I set to make the car model look like that:
CAR
instead of (when setting 0.0, 0.0, 0.0)
C
A
R
Re: SetPlayerSkin problem. -
Kwarde - 10.05.2013
Sorry, I cannot help you with that because I never used it before.
Though I see this include is going to be VERY usefull for my gamemode I'm currently creating (probably won't be released since it's a small project for max. 10 players.. it's on request of my little brother :P)
Perhaps you'd better create a new topic (even though you don't want it). You have people these days that are going to respond to the title/first post only