How to spawn player without going to class selection - 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: How to spawn player without going to class selection (
/showthread.php?tid=615737)
How to spawn player without going to class selection -
MrViolence101 - 26.08.2016
Hello Everybody,
I am using shoebill (Pawn API for java development). How can i directly spawn the player after him logging in through the dialog by skipping the class selection as well. You can provide me with the PAWN code as well. Maybe I can easily translate the code.
I have used setSpawnInfo and spawnplayer directly after dialog response. But it goes to the class selection still.
Thanks
Re: How to spawn player without going to class selection - WhiteGhost - 26.08.2016
PHP код:
public OnPlayerRequestClass(playerid, classid)
{
SpawnPlayer(playerid);
return 1;
}
https://sampwiki.blast.hk/wiki/SpawnPlayer
Re: How to spawn player without going to class selection -
MrViolence101 - 26.08.2016
Isnt the requestclass event only for when you press the 'spawn' button
Re: How to spawn player without going to class selection -
oMa37 - 26.08.2016
Quote:
Originally Posted by MrViolence101
Isnt the requestclass event only for when you press the 'spawn' button
|
This for OnPlayerRequestSpawn.
Re: How to spawn player without going to class selection -
MrViolence101 - 26.08.2016
Quote:
Originally Posted by oMa37
This for OnPlayerRequestSpawn.
|
After I have logged in it shows me in spectating mode with the spawn buttons. When i click spawn it spawns me. I want to spawn directly after i've logged in.
Re: How to spawn player without going to class selection -
Konstantinos - 26.08.2016
When the player logins successfully, use
SetSpawnInfo and
SpawnPlayer.
Re: How to spawn player without going to class selection -
oMa37 - 26.08.2016
Try this, if not working, try using SetSpawnInfo when player login and spawn him OnPlayerRequestClass.
PHP код:
// OnPlayerConnect
TogglePlayerSpectating(playerid, true);
// OnPlayerRequestClass
SpawnPlayer(playerid);
// Login/Register Dialogs
TogglePlayerSpectating(playerid, false);
EDIT; Kosta got it first ;c