arbooz004
Ученик
Мод:
Инклуде:
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(IsAAntidm(playerid))//Если игрок на антиДМ зоне...
{
if(damagedid != INVALID_PLAYER_ID)//если он не отнял сам себе (мб упал или ещё что)
{
if(dmshnikk[playerid] <= 3)//
{
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "{FF0000}Anti Deat Match","{33FF00}Это зелёная зона тут драться нельзя!\nВ следуйщий раз вы будете кикнуты", "Хорошо", "");//Выводим предупреждение
dmshnikk[playerid]++;//записываем что он попал....
return true;
}
if(dmshnikk[playerid] <= 5)
{
new string[64];
new plname[32];
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "{FFFFFF}Уважаемый %s,", plname);
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, string,"{33FF00}Вы кикнуты по причине :\n{FF0000}DM in ZZ\nКод ошибки: gamemode_dmzz", "Хорошо", "");//Выводим предупреждение
SetTimerEx("Kickk",500,false,"i",playerid);//кикаем, можете забанить :D или заварнить =)
return true;
}
}
}
new string[16];
format(string, sizeof(string), "- %d {FF0000}HP", floatround(Float:amount, floatround_ceil)), SetPlayerChatBubble(damagedid, string, -1, 30.0, 5000);
return 1;
}
Код:
#if defined OnPlayerWeaponShot
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
#else
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
#endif
{
if(ACInfo[playerid][acKicked] > 0) return 1;
#if defined OnPlayerWeaponShot
if(ACInfo[playerid][acACAllow][47])
{
if(amount < 0.0 || !(0 <= damagedid < MAX_PLAYERS) || !(3 <= bodypart <= 9) || !ac_IsValidWeapon(weaponid))
{
#if defined DEBUG
printf("[Nex-AC debug] Damagedid: %d, amount: %f, weaponid: %d, bodypart: %d",
damagedid, amount, weaponid, bodypart);
#endif
ac_KickWithCode(playerid, "", 0, 47, 3);
return 1;
}
new ac_s = ac_wSlot[weaponid];
#if defined IsPlayerDying
if(!IsPlayerDying(playerid))
#else
if(!ACInfo[playerid][acDead])
#endif
{
if(ACInfo[playerid][acWeapon][ac_s] != weaponid &&
ACInfo[playerid][acSetWeapon][ac_s] != weaponid && weaponid != WEAPON_FLAMETHROWER &&
GetTickCount() - ACInfo[playerid][acGtc][6] > GetPlayerPing(playerid))
{
#if defined DEBUG
printf("[Nex-AC debug] Damagedid: %d, amount: %f, AC weapon: %d, weaponid: %d, bodypart: %d",
damagedid, amount, ACInfo[playerid][acWeapon][ac_s], weaponid, bodypart);
#endif
ac_KickWithCode(playerid, "", 0, 47, 5);
return 1;
}
}
}
#else
if(ACInfo[playerid][acACAllow][47])
{
if(amount < 0.0 || !(0 <= damagedid < MAX_PLAYERS) || !ac_IsValidWeapon(weaponid))
{
#if defined DEBUG
printf("[Nex-AC debug] Damagedid: %d, amount: %f, weaponid: %d", damagedid, amount, weaponid);
#endif
ac_KickWithCode(playerid, "", 0, 47, 3);
return 1;
}
new ac_s = ac_wSlot[weaponid];
#if defined IsPlayerDying
if(!IsPlayerDying(playerid))
#else
if(!ACInfo[playerid][acDead])
#endif
{
if(ACInfo[playerid][acWeapon][ac_s] != weaponid &&
ACInfo[playerid][acSetWeapon][ac_s] != weaponid && weaponid != WEAPON_FLAMETHROWER &&
GetTickCount() - ACInfo[playerid][acGtc][6] > GetPlayerPing(playerid))
{
#if defined DEBUG
printf("[Nex-AC debug] Damagedid: %d, amount: %f, AC weapon: %d, weaponid: %d",
damagedid, amount, ACInfo[playerid][acWeapon][ac_s], weaponid);
#endif
ac_KickWithCode(playerid, "", 0, 47, 5);
return 1;
}
}
}
#endif
