Hi guys, I am currently experiencing a death spam bug. I am unsure what exactly made it happen. It is rare to other players, but it happens often to those who are lagging. I previously never had this issue.
This is my OnPlayerDeath. What seems to be the problem??
Quote:[27/05/2019 06:22:03] [connection] xxxxxxxx:21883 requests connection cookie.
[27/05/2019 06:22:05] [join] Deba has joined the server (7:xxxxxxxx)
[27/05/2019 06:22:19] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: -1036.349975, Z: 24.195400, Int: 0, World: 0, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:22:20] [death] Deba died 255
[27/05/2019 06:22:20] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: 24.195400, Z: -1036.349975, Int: 0, World: 0, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:22:20] [death] Deba died 255
[27/05/2019 06:22:21] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: 24.195400, Z: -1036.349975, Int: 0, World: 0, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:22:21] [death] Deba died 255
[27/05/2019 06:22:21] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: 24.195400, Z: -1036.349975, Int: 3, World: 107, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:22:21] [death] Deba died 255
[27/05/2019 06:22:22] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: 24.195400, Z: -1036.349975, Int: 3, World: 107, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:22:22] [death] Deba died 255
[27/05/2019 06:22:22] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: 24.195400, Z: -1036.349975, Int: 3, World: 107, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:22:22] [death] Deba died 255
[27/05/2019 06:22:23] OnPlayerSpawn - Deba (7) | X: -567.648986, Y: 24.195400, Z: -1036.349975, Int: 3, World: 107, Business: -1, Entrance: -1, House: -1
[27/05/2019 06:23:19] OnPlayerDisconnect - Deba (7) | X: -294.178710, Y: 1005.997924, Z: 19.585987, Location: Fort Carson | Int: 0, World: 0 [Reason: 1]
[27/05/2019 06:23:19] [part] Deba has left the server (7:1)
This is my OnPlayerDeath. What seems to be the problem??
Code:
public OnPlayerDeath(playerid, killerid, reason)
{
if(playerid == INVALID_PLAYER_ID) {
? ?return false; }
? ?
PlayerData[playerid][pSpawned] = 0;
new log[300], Float:pX, Float:pY, Float:pZ;
? ?new vid = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, pX, pY, pZ);
if (killerid != INVALID_PLAYER_ID)
{
? ?if (1 <= reason <= 46) {
? ? ? ?format(log, sizeof(log), "[%s] %s (%d) has killed %s (%s) [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(killerid), killerid, ReturnName(playerid), playerid, ReturnWeaponName(reason), pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
else {
? format(log, sizeof(log), "[%s] %s has killed %s (reason %d) [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(killerid), ReturnName(playerid), reason, pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
if (reason == 51 && killerid != INVALID_PLAYER_ID) {
format(log, sizeof(log), "[%s] %s has been killed by explosion by %s. [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(playerid), ReturnName(killerid), reason, pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
}
else
{
if (reason == 51)
{
if(killerid == INVALID_PLAYER_ID && IsPlayerInAnyVehicle(playerid) && vid != INVALID_VEHICLE_ID)
{
format(log, sizeof(log), "[%s] %s has been killed in a car explosion [vehicle id: %d]. [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(playerid), vid, pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
else if(killerid == INVALID_PLAYER_ID && !IsPlayerInAnyVehicle(playerid) && vid == INVALID_VEHICLE_ID)
{
? ?format(log, sizeof(log), "[%s] %s has been killed in an explosion. [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(playerid), pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
}
if (reason == 53 && killerid == INVALID_PLAYER_ID) {
format(log, sizeof(log), "[%s] %s has drowned in the water. [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(playerid), pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
if (reason == 54 && killerid == INVALID_PLAYER_ID) {
format(log, sizeof(log), "[%s] %s has fell (Splat). [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(playerid), pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
if (reason == 255 && killerid == INVALID_PLAYER_ID) {
format(log, sizeof(log), "[%s] %s has suicided. [%f %f %f] [World: %d, Int: %d] [Location: %s].", ReturnDate(), ReturnName(playerid), pX, pY, pZ, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), GetPlayerLocation(playerid));
}
}
printf(log);
return true;
}