function SetPlayerSkin() - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: function SetPlayerSkin() (
/showthread.php?tid=526311)
function SetPlayerSkin() -
Dillvish - 16.07.2014
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(playerid, 0, 0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
In "stock LoadAccData(playerid)"
PHP код:
SpawnPlayer(playerid);
SetPlayerScore(playerid, pInfo[playerid][aLevel]);
SetPlayerPos(playerid,1454.5363,-1439.0507,13.3906);
SetPlayerFacingAngle(playerid,356.4592);
SetCameraBehindPlayer(playerid);
ClearAnimations(playerid, 1);
SetPlayerSkin(playerid, pInfo[playerid][aSkin]);
GivePlayerMoney(playerid, pInfo[playerid][aMoney]);
This stock calling after authorization or registration(select skin -> spawn( LoadAccData(playerid); )
In "CMD

kin(playerid, params[])"
PHP код:
CMD:skin(playerid, params[]) {
if(pInfo[playerid][aLogged] == true) {
SetPlayerSkin(playerid, pInfo[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
Re: function SetPlayerSkin() -
Konstantinos - 16.07.2014
In OnPlayerSpawn, set the skin to the skinid the variable holds otherwise everytime you'll re-spawn, you'll get the CJ's skin.
Re: function SetPlayerSkin() -
Dillvish - 16.07.2014
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.