Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerDeath(playerid, killerid, reason)
- {
- KillTimerIfPossible(playerid), TogglePlayerTextdraw(playerid, false), TogglePlayerTVScreen(playerid, false);
- RemovePlayerAttachedObject(playerid, 1);
- if(IsPlayerLoggedIn(playerid))
- {
- PlayerDeath[playerid] = 1;
- new Float:getx,Float:gety,Float:getz;
- GetPlayerPos(playerid, getx, gety, getz);
- PlayerxPos[playerid] =-getx;
- PlayeryPos[playerid] =gety;
- PlayerzPos[playerid] =getz;
- SaveChar(playerid);
- HavingBall[playerid] = 0;
- if(HavingBall[playerid]) Baller = 999;
- if(DayNoDrops == 1)
- {
- for(new i=0; i<13; i++)
- {
- GetPlayerWeaponData(playerid, i, DNDW[i][0], DNDW[i][1]);
- }
- }
- if(Planted[playerid] == 1)
- {
- DestroyObject(C4[playerid]);
- Bomb[playerid] = 0;
- Planted[playerid] = 0;
- }
- Pspawned[playerid] = 0;
- new string[128];
- if(BankRobber[playerid])
- {
- new Rob = BankRobber[playerid]-1;
- DisablePlayerCheckpoint(playerid);
- BankRobbersCount --;
- format(BankRobbers[Rob], MAX_PLAYER_NAME, "");
- DeliverMoney[playerid] = 0;
- //
- foreach(Player, i)
- {
- if(BankRobber[i] || PlayerInfo[i][pFac] == 1)
- {
- if(Rob == 0) TextDrawHideForPlayer(i, Textdraw1);
- else if(Rob == 1) TextDrawHideForPlayer(i, Textdraw2);
- else if(Rob == 2) TextDrawHideForPlayer(i, Textdraw3);
- else if(Rob == 3) TextDrawHideForPlayer(i, Textdraw4);
- else if(Rob == 4) TextDrawHideForPlayer(i, Textdraw5);
- }
- }
- format(string, sizeof(string), "** %s has been hospitalized and has failed the robbery. **", RPN(playerid));
- SendRobberyMessage(COLOR_LIGHTRED, string);
- SendCopMessage(COLOR_LIGHTRED, string);
- BankRobber[playerid] = 0;
- if(BankRobbersCount == 0)
- {
- TextDrawHideForAll(Textdraw0);
- TextDrawHideForAll(Textdraw1);
- TextDrawHideForAll(Textdraw2);
- TextDrawHideForAll(Textdraw3);
- TextDrawHideForAll(Textdraw4);
- TextDrawHideForAll(Textdraw5);
- // BankRobbery = 0;
- RobberyStarted = 0;
- format(string, sizeof(string), "** The bank robbery has ended, $%d were stolen and $%d were saved. **", TotalStolen*10000, (TotalRobbers*10000-(TotalStolen*10000)));
- SendClientMessageToAll(COLOR_YELLOW, string);
- TotalRobbers = 0;
- new copsonline;
- foreach(Player, i)
- {
- if(IsACop(i)) copsonline++;
- }
- foreach(Player, i)
- {
- if(IsACop(i))
- {
- new Saved = (TotalRobbers*10000-(TotalStolen*10000));
- GiveDodMoney(i, Saved/copsonline);
- format(string, sizeof(string), "** You have received your cut from the saved money. ($%d)", Saved/copsonline);
- SendClientMessage(i, COLOR_LIME, string);
- }
- }
- }
- }
- if(!IsAFK[playerid])
- {
- if(Event[playerid])
- {
- format(string, sizeof(string), "OnEventDeath: %s has killed %s using %s.", RPN(killerid), RPN(playerid), RWN(reason));
- foreach(Player, i)
- {
- if(Event[i]) SendClientMessage(i, COLOR_REPORT, string);
- }
- Event[playerid] = 0;
- eventdeath[playerid] = 1;
- }
- if(PlayerPaintballing[playerid] == 1)
- {
- for (new i = 0; i < 13; i++)
- {
- GetPlayerWeaponData(playerid, i, pbGuns[i][0], pbGuns[i][1]);
- }
- format(string, sizeof(string), "OnPaintballDeath: %s has killed %s using %s.", RPN(killerid), RPN(playerid), RWN(reason));
- new Float:myhp;
- GetPlayerHealth(killerid, myhp);
- SetPlayerHealth(killerid, myhp+30);
- if(myhp == 100)
- {
- SetPlayerHealth(killerid, 100);
- }
- foreach(Player, i)
- {
- if(PlayerPaintballing[i]) SendClientMessage(i, COLOR_REPORT, string);
- }
- PlayerPaintballing[playerid] = 1;
- }
- else
- {
- PlayerInfo[playerid][pHospital] = 1;
- PlayerInfo[playerid][pArmor] = 0;
- if(IsPlayerLoggedIn(killerid))
- {
- format(string, sizeof(string), "SMRT: %s je ubio %s Oruzjem %s.", RPN(killerid), RPN(playerid), RWN(reason));
- SendAdminMessage(COLOR_DARKRED, 1, string);
- Log("logs/kill.log", string);
- PlayerInfo[playerid][pDeath] ++;
- PlayerInfo[killerid][pKill] ++;
- if(Hitman[killerid] == playerid)
- {
- format(string, sizeof(string), " You have been critically injured by a hitman and lost $%d, the contrat on your head was cleared.", PlayerInfo[playerid][pContract]/2);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "HitmanWarn: %s has fulfilled the contract on %s's head and collected $%d.", RPN(killerid), RPN(playerid), PlayerInfo[playerid][pContract]/2);
- SendHitmanMessage(COLOR_YELLOW, string);
- GiveDodMoney(playerid, -PlayerInfo[playerid][pContract]/2);
- GiveDodMoney(killerid, PlayerInfo[playerid][pContract]/2);
- PlayerInfo[playerid][pContract] = 0;
- format(PlayerInfo[playerid][pContract], 32, "");
- Hitman[killerid] = -1;
- PlayerInfo[killerid][pCSuccess] ++;
- }
- if(Hitman[playerid] == killerid)
- {
- format(string, sizeof(string), " You have critically injured a hitman and collected $%d, the contrat on your head was cleared.", PlayerInfo[killerid][pContract]);
- SendClientMessage(killerid, COLOR_YELLOW, string);
- format(string, sizeof(string), "HitmanWarn: %s has failed the contract on %s's head and lost $%d.", RPN(playerid), RPN(killerid), PlayerInfo[killerid][pContract]);
- SendHitmanMessage(COLOR_YELLOW, string);
- GiveDodMoney(playerid, -PlayerInfo[killerid][pContract]);
- GiveDodMoney(killerid, PlayerInfo[killerid][pContract]);
- PlayerInfo[killerid][pContract] = 0;
- format(PlayerInfo[killerid][pContract], 32, "");
- Hitman[playerid] = -1;
- PlayerInfo[playerid][pCFail] ++;
- }
- }
- }
- }
- else
- {
- GetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
- ClearDodWantedLevels(killerid);
- SetPlayerColor(killerid, TRANSPARENT_ORANGE);
- PlayerInfo[killerid][pPrison] = 2;
- PlayerInfo[killerid][pPrisonTime] = AFK[playerid];
- format(PlayerInfo[killerid][pPrisonReason], 64, "AFK igrac.");
- format(PlayerInfo[killerid][pPrisonBy], 32, "AUTO");
- TogglePlayerControllable(killerid, 0);
- SetTimerEx("EnterExitTimer", 5000, false, "i", killerid);
- SetPlayerPos(killerid, 2861.3999023438,-1768.0999755859,13.60000038147);
- SetCameraBehindPlayer(killerid);
- format(string, sizeof(string), "AdmCmd: %s je zatvoren, razlog: AFK Igra [%d Minuta]", RPN(killerid), AFK[playerid]/60);
- SendClientMessageToAll(COLOR_LIGHTRED, string);
- Log("logs/prison.log", string);
- format(string, sizeof(string), " Automatski jail: %d minuta (%d sekundi)", PlayerInfo[killerid][pPrisonTime]/60, PlayerInfo[killerid][pPrisonTime]);
- SendClientMessage(killerid, COLOR_LIGHTBLUE, string);
- }
- }
- return 1;
- }
- =======================================================================================================================================================================================================================================================================================================================================================================================================================================================ON PLAYER SPAWN ===============================================================
- =================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
- public OnPlayerSpawn(playerid)
- {
- TogglePlayerSpectating(playerid, false);
- // Anti F4 Bug - Logging/Registering
- if(!PlayerInfo[playerid][pLoggedIn] && !IsPlayerNPC(playerid))
- {
- if(IsPlayerNPC(playerid)) return 1;
- SetPlayerPos(playerid, -262.3460,-1394.9241,26.6859);
- SetSpawnInfo( playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
- new file[64];
- format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
- // Player isn't banned
- if(dini_Int(file, "AdminAccount") == 1)
- {
- format(file, sizeof(file), "users/%s.ini",RPNU(playerid));
- SetPlayerName(playerid, dini_Get(file, "OldName"));
- format(file, sizeof(file), "users/%s.ini", RPNU(playerid));
- ShowDialog(playerid, 2);
- }
- if(!dini_Exists(file))
- {
- ShowDialog(playerid, 1);
- return 1;
- }
- else
- {
- ShowDialog(playerid, 2);
- }
- return 1;
- }
- ResetPlayerWeapons(playerid);
- if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
- {
- new npcname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
- if(!strcmp(npcname, "GOD", true)) //Checking if the NPC's name is GOD
- { //Putting the NPC into the vehicle we created for it.
- return 1;
- }
- return 1;
- }
- if(PlayerInfo[playerid][pLoggedIn] && PlayerInfo[playerid][pSpawn])
- {
- SpawnChar(playerid);
- }
- if (!GetPVarInt(playerid, "color")) SetPVarInt(playerid, "color", 18643);
- if(PlayerDeath[playerid] == 1){
- SetPlayerPos(playerid, -262.3460[playerid], -1394.9241[playerid], 26.6859[playerid]);
- PlayerDied[playerid] = 0;
- SetPlayerHealth(playerid, 100);
- TogglePlayerControllable(playerid, 0);
- SetTimerEx("KillAnim", 2500, false, "i", playerid);
- PlayerInfo[playerid][pSpawnFreeze] = 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment