Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
- {
- if(weaponid == 24)
- {
- if(PI[damagedid][Armor] > 1.0) setPlayerArmour(damagedid, PI[playerid][Armor]-10);
- if(PI[damagedid][Health] > 1.0) setPlayerHealth(damagedid, PI[playerid][Health]-10);
- }
- if(PI[issuerid][DzenMardSpanes] == 1)
- {
- PlayerPlaySound(issuerid,6401,0.0,0.0,0.0);
- }
- SetPVarInt(playerid, "AntiFloodHEALME", gettime() + 10);
- SetPVarInt(issuerid, "AntiFloodHEALME", gettime() + 10);
- if(PI[playerid][Health] != 0 && PI[playerid][Health] < 100)
- {
- new local_str[25];
- if(PI[playerid][Armor] != 0) format(local_str, sizeof(local_str), "HP %.0f | AR %.0f", PI[playerid][Health], PI[playerid][Armor]);
- else format(local_str, sizeof(local_str), "HP %.0f", PI[playerid][Health]);
- SetPlayerChatBubble(playerid, local_str, 0x00FF0050, 20.0, 5000);
- }
- if(weaponid == 49 && GetPlayerState(playerid) == 1 && GetPlayerState(issuerid) == 2)
- {
- if(!IsAVelik(OverallCarId[issuerid]))
- {
- if(PI[playerid][Admin] >= AdmLvl4) return 1;
- if(PIcar[issuerid][CarGUID] == OverallCarId[issuerid])
- {
- if(!PIcar[issuerid][Protipozarni] && Engine[OverallCarId[issuerid]])
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- if(IsPlayerInRangeOfPoint(issuerid, 100000000.0, x, y, z)) RemovePlayerFromVehicle(issuerid);
- Engine[OverallCarId[issuerid]] = true;
- ToggleEngine(OverallCarId[issuerid]);
- SendClientMessage(issuerid, COLOR_SYSTEM, "Ты повредил транспорт, двигатель выключен");
- }
- } else {
- if(Engine[OverallCarId[issuerid]])
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- if(IsPlayerInRangeOfPoint(issuerid, 100000000.0, x, y, z)) RemovePlayerFromVehicle(issuerid);
- Engine[OverallCarId[issuerid]] = true;
- ToggleEngine(OverallCarId[issuerid]);
- SendClientMessage(issuerid, COLOR_SYSTEM, "Ты повредил транспорт, двигатель выключен");
- }
- }
- }
- }
- return true;
- }
- public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
- {
- if(damagedid != INVALID_PLAYER_ID && PI[damagedid][Health] > 0)
- {
- if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) == 0) ClearAnimations(playerid);
- if(!PI[damagedid][GodMode])
- {
- if(weaponid == 24)
- {
- if(PI[damagedid][Armor] > 1.0) setPlayerArmour(damagedid, PI[playerid][Armor]-10);
- if(PI[damagedid][Health] > 1.0) setPlayerHealth(damagedid, PI[playerid][Health]-10);
- }
- if(weaponid == 34 || weaponid == 33)
- {
- if(bodypart == 9)
- {
- if(PI[damagedid][Armor] > 1.0) setPlayerArmour(damagedid, 0.0);
- if(PI[damagedid][Health] > 1.0) setPlayerHealth(damagedid, 0.0);
- }
- else if(bodypart == 3)
- {
- if(PI[damagedid][Armor] >= 25.0) setPlayerArmour(damagedid, 0.0);
- if(PI[damagedid][Health] >= 25.0) setPlayerHealth(damagedid, 0.0);
- }
- }
- }
- if(PI[playerid][Exp] == 0 && PI[playerid][Level] == 1)
- {
- if(weaponid == 0)
- {
- ClearAnimations(playerid);
- ApplyAnimationEx(playerid, "MISC", "plyr_shkhead", 4.0,0,0,0,0,0);
- SendClientMessage(playerid, COLOR_SYSTEM, "Первый час игры ты не можешь драться");
- }
- }
- if(PI[playerid][Faction] > 3 && PI[playerid][Faction] < 7)
- {
- if(weaponid == 3)
- {
- ClearAnimations(damagedid);
- ApplyAnimationEx(damagedid, "PED", "KO_SKID_BACK", 4.1,0,1,1,1,0);
- SetPVarInt(damagedid, "CopAttacked", 1);
- SetTimerEx("CopAttackDis", 15000, false, "d", damagedid);
- SetTimerEx("ClearAnims", 15000, false, "d", damagedid);
- }
- }
- if(IsNoDM(playerid))
- {
- ClearAnimations(playerid);
- ApplyAnimationEx(playerid, "PED", "IDLE_tired", 4.1,1,0,0,0,4500);
- ShowPlayerDialog(playerid,D_NULL,DIALOG_STYLE_MSGBOX,"{FF0000}Внимание","{FFFFFF}В данном месте запрещенно драться!","Ок","");
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement