How to make all player spawn @ one place not where they left
#1

As subject says please help me with it tell me what should i edit and thanks for that
Reply
#2

Since you didn't gave enough information, I'll assume you're using a gamemode and want to make all players spawn on one point, and not where the last time they /quit. Go to OnPlayerLogin, and remove the line where it gives out the spawn info from the userfile. It would be something like:
pawn Код:
SetPlayerPos(playerid, PlayerInfo[playerid][Posx], PlayerInfo[playerid][Posy], PlayerInfo[playerid][Posz]);//remove it
After removing it you need to delete the not used saving of the player coordinates too. You can do it by going to the callback used for saving accounts and removing the GetPlayerPos function and the saving of it in the userfiles.
Reply
#3

You have roleplay mod with new system which saves the player his position when he exists the server and when he logs back, he spawns there? if so, show us your script, at least some of it... OnPlayerDisconnect, etc.
Reply
#4

Here is it

public OnPlayerDisconnect(playerid, reason)
{
AdvertTimer[playerid] = 0;
new string[128];
new sendername[MAX_PLAYER_NAME];
new caller = Mobile[playerid];
gActivePlayers[playerid]--;
numplayers--;
PlayerInfo[playerid][pAdjustable] = 1;
if(HasPlantWeed[playerid] != 0) DestroyObject(Weed[playerid]);
DestroyPickup(BizPickupTemp[playerid]); Delete3DTextLabel(Text3D:Biz3dTextID[playerid]);
GetPlayerName(playerid, sendername, sizeof(sendername));
switch(reason)
{
case 0: format(string, sizeof(string), "* %s has left the server. (Timeout)", sendername);
case 1: format(string, sizeof(string), "* %s has left the server. (Leaving)", sendername);
case 2: format(string, sizeof(string), "* %s has left the server. (Kicked)", sendername);
}
if(PlayerInfo[playerid][pAdmin] < 2)
{
ProxDetector(30.0, playerid, string, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
}
if(PlayerTied[playerid] > 0 || PlayerCuffed[playerid] > 0 && PlayerInfo[playerid][pJailed] == 0)
{
PlayerInfo[playerid][pJailed] = 1; PlayerInfo[playerid][pJailTime] = 800;
}
OnPlayerSave(playerid);
new x = 0;
while(x != MAX_PLAYERS)
{
if(IsPlayerConnected(x) && GetPlayerState(x) == PLAYER_STATE_SPECTATING && SpectatedID[x] == playerid)
{
SetPlayerHealth(x, PlayerInfo[x][pHealth]);
SetPlayerArmour(x, PlayerInfo[x][pArmor]);
SetPlayerVirtualWorld(x, PlayerInfo[x][pVirtualWorld]);
SetPlayerInterior(x, PlayerInfo[x][pInt]);
SetPlayerPos(x, PlayerInfo[x][pSPos_x], PlayerInfo[x][pSPos_y], PlayerInfo[x][pSPos_z]);
SetPlayerFacingAngle(x, PlayerInfo[x][pSPos_r]);
SendClientMessage(x, COLOR_WHITE, "You are no longer spectating.");
TogglePlayerSpectating(x, 0);
SpectatedID[x] = INVALID_PLAYER_ID;
SpectateType[x] = ADMIN_SPEC_TYPE_NONE;
HidePM[x] = 0;
PhoneOnline[x] = 0;
ResetPlayerAdminWeaponsEx(x);
}
x++;
}
Reply
#5

You can simply do what Adil said. Go to your OnPlayerLogin callback and use the SetPlayerPos function. It will 'force' them to the position in which you set.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)