public OnPlayerDeath(playerid, killerid, reason)
{
new pname[24];
new string[120];
new killername[24];
Killz[killerid] ++; // The killer value will be increased
Deathz[playerid] ++; // The death value will be increased
// Killing Timer
//
//
new rand4= random(10000);
GivePlayerMoney(playerid, -rand4);
//SendClientMessage(playerid, COLOR_LIGHTBLUE, "[INFO]: "COL_LRED2"You have been charged $2,000 for medical services.");
SetPlayerWantedLevel(playerid, 0);
if(!IsPlayerConnected(killerid))
{
format(string, sizeof(string), "[DEATH] %s killed himself.", PlayerInfo(playerid));
print(string);
return 1;
}
TextDrawHideForPlayer(playerid, Login[playerid]);
TextDrawHideForPlayer(playerid, Continue[playerid]);
PlayerTextDrawHide(playerid, HasAccount[playerid]);
PlayerTextDrawHide(playerid, NewMem[playerid]);
//PlayerTextDrawHide(playerid, BOX1[playerid]);
PlayerTextDrawHide(playerid, BOX2[playerid]);
PlayerTextDrawHide(playerid, BOX3[playerid]);
PlayerTextDrawHide(playerid, WelcomeiTD[playerid]);
PlayerTextDrawHide(playerid, WelcomeiTD2[playerid]);
PlayerTextDrawHide(playerid, star1[playerid]);
PlayerTextDrawHide(playerid, star2[playerid]);
PlayerTextDrawHide(playerid, Promtw[playerid]);
PlayerTextDrawHide(playerid, Promtw2[playerid]);
PlayerTextDrawHide(playerid, TIP[playerid]);
PlayerTextDrawHide(playerid, CF[playerid]);
PlayerTextDrawHide(playerid, JailS[playerid]);
TextDrawHideForPlayer(playerid, RBINP);
TextDrawHideForPlayer(playerid, RBMAINBOX);
TextDrawHideForPlayer(playerid, RBNAME[playerid]);
TextDrawHideForPlayer(playerid, RBCL);
TextDrawHideForPlayer(playerid, RBCLR);
TextDrawHideForPlayer(playerid, PBar[playerid]);
TextDrawHideForPlayer(playerid, PBarBack);
TextDrawHideForPlayer(playerid, STCHECKPOINT);
//Death Info
TextDrawShowForPlayer(playerid, DeathMainBox);
TextDrawShowForPlayer(playerid, DeathMainBox2);
TextDrawShowForPlayer(playerid, DeathInfo);
TextDrawShowForPlayer(playerid, IfDM);
new stringD[160];
format(stringD, 160, "~y~~h~Death~r~:~w~%d",Deathz[playerid]);
TextDrawSetString(DeathA[playerid],stringD);
TextDrawShowForPlayer(playerid, DeathA[playerid]);
//kills
format(stringD, 160, "~y~~h~Kills~r~:~w~%d",Killz[playerid]);
TextDrawSetString(KillsA[playerid],stringD);
TextDrawShowForPlayer(playerid, KillsA[playerid]);
//Killername
format(stringD, 160, "~y~~h~Killed by~r~:~w~%s",PlayerName(killerid));
TextDrawSetString(Killedby[playerid],stringD);
TextDrawShowForPlayer(playerid, Killedby[playerid]);
//
format(stringD, 160, "~y~~h~Medical Fees~r~: ~g~$~w~~h~%d",rand4);
TextDrawSetString(MedsA[playerid],stringD);
TextDrawShowForPlayer(playerid, MedsA[playerid]);
public OnPlayerDeath(playerid, killerid, reason)
{
new pname[24];
new string[120];
new killername[24];
Killz[killerid] ++; // The killer value will be increased
Deathz[playerid] ++; // The death value will be increased
// Killing Timer
//
//
new rand4= random(10000);
GivePlayerMoney(playerid, -rand4);
//SendClientMessage(playerid, COLOR_LIGHTBLUE, "[INFO]: "COL_LRED2"You have been charged $2,000 for medical services.");
SetPlayerWantedLevel(playerid, 0);
if(!IsPlayerConnected(killerid))
{
format(string, sizeof(string), "[DEATH] %s killed himself.", PlayerInfo(playerid));
print(string);
return 1;
}
TextDrawHideForPlayer(playerid, Login[playerid]);
TextDrawHideForPlayer(playerid, Continue[playerid]);
PlayerTextDrawHide(playerid, HasAccount[playerid]);
PlayerTextDrawHide(playerid, NewMem[playerid]);
//PlayerTextDrawHide(playerid, BOX1[playerid]);
PlayerTextDrawHide(playerid, BOX2[playerid]);
PlayerTextDrawHide(playerid, BOX3[playerid]);
PlayerTextDrawHide(playerid, WelcomeiTD[playerid]);
PlayerTextDrawHide(playerid, WelcomeiTD2[playerid]);
PlayerTextDrawHide(playerid, star1[playerid]);
PlayerTextDrawHide(playerid, star2[playerid]);
PlayerTextDrawHide(playerid, Promtw[playerid]);
PlayerTextDrawHide(playerid, Promtw2[playerid]);
PlayerTextDrawHide(playerid, TIP[playerid]);
PlayerTextDrawHide(playerid, CF[playerid]);
PlayerTextDrawHide(playerid, JailS[playerid]);
TextDrawHideForPlayer(playerid, RBINP);
TextDrawHideForPlayer(playerid, RBMAINBOX);
TextDrawHideForPlayer(playerid, RBNAME[playerid]);
TextDrawHideForPlayer(playerid, RBCL);
TextDrawHideForPlayer(playerid, RBCLR);
TextDrawHideForPlayer(playerid, PBar[playerid]);
TextDrawHideForPlayer(playerid, PBarBack);
TextDrawHideForPlayer(playerid, STCHECKPOINT);
//Death Info
TextDrawShowForPlayer(playerid, DeathMainBox);
TextDrawShowForPlayer(playerid, DeathMainBox2);
TextDrawShowForPlayer(playerid, DeathInfo);
TextDrawShowForPlayer(playerid, IfDM);
new stringD[160];
format(stringD, 160, "~y~~h~Death~r~:~w~%d",Deathz[playerid]);
TextDrawSetString(DeathA[playerid],stringD);
TextDrawShowForPlayer(playerid, DeathA[playerid]);
//kills
format(stringD, 160, "~y~~h~Kills~r~:~w~%d",Killz[playerid]);
TextDrawSetString(KillsA[playerid],stringD);
TextDrawShowForPlayer(playerid, KillsA[playerid]);
//Killername
format(stringD, 160, "~y~~h~Killed by~r~:~w~%s",PlayerName(killerid));
TextDrawSetString(Killedby[playerid],stringD);
TextDrawShowForPlayer(playerid, Killedby[playerid]);
//
format(stringD, 160, "~y~~h~Medical Fees~r~: ~g~$~w~~h~%d",rand4);
TextDrawSetString(MedsA[playerid],stringD);
TextDrawShowForPlayer(playerid, MedsA[playerid]);
///////////////////////
format(string, sizeof(string), "%s has killed %s (%s)", PlayerInfo(killerid),PlayerInfo(playerid), aWeaponNames[reason]);
print(string);
if(gTeam[killerid] == Team_Cop || gTeam[killerid] == Team_Army || gTeam[killerid] == Team_FBI)
{
if(gTeam[playerid] == Team_Cop || gTeam[playerid] == Team_Army || gTeam[playerid] == Team_FBI)
{
format(string, 120, "[TEAM KILL] %s was killed by %s (%s)", PlayerInfo(playerid), PlayerInfo(killerid), aWeaponNames[reason]);
print(string);
DecreaseScore(killerid, 1);
return 1;
}
if(gTeam[playerid] == Team_Civi)
{
new pwl = GetPlayerWantedLevel(playerid);
if(pwl == 0)
{
format(string, sizeof(string), "Police Officer %s has taken down innocent civillian %s with deadly force.", PlayerInfo(killerid), PlayerInfo(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
print(string);
DecreaseScore(killerid, 1);
return 1;
}
if(pwl == 1 || pwl == 2)
{
format(string, sizeof(string), "Police Officer %s has taken down least wanted player %s with deadly force", PlayerInfo(killerid), PlayerInfo(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
print(string);
DecreaseScore(killerid, 1);
return 1;
}
if(pwl == 3 || pwl == 4 || pwl == 5)
{
format(string, sizeof(string), "Police officer %s has taken down wanted suspect %s with deadly force", PlayerInfo(killerid), PlayerInfo(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
print(string);
IncreaseScore(killerid, 1);
GivePlayerMoney(killerid, 5000);
return 1;
}
if(pwl == 6)
{
format(string, sizeof(string), "Police Officer %s has taken down most wanted suspect %s with deadly force", PlayerInfo(killerid), PlayerInfo(playerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
print(string);
IncreaseScore(killerid, 2);
GivePlayerMoney(killerid, 10000);
return 1;
}
if(InAdminMode[killerid] == 1)
{
format(string,sizeof(string),"[ADMIN KILL] Administrator %s(%d) has killed %s(%d) while in admin mode.",killername,killerid,pname,playerid);
SendClientMessageToAll(COLOR_ADMIN,string);
SetPlayerColor(playerid,COLOR_DEADCONNECT);
SetPlayerWantedLevel(playerid,0);
SendDeathMessage(killerid,playerid,reason);
return 1;
}
if(HasHit[playerid] >= 1)
{
GivePlayerMoney(killerid,HitMoney[playerid]);
IncreaseWantedLevel(killerid,6);
format(string, 128, "[[_Contract Kill_]] \nYou have killed %s(%d) for a hit contract and recieved $%d for the kill.",PlayerName(playerid),playerid,HitMoney[playerid]);
SendClientMessageToAll(COLOR_GREEN, string);
/*format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has murdered %s(%d) and has been caught on CCTV. Arrest the suspect ASAP.",killername,killerid,pname,playerid);
SendClientMessageToAllCops(string);*/
HasHit[playerid] =0;
HitMoney[playerid] =0;
SetPlayerWantedLevel(playerid,0);
SendDeathMessage(killerid,playerid,reason);
return 1;
}
}
}
AccountInfo[playerid][pHasSTDs] = 0;
AccountInfo[playerid][pCuffTimer] = 0;
AccountInfo[playerid][pLastVehicle] = 0;
SetPVarInt(playerid, "InEvent", 0);
AccountInfo[playerid][pCalledForMedic] = 0;
AccountInfo[playerid][pIsSick] = 0;
AccountInfo[playerid][pHasSecureWallet] =0;
playerCheckpoint[playerid] =0;
HasSecureWallet[playerid] =0;
IsSpawned[playerid] =0;
AttemptedToRobRecently[playerid] =0;
HasRobbedRecently[playerid] =0;
IsFrozen[playerid] =0;
IsKidnapped[playerid] =0;
InAdminMode[playerid] =0;
AccountInfo[playerid][pUsedHealme] = 0;
return 1;
}
I guess he got desynced? I'd recommend you to read this thread https://sampforum.blast.hk/showthread.php?pid=876854#pid876854
|