spawn a player
#1

Hello.

I would like to make, instead that the player can choose his class, he is directly spawn.

My code :

Код:
public OnPlayerRequestClass(playerid, classid) // When the player choose his class
        SpawnPlayer(playerid);
	return 1;
}
But here I must click on "Spawn" for spawn.

The choice of position, skin and all are in the OnPlayerSpawn.

Thank you!
Reply
#2

Do you have a registration/login system? If so, then just put SpawnPlayer right after player has registered/logged in. Otherwise try to use SpawnPlayer in OnPlayerConnect callback.
Hope it will help.
Reply
#3

Have you tried putting it at OnPlayerConnect? (Also, I though OnPlayerRequestClass was also called at the first class?)
Reply
#4

When I put the spawn depending on my connection in the OnDialogResponse, it does nothing more and I am entitled to a beautiful bug when I click on Spawn.
Reply
#5

I solved the bug, it was due to the absence of AddPlayerClass.

How to take the step of clicking on Spawn?

Thank you!
Reply
#6

Under your register or login do the following:

pawn Код:
SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
SpawnPlayer(playerid);
Just edit the setspawn info, and it works perfectly, you can remove the requestclass public.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)