SA-MP Forums Archive
Spawn player without class - 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 player without class (/showthread.php?tid=605862)



Spawn player without class - NeXoR - 25.04.2016

How can I do that instantly after succession in logging in, the player will spawn (without that "<" ">" "Spawn" where I have to click on it.)


Re: Spawn player without class - Unte99 - 25.04.2016

SetSpawnInfo and SpawnPlayer is what you are going to need.


Re: Spawn player without class - NeXoR - 25.04.2016

Quote:
Originally Posted by Unte99
Посмотреть сообщение
SetSpawnInfo and SpawnPlayer is what you are going to need.
Add this to LoadChar function ? What team etc should I use on an RP server ?

Note: LoadChar function is used to retrieve all info from MySQL database

EDIT: The callback called after clicking this spawn button is OnPlayerRequestSpawn or OnPlayerRequestClass ?


Re: Spawn player without class - oMa37 - 25.04.2016

PHP код:
forward SkipSpawn(playerid);
public 
OnPlayerRequestClass(playerid)
{
  
SetTimerEx("SkipSpawn",0,1,"i",playerid);//It's required to have atleast 1 millisecond
  
return 1;
}
public 
SkipSpawn(playerid)
{
  
//Set Spawn Information Here Using SpawnInfo(...);
  
SpawnPlayer(playerid);
  return 
1;




Re: Spawn player without class - Unte99 - 25.04.2016

Quote:
Originally Posted by NeXoR
Посмотреть сообщение
Add this to LoadChar function ? What team etc should I use on an RP server ?

Note: LoadChar function is used to retrieve all info from MySQL database

EDIT: The callback called after clicking this spawn button is OnPlayerRequestSpawn or OnPlayerRequestClass ?
Just use those two functions in OnPlayerRequestClass. If the players data is loaded, then it is even better. You can set some parameters for the SetSpawnInfo function:

Код:
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][Skin], x, y, z, facing angle, 0, 0, 0, 0, 0, 0);