Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerDeath(playerid, killerid, reason)
- {
- printf("[debug] OnPlayerDeath(%d, %d, %d)", playerid, killerid, reason);
- new string[256];
- foreachex(Admins,ds) {
- if(Spectate[ds] != -1) {
- if(GetDistanceBetweenPlayers(playerid,Spectate[ds]) <= 100.0) {
- if(Spectate[ds] != killerid && Spectate[ds] != playerid) {
- new namexs[30], wName[50];
- GetWeaponNameEx(reason, wName, sizeof(wName));
- format(namexs, sizeof(namexs),"No One");
- if(killerid != INVALID_PLAYER_ID) { format(namexs, sizeof(namexs),"%s",GetName(killerid)); }
- SCMF(ds, COLOR_LGREEN, "%s was killed by %s, reason: %s.",GetName(playerid),namexs,wName);
- }
- stop deathdeletetime[ds];
- SendDeathMessageToPlayer(ds, killerid, playerid, reason);
- deathdeletetime[ds] = defer DeleteDeathMessage(ds);
- }
- }
- }
- Listening[playerid] = -1;
- gPlayerUsingLoopingAnim[playerid] = 0;
- gPlayerSpawned[playerid] = 0;
- PlayerInfo[playerid][pLocal] = 255;
- if(killerid != INVALID_PLAYER_ID)
- {
- if(GetPlayerWar(PlayerInfo[playerid][pMember]) == GetPlayerWar(PlayerInfo[killerid][pMember]))
- {
- new turf = GetPlayerWar(PlayerInfo[playerid][killerid]);
- if(IsPlayerInTurf(playerid, turf))
- {
- format(string, sizeof(string), "You have been killed by %s.", GetName(killerid));
- SCM(playerid, -1, string);
- format(string, sizeof(string), "You killed %s.", GetName(playerid));
- SCM(killerid, -1, string);
- Points[killerid] ++;
- Points[playerid] --;
- mysql_format(SQL, string, sizeof string, "UPDATE `users` SET `Points` = '%d' WHERE `id` = '%d'", Points[killerid], PlayerInfo[killerid][pSQLID]);
- mysql_tquery(SQL, string, "", "");
- mysql_format(SQL, string, sizeof string, "UPDATE `users` SET `Points` = '%d' WHERE `id` = '%d'", Points[playerid], PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL, string, "", "");
- }
- }
- killerid = INVALID_PLAYER_ID;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment