function SetPlayerSkin()
#1

Hi! I have a problem with SetPlayerSkin function.
My english is bad
Sorry. I'm 15 years old...

About problem.
My script get account information and insert her in "enum".

When I spawning player after authorization, player spawning with CJ skin. But in Enum "aSkin = 3"
And when i use command "/skin" - player get skin number 3.
I will make screenshots and code sections.

In "public OnPlayerConnect"
PHP код:
SetSpawnInfo(playerid000.00.00.00.0000000); 
In "stock LoadAccData(playerid)"
PHP код:
SpawnPlayer(playerid);
    
SetPlayerScore(playeridpInfo[playerid][aLevel]);
    
SetPlayerPos(playerid,1454.5363,-1439.0507,13.3906);
    
SetPlayerFacingAngle(playerid,356.4592);
    
SetCameraBehindPlayer(playerid);
    
ClearAnimations(playerid1);
    
SetPlayerSkin(playeridpInfo[playerid][aSkin]);
    
GivePlayerMoney(playeridpInfo[playerid][aMoney]); 
This stock calling after authorization or registration(select skin -> spawn( LoadAccData(playerid); )

In "CMDkin(playerid, params[])"
PHP код:
CMD:skin(playeridparams[]) {
    if(
pInfo[playerid][aLogged] == true) {
        
SetPlayerSkin(playeridpInfo[playerid][aSkin]);
    }
    return 
1;

This command I use for check enum and loading data from database.

And screenshots:
After spawning - http://i.imgur.com/wlso4c1.png
After using command "/skin" - http://i.imgur.com/V4ydDBi.png

Help please. And sorry for my very bad english
Reply
#2

In OnPlayerSpawn, set the skin to the skinid the variable holds otherwise everytime you'll re-spawn, you'll get the CJ's skin.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
In OnPlayerSpawn, set the skin to the skinid the variable holds otherwise everytime you'll re-spawn, you'll get the CJ's skin.
Thanks you!
Problem solved.
Close theme please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)