Spawn a player - 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: Spawn a player (
/showthread.php?tid=352795)
Spawn a player -
Urefeu - 21.06.2012
Hello !
When a player comes on my server, it must enter a password, and selecting the sex. If a man chooses, he will spawn with a man's skin, and if he chooses a woman, it will spawn with a woman's skin. That's why I can not do. I'm putting in a SpawnPlayer OnPlayerRequestClass, and in a SetPlayerSkin OnPlayerSpawn, I can not do it.
Sex is stored in the variable sex contains 0 if male and 1 female.
Can you help me?
Thank you!
Re: Spawn a player -
[MM]RoXoR[FS] - 21.06.2012
After the code where player chooses sex etc
pawn Код:
SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
SpawnPlayer(playerid);
https://sampwiki.blast.hk/wiki/SetSpawnInfo
Re: Spawn a player -
TzAkS. - 21.06.2012
Place to OnPlayerSpawn
Код:
if(PlayerData[playerid][sex] == 1)
{
SetPlayerSkin(playerid, ID)//your skin
}
else if(PlayerData[playerid][sex] == 2)
{
SetPlayerSkin(playerid, ID)//your skin
}
It should work..
Or better..
Add SetPlayerSKin(playerid, ID) where you set the sex to 1 and 2.