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;
}
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. |
New SpawnedPlayers = 0;
switch(SpawnedPlayers)
{
case 0:
{
// first spawn
}
case 1:
{
// second spawn
}
}
SpawnedPlayers++;