Spawn at zero coordinates
#1

Good day.
Can you please tell us how to make sure that when the first spawner appeared on the general spawn, and on the next spawned there, where was the last time.
PHP код:
stock SetPos(playerid)
{
SetPlayerPos(playerid,pInfo[playerid][Pos][0],pInfo[playerid][Pos][1],pInfo[playerid][Pos][2]);
return 
1;
}
public 
OnPlayerSpawn(playerid)
{
new 
RandomGS random(sizeof(gRandomSkin));
SetPlayerSkin(playerid,gRandomSkin[RandomGS]);
SetPos(playerid);
}
stock SavePos(playerid)
{
    new 
Float:PosX;
    new 
Float:PosY;
    new 
Float:PosZ;
    
GetPlayerPos(playerid,PosX,PosY,PosZ);
    
pInfo[playerid][Pos][0] = PosX;
    
pInfo[playerid][Pos][1] = PosY;
    
pInfo[playerid][Pos][2] = PosZ;
    return 
true;

Reply
#2

Thanks for the help.
I want to do this:
The first spawn of the player: the player appears at certain coordinates.
The second and other spawns of the player: the player appears on coordinates from the database.
The problem is that at the first appearance, the player appears in zero coordinates.
Reply
#3

Quote:
Originally Posted by Kireykin
Посмотреть сообщение
Thanks for the help.
I want to do this:
The first spawn of the player: the player appears at certain coordinates.
The second and other spawns of the player: the player appears on coordinates from the database.
The problem is that at the first appearance, the player appears in zero coordinates.
To archieve this you could do something like:

PHP код:
New SpawnedPlayers 0;
switch(
SpawnedPlayers
{
  case 
0
  {
  
// first spawn
  
}
  case 
1
  {
  
// second spawn
  
}

SpawnedPlayers++; 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)