SetPlayerSkin problem.
#1

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!
Reply
#2

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!
Reply
#3

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.
Reply
#4

Hmm...
Have you tried it under OnPlayerSpawn already then?
Reply
#5

You mean to set the player's skin in OnPlayerSpawn callback?
Reply
#6

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
Reply
#7

Okay, I'll try later. I'll say if it worked out or not.

Thank you.
Reply
#8

Good luck!
Reply
#9

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
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)