Spawn a player
#1

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)