Help -
Dawood - 09.07.2015
edited
Re: Help -
liquor - 09.07.2015
You should start searching for GetPlayerPos inside the OnPlayerDisconnect callback, and you would probably find where it saves your position.
Remember, if you don't have a stored position you'll have to define static coordinates as spawn locations instead...
Re: Help -
kalanerik99 - 09.07.2015
Look under
- OnPlayerDisconnect
- OnPlayerSpawn
....
And post it here
Re: Help -
Dawood - 09.07.2015
well sorry i just find this i cannot find the main thing of that see this codes OnPlayerdisconnect And and GetPlayerPos
Код:
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(biztimer{playerid});
KillTimer(attimer{playerid});
KillTimer(isletimer{playerid});
KillTimer(vegastimer{playerid});
KillTimer(redsandstimer{playerid});
KillTimer(calgtimer{playerid});
KillTimer(dragtimer{playerid});
KillTimer(banktimer{playerid});
KillTimer(nvpdtimer{playerid});
KillTimer(halltimer{playerid});
KillTimer(bartimer{playerid});
KillTimer(ammutimer{playerid});
KillTimer(shottimer{playerid});
KillTimer(clucktimer{playerid});
KillTimer(storetimer{playerid});
KillTimer(pizzatimer{playerid});
KillTimer(clubtimer{playerid});
KillTimer(gymtimer{playerid});
KillTimer(fbitimer{playerid});
KillTimer(unitimer{playerid});
KillTimer(ciatimer{playerid});
KillTimer(ZoneTimer[playerid]);
KillTimer(JailTimer[playerid]);
KillTimer(CageTimer[playerid]);
SavePosStats(playerid);
SaveGunStats(playerid);
RemovePlayerAttachedObject(playerid, 0);
RemovePlayerAttachedObject(playerid, 1);
if(IsPlayerConnected(playerid) && IsLoggedIn{playerid} == 1)
{
//
if(JailTime[playerid] > 0)
{
PlayerInfo[playerid][jTime] = JailTime[playerid];
}
if(CageTime[playerid] > 0)
{
PlayerInfo[playerid][cTime] = CageTime[playerid];
}
//
SaveBankStats(playerid);
SaveFightStats(playerid);
SaveUserStats(playerid);
SaveDegreeStats(playerid);
}
Код:
Float:GetXYPosInFrontOfPlayer(playerid, &Float:gX, &Float:gY, Float:dist)//Credits to sa-mp wiki
{
new Float:gA;
GetPlayerPos(playerid, gX, gY, gA);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
GetVehicleZAngle(GetPlayerVehicleID(playerid), gA);
}
else GetPlayerFacingAngle(playerid, gA);
{
gX += (dist * floatsin(-gA, degrees));
gY += (dist * floatcos(-gA, degrees));
}
return gA;
}
Re: Help -
kalanerik99 - 09.07.2015
show this
SavePosStats(playerid);
Re: Help -
Dawood - 09.07.2015
there is same thing i did SavePosStats(playerid); but SavePosStats comes after Lines Of OnPlayerDisConnect
This is the code of SaveposStats
Код:
SavePosStats(playerid);
SaveGunStats(playerid);
RemovePlayerAttachedObject(playerid, 0);
RemovePlayerAttachedObject(playerid, 1);
if(IsPlayerConnected(playerid) && IsLoggedIn{playerid} == 1)
{
//
if(JailTime[playerid] > 0)
{
PlayerInfo[playerid][jTime] = JailTime[playerid];
}
if(CageTime[playerid] > 0)
{
PlayerInfo[playerid][cTime] = CageTime[playerid];
}
//
SaveBankStats(playerid);
SaveFightStats(playerid);
SaveUserStats(playerid);
SaveDegreeStats(playerid);
}
Re: Help -
kalanerik99 - 09.07.2015
No no show me
Код:
stock Saveposstats(playerid)
Or
Public saveposstats(playerid)
Re: Help -
Dawood - 09.07.2015
there is just stock SavePosStats(playerid) i cannot find Public saveposstats(playerid)
Code of SavePosStats(playerid)
Код:
stock SavePosStats(playerid)
{
if(IsLoggedIn{playerid} == 1 && HasSpawned{playerid} == true)
{
new Float:x, Float:y, Float:z, Float:a, interior, world;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
interior = GetPlayerInterior(playerid);
world = GetPlayerVirtualWorld(playerid);
if(fexist(PosPath(playerid)))
{
new INI:file = INI_Open(PosPath(playerid));
INI_WriteFloat(file, "rPos_X", x);
INI_WriteFloat(file, "rPos_Y", y);
INI_WriteFloat(file, "rPos_Z", z);
INI_WriteFloat(file, "rPos_A", a);
INI_WriteInt(file, "rInterior", interior);
INI_WriteInt(file, "rWorld", world);
INI_Close(file);
}
}
return 1;
}
Re: Help -
kalanerik99 - 09.07.2015
Ok delete both this stock (whole) and under onplayerdisconnect... Saveposstats(playerid);
And show me onplayerspawn(playerid)
{
.....
Re: Help -
Dawood - 09.07.2015
Can u tell me i Need to delete this GetPlayeRposs ANd?
This is OnPlayerSpawn
Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) { SetPlayerColor(playerid, WHITE); SetPlayerSkin(playerid, 84); }
PreloadAnimationLibrary(playerid, "GRAVEYARD");
PreloadAnimationLibrary(playerid, "RAPPING");
PreloadAnimationLibrary(playerid, "PED");
PreloadAnimationLibrary(playerid, "FOOD");
PreloadAnimationLibrary(playerid, "SWEET");
PreloadAnimationLibrary(playerid, "ON_LOOKERS");
PreloadAnimationLibrary(playerid, "DEALER");
PreloadAnimationLibrary(playerid, "CRACK");
PreloadAnimationLibrary(playerid, "SMOKING");
PreloadAnimationLibrary(playerid, "BEACH");
PreloadAnimationLibrary(playerid, "PARK");
verifydestroycar{playerid} = 0;
LoadFightStyle(playerid);
StartCheckpointSeeking();
HasSpawned{playerid} = true;
HasShieldAttached{playerid} = true;
HasBandanaAttached{playerid} = false;
IsPlayerUsingAnim{playerid} = false;
ClearAnimations(playerid);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
IsInGod{playerid} = 0;
IsInGodCar{playerid} = 0;
/*if(GetPVarInt(playerid, "FirstSpawn") == 0)
{
SetTimerEx("HouseSpawning", 1000, false, "i", playerid);
}*/
if(IsAdminSpectating{playerid} == true)
{
IsAdminSpectating{playerid} = false;
SpecInfo[playerid][IsSpectating] = -1;
}
if(HasPlayerDiedInJail{playerid} == true && GetTeam{playerid} == CLASS_CIV)
{
SendPlayerToJail(playerid);
return 1;
}