if(JustConnected[playerid] == 1 && pInfo[playerid][Jailed] != 1) // If the player just connected and he's not jailed
{
SetPlayerPos(playerid,pInfo[playerid][posX],pInfo[playerid][posY],pInfo[playerid][posZ]);
SetPlayerInterior(playerid,pInfo[playerid][Interior]);
SetPlayerVirtualWorld(playerid,pInfo[playerid][VirtualWorld]);
JustConnected[playerid]=0;
if(pInfo[playerid][Faction] == 1)
{
GivePlayerWeapon(playerid,3,1);
switch(pInfo[playerid][Clothes])
{
case 1: SetPlayerSkin(playerid,280);
case 2: SetPlayerSkin(playerid,281);
case 3: SetPlayerSkin(playerid,284);
case 4: SetPlayerSkin(playerid,285);
case 5: SetPlayerSkin(playerid,282);
case 6: SetPlayerSkin(playerid,265);
}
SetPlayerColor(playerid,COLOR_BLUE);
}
else if(pInfo[playerid][Faction] == 3)
{
SetPlayerColor(playerid,COLOR_ORANGE);
switch(pInfo[playerid][Clothes])
{
case 1: SetPlayerSkin(playerid,197);
case 2: SetPlayerSkin(playerid,188);
case 3: SetPlayerSkin(playerid,187);
case 4: SetPlayerSkin(playerid,228);
case 5: SetPlayerSkin(playerid,240);
case 6: SetPlayerSkin(playerid,227);
}
}
}
else if(pInfo[playerid][Faction] == 1) // ... if he died/respawned he'll teleport to his faction's HQ
Can you post the loading and saving system codes for positions?
|
//Under the login dialog
pInfo[playerid][posX] = dini_Float(path,"posX");
pInfo[playerid][posY] = dini_Float(path,"posY");
pInfo[playerid][posZ] = dini_Float(path,"posZ");
pInfo[playerid][Interior] = dini_Int(path,"Interior");
pInfo[playerid][VirtualWorld] = dini_Int(path,"VirtualWorld");
//Under OnPlayerDisconnect
new Float:ppX,Float:ppY,Float:ppZ;
GetPlayerPos(playerid,ppX,ppY,ppZ);
dini_FloatSet(path, "posX", ppX);
dini_FloatSet(path, "posY", ppY);
dini_FloatSet(path, "posZ", ppZ);
dini_IntSet(path, "Interior", GetPlayerInterior(playerid));
dini_IntSet(path, "VirtualWorld", GetPlayerVirtualWorld(playerid));
New Float: X, Float: Y, Float: Z; GetPlayerPos(playerid, X, Y, Z); pInfo[playerid][posX] = X; pInfo[playerid][posY] = Y; pInfo[playerid][posZ] = Z; pInfo[playerid][Interior] = GetPlayerInterior(playerid); pInfo[playerid][VirtualWorld] = GetPlayerVirtualWorld(playerid);