07.06.2017, 14:29
Hi there,
Basically, this seems to only happen when you kill 2 people at the same time, oddly.. It happens to the person who killed people.
I don't use 'killerid' except in a message which I know doesn't need to be checked for INVALID_KILLER_ID.
It Calls this function and I seem to crash just after it, I'm not entirely sure why.
Basically, this seems to only happen when you kill 2 people at the same time, oddly.. It happens to the person who killed people.
I don't use 'killerid' except in a message which I know doesn't need to be checked for INVALID_KILLER_ID.
It Calls this function and I seem to crash just after it, I'm not entirely sure why.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
}
PlayerDead[playerid] = 1;
DeathInt[playerid] = GetPlayerInterior(playerid);
DeathVW[playerid] = GetPlayerVirtualWorld(playerid);
GetPlayerPos(playerid, DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid]);
CauseOfDeath[playerid] = reason;
PlayerDeath(playerid);
TextDrawHideForPlayer(playerid,speed[playerid]);
TextDrawHideForPlayer(playerid,fuel[playerid]);
KillTimer(SpeedoSysTimer[playerid]);
KillTimer(BleedingTime[playerid]);
PilotJob[playerid] = 0;
PilotDTime[playerid] = 0;
TruckJob[playerid] = 0;
if(pilotveh[playerid] > 0)
{
SetVehicleToRespawn(pilotveh[playerid]);
pilotveh[playerid] = 0;
}
BleedingTime[playerid] = -1;
RodObject[playerid] = 0;
HoldingRod[playerid] = 0;
//DropGun(playerid, GetWepIndexFromSQL(GetPlayerWeaponEx(playerid)),GetPlayerAmmo(playerid),x,y,z,GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
foreach(Player, i)
{
if(AdminLevel[i] > 0)
{
SendDeathMessageToPlayer(i, killerid, playerid, reason);
}
}
//Hospitalized[playerid] = 1;
//HospitalTime[playerid] = 30;
//dohospital(playerid);
if(HoldingFurni[playerid] > 0)
{
new id = HoldingFurni[playerid];
HoldingFurni[playerid] = 0;
new Float: x, Float: y, Float: z;
GetPlayerPos(playerid, x, y, z);
RemovePlayerAttachedObject(playerid, 6);
FurniObject[id] = CreateDynamicObject(FurniModel[id], x, y, z,0.0,0.0,0.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 200);
FurniX[id] = x;
FurniY[id] = y;
FurniZ[id] = z;
FurniVW[id] = GetPlayerVirtualWorld(playerid);
FurniInt[id] = GetPlayerInterior(playerid);
SetDynamicObjectPos(FurniObject[id], FurniX[id], FurniY[id], FurniZ[id]);
SetDynamicObjectRot(FurniObject[id], FurniXR[id], FurniYR[id], FurniZR[id]);
new query[256];
format(query, sizeof(query), "UPDATE `furniture` SET FurniX = %f, FurniY = %f, FurniZ = %f, FurniXR = %f, FurniYR = %f, FurniZR = %f, FurniInt = %d, FurniVW = %d WHERE id = %d LIMIT 1",FurniX[id], FurniY[id], FurniZ[id], FurniXR[id], FurniYR[id], FurniZR[id],FurniInt[id],FurniVW[id], id);
mysql_tquery(dbHandle, query, "", "");
HoldingFurni[playerid] = 0;
}
GivePlayerMoney(playerid, 100);
return 1;
}
pawn Код:
stock PlayerDeath(playerid)
{
printf("Called Player Death");
PlayerIsDead[playerid] = 1;
SetPlayerVirtualWorld(playerid, DeathVW[playerid]);
KnockedOut[playerid] = 0;
SetPlayerInterior(playerid, DeathInt[playerid]);
new Float: ang;
GetPlayerFacingAngle(playerid, ang);
SetSpawnInfo(playerid, 0, SpawnSkin[playerid], DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid],ang, 0,0,0,0,0,0);
SpawnPlayer(playerid);
SetPlayerHealth(playerid, 99999);
new skin = GetPlayerSkinEx(playerid);
SetPlayerSkin(playerid, skin);
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid, DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid]);
SetTimerEx("DeathAnim", 350,false,"i",playerid);
DeathTimer[playerid] = 3;
TextDrawHideForPlayer(playerid,BFText);
KillTimer(BleedingTime[playerid]);
new model, GunAmmo, sqlid, string[128];
format(string, sizeof(string), "You have "COL_RED"died."COL_WHITE" Please assist players with the use of "COL_GREEN"'/do' "COL_WHITE"and do not "COL_RED"RK.");
SendClientMessage(playerid, COLOUR_WHITE, string);
SendClientMessage(playerid, COLOUR_GREY, "Depending on your cause of death, you may be revived. You must wait 3 minutes before you can '/accept death'.");
SendClientMessage(playerid, COLOUR_GREY, "EMT's have 4 minutes to respond before you cannot be revived.");
TextDrawShowForPlayer(playerid, DeadDraw[playerid]);
/*new Float: area[5];
area[0] = 0.1;
area[1] = 0.2;
area[2] = 0.3;
area[3] = 0.4;
area[4] = 0.5;
*/
if(Faction[playerid] != 1 && CauseOfDeath[playerid] != WEAPON_COLLISION)
{
for(new w = 0; w < 13; w++)
{
if(PlayerWeapons[playerid][w] > 0)
{
sqlid = PlayerWeapons[playerid][w];
model = WepModel[sqlid];
GunAmmo = WepAmmo[sqlid];
DropGun(playerid, sqlid, model,GunAmmo,DeathPosX[playerid], DeathPosY[playerid], DeathPosZ[playerid] ,DeathVW[playerid],DeathInt[playerid]);
}
}
}
return 1;
}