public OnPlayerDisconnect(playerid, reason)
{
if(PFlag(Robbing))
{
new i = pData[playerid][RobberyStore];
RemoveSafeMoney(Store[i][StoreSafe]);
CloseSafe(Store[i][StoreSafe]);
Store[i][StoreStatus] = STORE_HAS_ROBBED;
StopRobbery(playerid);
switch(random(4))
{
case 0:
ApplyActorAnimation(Store[i][StoreActor], "PED", "roadcross", 4.1, 1, 1, 1, 1, 0);
case 1:
ApplyActorAnimation(Store[i][StoreActor], "PED", "roadcross_female", 4.1, 1, 1, 1, 1, 0);
case 2:
ApplyActorAnimation(Store[i][StoreActor], "PED","roadcross_gang", 4.1, 1, 1, 1, 1, 0);
case 3:
ApplyActorAnimation(Store[i][StoreActor], "PED","roadcross_old", 4.1, 1, 1, 1, 1, 0);
}
}
#if defined Store_OnPlayerDisconnect
return Store_OnPlayerDisconnect(playerid, reason);
#else
return 1;
#endif
}
#if defined _ALS_OnPlayerDisconnect
#undef OnPlayerDisconnect
#else
#define _ALS_OnPlayerDisconnect
#endif
#define OnPlayerDisconnect Store_OnPlayerDisconnect
#if defined Store_OnPlayerDisconnect
forward Store_OnPlayerDisconnect(playerid, reason);
#endif
This function is not the exact cause. There are two more entries above it. Keep in mind that a stack-trace is in reverse order: the first thing that is listed is the last thing that happened. Entry #1 is a function that accepts one parameter which is likely the playerid. So that points to the function StopRobbery(). And in that function in turn there is a function that accepts one parameter and to which you passed "500". It is that last function that is the culprit.
|
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == BULLET_HIT_TYPE_PLAYER)
{
if(!IsPlayerConnected(hitid))
return 1;
if(IsPlayerLeo(playerid))
{
if(!pData[playerid][Event])
{
if(IsPlayerLeo(hitid))
return GameTextForPlayer(playerid, "Don't shoot your teammates", 3000, 3), 0;
if(!GetPlayerWantedLevel(hitid))
return GameTextForPlayer(playerid, "Don't shoot innocent player", 3000, 3), 0;
}
}
}
if(hittype == BULLET_HIT_TYPE_VEHICLE)
{
if(IsPlayerLeo(playerid))
{
foreach(new i : Player)
{
if(IsPlayerInVehicle(i, hitid) && i != playerid && IsPlayerLeo(i) && !GetPlayerVehicleSeat(i))
return GameTextForPlayer(playerid, "Don't shoot your teammates vehicle", 3000, 3), 0;
}
}
else
{
foreach(new i : Player)
{
if(IsPlayerInVehicle(i, hitid) && i != playerid && IsPlayerLeo(i) && !GetPlayerVehicleSeat(i))
{
pData[playerid][PoliceCarShot]++;
if(pData[playerid][PoliceCarShot] == 5)
UpdatePlayerWantedLevel(playerid, 6);
break;
}
}
}
}
return 1;
}