ID 0 Teleported to Blueberry when others disconnect ? -
RobertK - 15.01.2013
Hey. I'm having a bit of trouble with my script. In fact, it's the first problem that I just couldn't find a solution to.
Anyway, the bug is ID 0 will always teleport to either blueberry fields (0.00, 0.00, 0.00) or a blank area (video).
Here's a demonstration.
[ame]http://www.youtube.com/watch?v=xgfQ7hf6toI[/ame]
I can't for the life of me find the error.
I'm willing to post any part of the script, but I can't possibly post the entire thing- it's way too many lines.
Let me know if you need to see a section and if so, which one.
A solution would be MUCH appreciated.
Also tried updating sscanf2 to the most recent one. No fix, however.
Re: ID 0 Teleported to Blueberry when others disconnect ? -
CoaPsyFactor - 15.01.2013
show us code of function OnPlayerDisconnect
Re: ID 0 Teleported to Blueberry when others disconnect ? -
LarzI - 15.01.2013
You can post the entire thing on pastebin.com.
If not, show us OnPlayerDisconnect - there has to be something there.
Re: ID 0 Teleported to Blueberry when others disconnect ? -
CoaPsyFactor - 15.01.2013
you probably put SetPlayerPos(0, x, y, z) instead of setplayerpos(playerid, x, y, z)
and reason why that is blank area its interior id if it put you on coord 0,0,0 you need to be in int 0 to see anything, or maybe it doesn't change your pos but change your interior.
Re: ID 0 Teleported to Blueberry when others disconnect ? -
SwisherSweet - 15.01.2013
Give use OnPlayerDissconnect.!!!
Re: ID 0 Teleported to Blueberry when others disconnect ? -
RobertK - 15.01.2013
OnPlayerDisconnect isn't too large- only about 100 lines considering how I don't have anything fancy like a hitman or advisor system.
I don't have a SetPlayerPos in there, believe it or not.
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
PlayersConnected--;
if(GetPVarInt(playerid, "SpeedGun") == 1) GivePlayerValidWeapon(playerid, GetPVarInt(playerid, "RadarGunPrevious"), 60000);
if(GetPVarInt(playerid, "HospitalSpawning") > 0)
{
PlayerInformation[playerid][HospitalSpawning] = 1;
}
if(control[playerid] == 1)
{
control[playerid] = 0;
KillTimer(ControlTimer[playerid]);
}
new string[128];
switch (reason)
{
case 0:
{
format(string, sizeof(string), "%s has timed out from the server.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2);
}
case 1:
{
format(string, sizeof(string), "%s has left the server.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2);
}
case 2:
{
format(string, sizeof(string), "%s was removed from the server.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2,COLOR_YELLOW2);
}
}
if(GetPVarInt(playerid, "gpsonoff") == 1) TextDrawDestroy(GPS[playerid]);
if(GetPVarInt(playerid, "fuelbar") == 1)
{
DestroyProgressBar(CarFuelBar[playerid]);
textdrawscount--;
}
gActivePlayers[playerid]--;
numplayers--;
PlayerUpdateStats(playerid);
UnloadPVehicles(playerid);
ResetPlayerWeapons(playerid);
if(PlayerBoxing[playerid] > 0)
{
if(Boxer1 == playerid)
{
if(IsPlayerConnected(Boxer1))
{
if(IsPlayerInRangeOfPoint(PlayerBoxing[Boxer2], 20.0, 768.94, -70.87, 1001.56))
{
PlayerBoxing[Boxer2] = 0;
SetPlayerPos(Boxer2, 768.48, -73.66, 1000.57);
SetPlayerInterior(Boxer2, 7);
GameTextForPlayer(Boxer2, "Opponent Disconnected", 6000, 1);
return 1;
}
PlayerBoxing[Boxer2] = 0;
SetPlayerPos(Boxer2, 765.8433,3.2924,1000.7186);
SetPlayerInterior(Boxer2, 5);
GameTextForPlayer(Boxer2, "Opponent Disconnected", 6000, 1);
}
}
else if(Boxer2 == playerid)
{
if(IsPlayerConnected(Boxer1))
{
if(IsPlayerInRangeOfPoint(PlayerBoxing[Boxer1],20.0,764.35, -66.48, 1001.56))
{
PlayerBoxing[Boxer1] = 0;
SetPlayerPos(Boxer1, 768.48, -73.66, 1000.57);
SetPlayerInterior(Boxer1, 7);
GameTextForPlayer(Boxer1, "Opponent Disconnected", 5000, 1);
return 1;
}
PlayerBoxing[Boxer1] = 0;
SetPlayerPos(Boxer1, 765.8433,3.2924,1000.7186);
SetPlayerInterior(Boxer1, 5);
GameTextForPlayer(Boxer1, "Opponent Disconnected", 5000, 1);
}
}
BoxerInsideRing = 0;
RoundStart = 0;
}
return 1;
}
Re: ID 0 Teleported to Blueberry when others disconnect ? -
ikbenremco - 15.01.2013
You can try to get tped to there DONT MOVE then /save fail C:/DOCUMENTS/SAMP savedpositions.txt copy the coordinates look for them in your GM?
Re: ID 0 Teleported to Blueberry when others disconnect ? -
RobertK - 16.01.2013
Unfortunately, there is no SetPlayerPos(playerid, 0, .. ) in the script =/
Anyone know of another possibly solution?
Re: ID 0 Teleported to Blueberry when others disconnect ? -
SwisherSweet - 16.01.2013
if(IsPlayerInRangeOfPoint(PlayerBoxing[Boxer1],20.0,764.35, -66.48, 1001.56))
Something is wrong with those 2 codes...