SA-MP Forums Archive
Realy big problem, with setting skin on spawning. - 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: Realy big problem, with setting skin on spawning. (/showthread.php?tid=487047)



Realy big problem, with setting skin on spawning. - AA9 - 11.01.2014

Hey, i have mindfucked all day and all night, because i spawn always with CJ skin. I set SpawnInfo, before spawning and into skin parameter i put skin variable, which is retrieved from MySQL. But problem is that, i spawn ALWAYS with CJ skin. Im 100% sure, that my code is OK. If anyone is ever had that kind of problem and might know the solution, please help me.


Re: Realy big problem, with setting skin on spawning. - 1FreeHost - 11.01.2014

Newer heard of something like this.


Re : Realy big problem, with setting skin on spawning. - TheSy - 11.01.2014

pawn Код:
SetSpawnInfo(playerid, 0, 123, X, Y, Z, A, 0, 0, 0, 0, 0, 0); // You will spawn with skin number 123.
SpawnPlayer(playerid); // Spawn the player is forced.
If you are using MySQL, it may be a field in your table that contains the skin and on your gamemode you PlayerInfo a variable or other (pInfo...), and we must proceed like this:

pawn Код:
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], X, Y, Z, A, 0, 0, 0, 0, 0, 0); // We will look for the skin that the player has.
SpawnPlayer(playerid); // Spawn the player is forced.



Re: Realy big problem, with setting skin on spawning. - AA9 - 12.01.2014

Iґl put my code here.

pawn Код:
mysql_fetch_field_row(savingstring, "skin");    PlayerInfo[playerid][pSkin] = strval(savingstring);



else if(PlayerInfo[playerid][pEsmanelog] == 1)
{
format( string, sizeof( string ), "Tere tulemast tagasi, "VROHELINE"%s", GetName(playerid));
SendClientMessage(playerid, COLOR_GREY,string);
 SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pLastX],PlayerInfo[playerid][pLastY],PlayerInfo[playerid][pLastZ], 0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}



Re: Realy big problem, with setting skin on spawning. - AA9 - 12.01.2014

Fixed.