OnPlayerDeath doesn't work - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerDeath doesn't work (
/showthread.php?tid=99781)
OnPlayerDeath doesn't work -
Independence - 30.09.2009
i just noticed that one of my function in OnPlayerDeath doesn't work fine
you can look my OnPlayerDeath on attach below
this one i expected to work fine but its not.
Quote:
if(PlayerInfo[playerid][pLevel] >= 1)
{
if(MedicBill[playerid] == 4) { MedicBill[playerid] = 1; return 1; }
for (new i; i<13; i++)
{
GetPlayerWeaponData(playerid, i, PlayerWeapon[playerid][i], PlayerAmmo[playerid][i]);
}
MedicBill[playerid] = 2;
GetPlayerFacingAngle(playerid, InjurAngle[playerid]);
GetPlayerPos(playerid, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
PlayerInfo[playerid][pInt] = GetPlayerInterior(playerid);
PlayerInfo[playerid][pLocal] = GetPlayerVirtualWorld(playerid);
} else { MedicBill[playerid] = 1; }
|
It doesn't work when playerid had no killerid, i mean when playerid commit suicide or something like that, that function i showed above will not worked, but when playerid got killed by someone the function above will work fine.
Re: OnPlayerDeath doesn't work -
dice7 - 30.09.2009
GetPlayerWeaponData is bugged, other then that it works fine
Re: OnPlayerDeath doesn't work -
Correlli - 30.09.2009
Quote:
Originally Posted by dice7
GetPlayerWeaponData is bugged, other then that it works fine
|
GetPlayerWeaponData works just fine.
Re: OnPlayerDeath doesn't work -
dice7 - 30.09.2009
Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by dice7
GetPlayerWeaponData is bugged, other then that it works fine
|
GetPlayerWeaponData works just fine.
|
Doesn't it return -1 for some weapons if you switch the weapons a lot using the mouse wheel ?
Re: OnPlayerDeath doesn't work -
Correlli - 30.09.2009
Quote:
Originally Posted by dice7
Doesn't it return -1 for some weapons if you switch the weapons a lot using the mouse wheel ?
|
Quote:
This function does not return a specific value, it's best to simply ignore it.
|
GetPlayerWeaponData works just fine for me and i'm sure it works fine for others, too.
@topic starter: try to debug your code.