Help with Server
#1

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

pawn Код:
SetPlayerPos(playerid, x,y,z);
You can also

pawn Код:
SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
Reply
#3

Quote:
Originally Posted by Keyhead
Посмотреть сообщение
pawn Код:
SetPlayerPos(playerid, x,y,z);
And, Where i can get the pos i want to players spawns....
Reply
#4

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);
After that go to pawno.exe, open your gamemode, press CTRL + F write OnGameModeinit you will see this
Код:
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
Reply
#5

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
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);
After that go to pawno.exe, open your gamemode, press CTRL + F write OnGameModeinit you will see this
Код:
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

Thats, the pos i want 299,1814.3000,-1373.2000,15.0781 i dont think if its that 299,1814.3000,-1373.2000,15.0781
or that AddPlayerClass(299,1814.3000,-1373.2000,15.0781,270.7000,0,0,0,0,0,0); //

Help, how can i add it then!
Reply
#6

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

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
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
But under OnGamemodeinit dont have that example you gave me, i have that, see it...

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);
Reply
#8

pawn Код:
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
Reply
#9

Oh I thought you're using a blank gamemode, then just put it as rappy said!
Reply
#10

And i need to remove the other spawn?, so the first i want to change?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)