Death Bug -
erminpr0 - 13.01.2015
This freaks me out, so anyone who tries to help rep++
When (any player) dies for a first time this happens:
If I choose 'Spawn', if my Spawn is set to House than it puts me into house interior ID, but spawns at 0.0, 0.0, 0.0 (Farm)
Next time player dies it works well...
PS. Even If i choose default spawn (Burger Shot) it does spawn me in Las Venturas aswel.
Re: Death Bug, r+ -
acade - 13.01.2015
Has SetSpawnInfo been used?
Re: Death Bug, r+ -
CalvinC - 13.01.2015
Can you show the code you are having trouble with?
Re: Death Bug, r+ -
erminpr0 - 13.01.2015
Oh, sorry, here:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
switch(PlayerInfo[playerid][pSpawn])
{
case 0: //DEFAULT SPAWN
{
new RandSpawn = random(sizeof(gRandomSpawns));
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], gRandomSpawns[RandSpawn][0], gRandomSpawns[RandSpawn][1], gRandomSpawns[RandSpawn][2], gRandomSpawns[RandSpawn][3], 0, 0, 0, 0, 0, 0);
}
case 1: //HOUSE SPAWN,
{
if(PlayerInfo[playerid][pHouse] > -1 && !strcmp(HouseInfo[PlayerInfo[playerid][pHouse]][hOwner], GetName(playerid)))
{
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], HouseInfo[PlayerInfo[playerid][pHouse]][hExitx], HouseInfo[PlayerInfo[playerid][pHouse]][hExity], HouseInfo[PlayerInfo[playerid][pHouse]][hExitz], HouseInfo[PlayerInfo[playerid][pHouse]][hExita], 0, 0, 0, 0, 0, 0);
}
else // IF HOUSE SPAWN ENABLED BUT PLAYER HAS NO HOUSE
{
PlayerInfo[playerid][pSpawn] = 0;
new RandSpawn = random(sizeof(gRandomSpawns));
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], gRandomSpawns[RandSpawn][0], gRandomSpawns[RandSpawn][1], gRandomSpawns[RandSpawn][2], gRandomSpawns[RandSpawn][3], 0, 0, 0, 0, 0, 0);
}
}
//case 2: //
}
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
switch(PlayerInfo[playerid][pSpawn])
{
case 1:
{
if(PlayerInfo[playerid][pHouse] > -1 && !strcmp(HouseInfo[PlayerInfo[playerid][pHouse]][hOwner], GetName(playerid)))
{
SetPlayerInterior(playerid, HouseInfo[PlayerInfo[playerid][pHouse]][hInterior]);
SetPlayerVirtualWorld(playerid, HouseInfo[PlayerInfo[playerid][pHouse]][hVirtualWorld]);
InsideHouse[playerid] = PlayerInfo[playerid][pHouse];
}
}
}
SetPlayerColor(playerid, 0xFFFFFFFF);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SetCameraBehindPlayer(playerid);
if(LoggedIn[playerid] == 0)
{
SendClientMessage(playerid, -1, "Spawn is not allowed before you log in.");
Kick(playerid);
}
if(GetPlayerMoney(playerid)!=SafeGetPlayerMoney(playerid))
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, SafeGetPlayerMoney(playerid));
}
return 1;
}
Re: Death Bug, r+ -
erminpr0 - 13.01.2015
Sorry for DP and bumping soon but I need to fix it ASAP, please any tips.
Re: Death Bug, r+ -
CalvinC - 14.01.2015
Can you show the code for
Re: Death Bug, r+ -
erminpr0 - 14.01.2015
Yep,
pawn Код:
new Float:gRandomSpawns[][] =
{
{1225.3550, -911.9344, 42.9042, 180.9877},
{1214.3273, -912.6891, 42.9221, 186.1474},
{1178.1221, -923.3962, 43.2824, 280.1066},
{1173.3086, -900.3580, 43.3207, 274.1322},
{1186.1583, -881.0073, 43.1301, 184.5180},
{1209.3945, -875.6597, 42.9195, 187.7767}
};
EDIT: Fixed, Lol I used TogglePlayerSpec(true) on Connecting, thank you all for help.