How to change registration Spawn point? - 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 change registration Spawn point? (
/showthread.php?tid=468406)
How to change registration Spawn point? -
DouglasRamirez - 08.10.2013
Hello guys,
As the Title says, How to change spawn point for new players. I have my RP Server.
How can I do this?
Re: How to change registration Spawn point? -
iZN - 08.10.2013
There is a native 'SetPlayerPos' at OnPlayerSpawn callback mostly, you've to search for it. Then edit its coordinates (x, y, and z)
Re: How to change registration Spawn point? -
DouglasRamirez - 08.10.2013
Is it here?
pawn Код:
public OnPlayerSpawn(playerid)
{
if(!gPlayerLogged{playerid})
{
SendClientMessageEx(playerid, COLOR_WHITE, "ERROR: You are not logged in!");
Kick(playerid);
return 1;
}
Streamer_Update(playerid);
if(GetPVarInt(playerid, "NGPassenger") == 1)
{
new Float:X, Float:Y, Float:Z;
GetVehiclePos(GetPVarInt(playerid, "NGPassengerVeh"), X, Y, Z);
SetPlayerPos(playerid, (X-2.557), (Y-3.049), Z);
SetPlayerWeaponsEx(playerid);
GivePlayerValidWeapon(playerid, 46, 60000);
SetPlayerSkin(playerid, GetPVarInt(playerid, "NGPassengerSkin"));
SetPlayerHealth(playerid, GetPVarFloat(playerid, "NGPassengerHP"));
SetPlayerArmour(playerid, GetPVarFloat(playerid, "NGPassengerArmor"));
DeletePVar(playerid, "NGPassenger");
DeletePVar(playerid, "NGPassengerVeh");
DeletePVar(playerid, "NGPassengerArmor");
DeletePVar(playerid, "NGPassengerHP");
DeletePVar(playerid, "NGPassengerSkin");
return 1;
}
Re: How to change registration Spawn point? -
SilentSoul - 08.10.2013
pawn Код:
public OnPlayerSpawn(playerid)
Add this
pawn Код:
SetPlayerPos(playerid,float x , float y, float z);
Re: How to change registration Spawn point? -
brawrr - 08.10.2013
take this cmd, with this cmd u can know ur curent pos
Код:
if(strcmp(cmd, "/mypos", true) == 0)
{
new Float:pos[3];
GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
format(string, sizeof(string), "Your position: %f,%f,%f",pos[0],pos[1],pos[2]);
SendClientMessage(playerid, COLOR_RED, string);
return 1;
}