Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(IsConnected[playerid] == 0) return 1;
- isDead[playerid] = true; // anti cheat
- if(killerid != INVALID_PLAYER_ID) {
- PlayerTextDrawSetString(killerid, hitwin[killerid], "~w~DEAD");
- PlayerTextDrawShow(killerid, hitwin[killerid]);
- SetTimerEx("DamageWinReset", 5000, false, "i", killerid);
- }
- PlayerTextDrawSetString(playerid, hitloose[playerid], "~r~DEAD");
- PlayerTextDrawShow(playerid, hitloose[playerid]);
- SetTimerEx("DamageLooseReset", 5000, false, "i", playerid);
- if(killerid != INVALID_PLAYER_ID) {
- if(InWar[killerid] == 1)
- {
- SendClientMessage(killerid, COLOR_BLUE, "[WAR]{36a81a} +1 kill to your series.");
- if(GetPlayerWantedLevel(playerid) >= 1) {
- SendClientMessage(killerid, COLOR_BLUE, "[KILLSTREAKS]{36a81a} +200$ for killing a wanted player (+1 star).");
- GiveMoney(killerid, 200); }
- if(GetPlayerTeam(playerid) == CLAN)
- {
- SendClientMessage(killerid, COLOR_BLUE, "[GAIN]{36a81a} +5 EXP | +5 RAGE | +25 POINTS CLANS");
- }
- if(GetPlayerTeam(playerid) != CLAN)
- {
- SendClientMessage(killerid, COLOR_BLUE, "[GAIN]{36a81a} +25 EXP | +5 RAGE");
- }
- GivePlayerExp(killerid, 5);
- GivePlayerRage(killerid, 5);
- PlayerInfo[killerid][pKills]++; // On rajoute +1 dabs kes stats kills du killer
- PlayerInfo[playerid][pDeaths]++; // On rajoute +1 dans les stats morts du joueur tués
- new wanted = GetPlayerWantedLevel(killerid);
- wanted++;
- SetPlayerWantedLevel(killerid, wanted);
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- healwar = CreatePickup(1240, 8, x, y+3, z, 0);
- armourwar = CreatePickup(1242, 8, x, y+1, z, 0);
- PlayerInfo[playerid][addColis] = false;
- /*new pickid, armeid, muni;
- for (new i = 0; i <= 12; i++)
- {
- GetPlayerWeaponData(playerid, i, armeid, muni);
- if(armeid != 0)
- {
- new Float: Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- pickid = CreatePickup(GetModel(armeid), 19, Pos[0], Pos[1]+2, Pos[2], -1);
- PickInfo[pickid][Valide] = 1;
- PickInfo[pickid][ArmeID] = armeid; PickInfo[pickid][Munitions] = muni;
- GetPlayerPos(playerid, PickInfo[pickid][pX], PickInfo[pickid][pY], PickInfo[pickid][pZ]);
- }
- }*/
- if(GetPlayerTeam(playerid) == CLAN)
- {
- ClanInfo[ PlayerInfo[playerid][pTeam] ][cDeathsWar]++;
- ClanInfo[ PlayerInfo[killerid][pTeam] ][cKillsWar]++;
- ClanInfo[ PlayerInfo[playerid][pTeam] ][cPoints] += 25;
- }
- if(PlayerInfo[playerid][pHit] != 0)
- {
- // On retire l'argent/exp au mec mort :
- new hitmoney = PlayerInfo[playerid][pHit]/2;
- new hitexp = PlayerInfo[playerid][pHit]/4;
- GiveMoney(playerid, -hitmoney);
- GivePlayerExp(playerid, -hitexp);
- // On donne l'argent/exp au mec l'ayant tué :
- GiveMoney(killerid, PlayerInfo[playerid][pHit]);
- new hitwinexp = PlayerInfo[playerid][pHit]/4;
- GivePlayerExp(killerid, hitwinexp);
- new string[MAX_STRING_MSG];
- format(string, sizeof(string), "[HIT]{FFFFFF} %s has kill the hitman %s. He win %d$", GetName(killerid), GetName(playerid), PlayerInfo[playerid][pHit]);
- SendClientMessageToAll(COLOR_BLUE, string);
- PlayerInfo[playerid][pHit] = 0;
- format(string, sizeof(string), "[HIT]{FFFFFF} You have been killing by being hitman, you lose %d$ and %d EXP.", hitmoney, hitexp);
- SendClientMessage(playerid, COLOR_BLUE, string);
- format(string, sizeof(string), "[HIT]{FFFFFF} You have kill the hitman, you win %d$ and %d EXP.", PlayerInfo[playerid][pHit], hitwinexp);
- SendClientMessage(killerid, COLOR_BLUE, string);
- PlayerInfo[playerid][pHit] = 0;
- PlayerInfo[playerid][pHitTime] = 0;
- }
- }
- }
- if(PlayerInfo[playerid][inarene] == true)
- {
- Safe(playerid);
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i)) continue;
- if(ClanInfo[ PlayerInfo[playerid][pTeam] ][cID] == ClanInfo[ PlayerInfo[i][pTeam] ][cID])
- {
- ClanInfo[ PlayerInfo[playerid][pTeam] ][cPlayersInArene]--;
- if(ClanInfo[ PlayerInfo[playerid][pTeam] ][cPlayersInArene] == 0)
- {
- if(killerid != INVALID_PLAYER_ID) {
- new string[MAX_STRING_MSG];
- format(string, sizeof(string), "[ARENA]{FFFFFF} The clan %s has won the arena against %s.", ClanInfo[ PlayerInfo[killerid][pTeam] ][cName]);
- SendClientMessageToAll(COLOR_BLUE, string);
- }
- ClanInfo[ PlayerInfo[playerid][pTeam] ][cPlayersInArene] = 0;
- // Ajouter le ratio + arène
- }
- }
- }
- }
- if(killerid != INVALID_PLAYER_ID) {
- if(DuelInfo[killerid][induel] == true)
- {
- SetTimerEx("Safe", 2000, false, "i", killerid);
- new string[MAX_STRING_MSG], Float:HP, Float:ARMOUR;
- GetPlayerHealth(killerid, HP);
- GetPlayerArmour(killerid, ARMOUR);
- format(string, sizeof(string), "[DUEL]{FA9325} %s has won the duel against %s. [%0.d HP | %0.d ARM]", GetName(killerid), GetName(playerid), floatround(HP, floatround_ceil), floatround(ARMOUR, floatround_ceil));
- SendClientMessageToAll(COLOR_BLUE, string);
- SendClientMessage(killerid, COLOR_BLUE, "[SAFE]{FA9325} You will be teleported to safe zone in 2 seconds.");
- ApplyAnimation(killerid,"CASINO","manwinb",1.0,0,0,1,0,0);
- ApplyAnimation(killerid,"CASINO","manwinb",1.0,0,0,1,0,0);
- ApplyAnimation(killerid,"CASINO","manwinb",1.0,0,0,1,0,0);
- PlayerInfo[killerid][pKillsDuel]++;
- PlayerInfo[playerid][pDeathsDuel]++;
- DuelInfo[playerid][induel] = false;
- DuelInfo[killerid][induel] = false;
- DuelInfo[playerid][duelcreate] = false;
- DuelInfo[killerid][duelcreate] = false;
- ResetPlayerWeapons(playerid);
- Safe(playerid);
- }
- }
- if(WantedON == 1 && playerid == wantedplayer && killerid != INVALID_PLAYER_ID)
- {
- KillTimer(wanted_timer1[playerid]);
- KillTimer(wanted_timer2[playerid]);
- KillTimer(wanted_timer1[playerid]);
- KillTimer(wanted_timer2[playerid]);
- wantedstart(killerid);
- new string[MAX_STRING_MSG];
- format(string, 104, "[WANTED]{FFFFFF} The wanted %s was killing. %s is the new wanted.", GetName(playerid), GetName(killerid));
- SendClientMessageToAll(COLOR_BLUE, string);
- }
- if(WantedON == 1 && playerid == wantedplayer && killerid == INVALID_PLAYER_ID)
- {
- // new string[MAX_STRING_MSG];
- KillTimer(wanted_timer1[wantedplayer]);
- KillTimer(wanted_timer2[wantedplayer]);
- KillTimer(wanted_timer1[wantedplayer]);
- KillTimer(wanted_timer2[wantedplayer]);
- //SendClientMessageToAll(COLOR_BLUE, string);
- SendClientMessageToAll(COLOR_BLUE, "[WANTED] "cBlanc"The wanted committed suicide, the wanted is canceled.");
- eventencours = 0;
- WantedON = 0;
- KillTimer(wantedtimer);
- }
- // BRAQUAGE
- printf("braquage = %d", braquage);
- if(braquage == 1)
- {
- new string[MAX_STRING_MSG];
- printf("braquageencours = %d - killerid = %d", GetPVarInt(playerid, "braquageencours"), killerid);
- if(GetPVarInt(playerid, "braquageencours") == 1 && killerid != INVALID_PLAYER_ID)
- {
- DeletePVar(playerid, "braquageencours");
- format(string, sizeof(string), "[ROB]{FFFFFF} %s have kill %s in full robbery, the hold-up is canceled.", GetName(killerid), GetName(playerid));
- SendClientMessageToAll(COLOR_BLUE, string);
- KillTimer(timerbraquage);
- braquage = 0;
- KillTimer(timerid);
- }
- else if(GetPVarInt(playerid, "braquageencours") == 1 && killerid == INVALID_PLAYER_ID)
- {
- DeletePVar(playerid, "braquageencours");
- format(string, sizeof(string), "[ROB]{FFFFFF} %s committed suicide, the hold-up is canceled.", GetName(playerid));
- SendClientMessageToAll(COLOR_BLUE, string);
- KillTimer(timerbraquage);
- braquage = 0;
- KillTimer(timerid);
- }
- if(braquage == 1 && playerid == idbraqueur && killerid != INVALID_PLAYER_ID)
- {
- RemovePlayerAttachedObject(playerid, 2);
- DeletePVar(playerid, "braquageencours");
- format(string, sizeof(string), "[ROB]{FFFFFF} %s killed %s in full flight, so the bag fell.", GetName(killerid), GetName(playerid));
- SendClientMessageToAll(COLOR_BLUE, string);
- SendClientMessageToAll(COLOR_BLUE, "[ROB]{FFFFFF} Get the bag by clicking on ''Y''");
- GetPlayerPos(playerid, bInfo[posx], bInfo[posy], bInfo[posz]);
- bInfo[objetid] = CreateObject(1550, bInfo[posx], bInfo[posy], bInfo[posz]-0.5, 0.0, 0.0, 0.0);
- bInfo[texteid] = Create3DTextLabel("[ROB]\n{FFFFFF}Click ''Y'' to retrieve the bag", COLOR_BLUE, bInfo[posx], bInfo[posy], bInfo[posz], 40.0, 0, 0);
- }
- if(braquage == 1 && playerid == idbraqueur && killerid == INVALID_PLAYER_ID)
- {
- RemovePlayerAttachedObject(playerid, 2);
- DeletePVar(playerid, "braquageencours");
- format(string, sizeof(string), "[ROB]{FFFFFF} %s committed suicide, the bag fell.", GetName(playerid));
- SendClientMessageToAll(COLOR_BLUE, string);
- SendClientMessageToAll(COLOR_BLUE, "[ROB]{FFFFFF} Get the bag by clicking on ''Y''");
- GetPlayerPos(playerid, bInfo[posx], bInfo[posy], bInfo[posz]);
- bInfo[objetid] = CreateObject(1550, bInfo[posx]-0.5, bInfo[posy], bInfo[posz]-1.0, 0.0, 0.0, 0.0);
- bInfo[texteid] = Create3DTextLabel("[ROB]\n{FFFFFF}Click ''Y'' to retrieve the bag", COLOR_BLUE, bInfo[posx], bInfo[posy], bInfo[posz], 40.0, 0, 0);
- }
- }
- // =========================== [ SYSTEME DE KILL STREAKS ] ===========================
- if(killerid != INVALID_PLAYER_ID) {
- if(InWar[playerid] == 1 && InWar[killerid] == 1)
- {
- killstreaks[killerid]++;
- new string[MAX_STRING_MSG];
- if(killstreaks[killerid] == 3)
- {
- format(string, 108, "[KILLSTREAKS]{FFFFFF} %s is in series of killstreaks, he does a series of 3 kills.", GetName(killerid));
- SendClientMessageToAll(COLOR_BLUE, string);
- }
- if(killstreaks[killerid] == 6)
- {
- format(string, 108, "[KILLSTREAKS]{FFFFFF} %s is in series of killstreaks, he does a series of 6 kills.", GetName(killerid));
- SendClientMessageToAll(COLOR_BLUE, string);
- }
- if(killstreaks[killerid] == 9)
- {
- format(string, 108, "[KILLSTREAKS]{FFFFFF} %s is in series of killstreaks, he does a series of 9 kills.", GetName(killerid));
- SendClientMessageToAll(COLOR_BLUE, string);
- }
- if(killstreaks[killerid] == 12)
- {
- format(string, 108, "[KILLSTREAKS]{FFFFFF} %s is in series of killstreaks, he does a series of 12 kills.", GetName(killerid));
- SendClientMessageToAll(COLOR_BLUE, string);
- SendClientMessage(killerid, COLOR_BLUE, "[CARGAISON]{FFFFFF} Your cargo is now available, use /colis to make it appear.");
- PlayerInfo[killerid][addColis] = true;
- }
- if(killstreaks[killerid] == 15)
- {
- format(string, 108, "[KILLSTREAKS]{FFFFFF} %s is in series of killstreaks, he does a series of 15 kills.", GetName(killerid));
- SendClientMessageToAll(COLOR_BLUE, string);
- }
- if(killstreaks[killerid] == 18)
- {
- format(string, 108, "[KILLSTREAKS]{FFFFFF} %s is in series of killstreaks, he does a series of 18 kills.", GetName(killerid));
- SendClientMessageToAll(COLOR_BLUE, string);
- }
- if(killstreaks[killerid] == 21)
- {
- format(string, 108, "[KILLSTREAKS]{FFFFFF} %s is in series of killstreaks, he does a series of 21 kills.", GetName(killerid));
- SendClientMessageToAll(COLOR_BLUE, string);
- }
- if(killstreaks[killerid] == 1)
- {
- //PlayAudioStreamForPlayer(killerid, "http://k003.kiwi6.com/hotlink/lakj9wq71p/First_Blood.mp3");
- GameTextForPlayer(playerid, "~w~First Blood !", 1000, 5);
- }
- if(killstreaks[killerid] == 2)
- {
- //PlayAudioStreamForPlayer(killerid, "http://k003.kiwi6.com/hotlink/0u0flkkx91/Double_Kill_.mp3");
- GameTextForPlayer(playerid, "~w~Double Kill !", 1000, 5);
- }
- if(killstreaks[killerid] == 3)
- {
- //PlayAudioStreamForPlayer(killerid, "http://k003.kiwi6.com/hotlink/u6nculuz4n/Triple_Kill.mp3");
- GameTextForPlayer(playerid, "~w~Multi Kill !", 1000, 5);
- }
- if(killstreaks[killerid] == 4)
- {
- PlayAudioStreamForPlayer(killerid, "http://k003.kiwi6.com/hotlink/x6r5w5hnsr/Multi-Kill_.mp3");
- }
- if(killstreaks[killerid] == 6)
- {
- PlayAudioStreamForPlayer(killerid, "http://k003.kiwi6.com/hotlink/x6r5w5hnsr/Multi-Kill_.mp3");
- }
- if(killstreaks[killerid] == 9)
- {
- PlayAudioStreamForPlayer(killerid, "http://k003.kiwi6.com/hotlink/4c57mh0z8b/MonsterKill.mp3");
- }
- if(killstreaks[killerid] == 12)
- {
- PlayAudioStreamForPlayer(killerid, "http://k003.kiwi6.com/hotlink/aawon1316v/Rampage_.mp3");
- }
- if(killstreaks[killerid] == 15)
- {
- PlayAudioStreamForPlayer(killerid, "http://k003.kiwi6.com/hotlink/57bpl86yy7/GODLIKE.mp3");
- }
- if(killstreaks[killerid] == 18)
- {
- PlayAudioStreamForPlayer(killerid, "http://k003.kiwi6.com/hotlink/uxz0mro651/HolyShit.mp3");
- }
- killstreaks[playerid] = 0; // Le joueur est mort, on reset ces killstreaks.
- }
- }
- SendDeathMessage(killerid,playerid,reason);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement