02.11.2013, 16:43
How can i change the spawn point of a newbie player, So, when he / she connects to server, spawns on a part of map, so i want to change it to other part of Los Santos
SetPlayerPos(playerid, x,y,z);
SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
Example: AddPlayerClass(107,2511.7729,-1678.3658,13.5469,45.2197,0,0,0,0,0,0);
public OnGameModeInit() { AddPlayerClass(107,2511.7729,-1678.3658,13.5469,45.2197,0,0,0,0,0,0); return 1; }
You got two choices, either AddPlayerClass or SetPlayerPos(playerid,xpos,ypos,zpos); you can get the XYZ(spawn point) by going to it ingame and then type /save [COMMENT] << this is optional.
http://prntscr.com/21fwus If you want to use AddPlayerClass then go to Documents > GTA SA user files > samp > savedposition ^ as shown above in the image then go to savedposition, copy the whole line Код:
Example: AddPlayerClass(107,2511.7729,-1678.3658,13.5469,45.2197,0,0,0,0,0,0); Код:
public OnGameModeInit() { AddPlayerClass(107,2511.7729,-1678.3658,13.5469,45.2197,0,0,0,0,0,0); return 1; } At the begin of the bracket ^ paste your code |
As I said, you copy the XYZ only if you wanna use SetPlayerPos, but now just take this AddPlayerClass(299,1814.3000,-1373.2000,15.0781,270.7000,0,0,0,0,0,0); and paste it under OnGamemodeinit
|
public OnGameModeInit()
{
ManualVehicleEngineAndLights();
DisableInteriorEnterExits();
/* ConnectNPC("Security_Guard","npcidle");
ConnectNPC("Banker","npcidle");
ConnectNPC("Bot_24","npcidle");
ConnectNPC("Bot_24_1","npcidle");
ConnectNPC("Bot_24_2","npcidle");
ConnectNPC("Bot_24_3","npcidle");
ConnectNPC("bot_10gb","npcdle");
ConnectNPC("bot_pigpen","npcidle");
ConnectNPC("bot_stripper1","npcidle");
ConnectNPC("bot_stripper2","npcidle");
ConnectNPC("Boxer","npcidle");
ConnectNPC("bot_donut","train_ls");
ConnectNPC("Bus","Bus");
ConnectNPC("Barman","npcidle");
ConnectNPC("Janet","npcidle");
ConnectNPC("Denise","npcidle");*/
print("Stage 1");
SetNameTagDrawDistance(30.0);
SendRconCommand("loadfs gates");
EnableStuntBonusForAll(0);
AddPlayerClass(299,1814.3000,-1373.2000,15.0781,270.7000,0,0,0,0,0,0); // this here