Raised This Month: $299 Target: $400
 74% 

help, plugin furien


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sssss1
Junior Member
Join Date: Jan 2022
Old 01-15-2022 , 03:19   help, plugin furien
Reply With Quote #1

hello, I'm new to this forum so I don't know if I found the right section to post, I have a furious base that has a grenade problem, don't give dmg to players
Code:
]#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <fun>

#define PLUGIN "Furien Clasic"
#define VERSION "-"
#define AUTHOR "aragon"

#define DMG_HEGRENADE (1<<24)

#define FURIEN_GRAVITY 0.4
#define FURIEN_SPEED 850.0
#define TEAM_FURIEN 1
#define TEAM_ANTIFURIEN 2

#define TASKID_CANPLANT 10001
#define TASKID_C4COUNTDOWN 453

#define VIP_GOLD_LEVEL ADMIN_LEVEL_H
#define VIP_SILVER_LEVEL ADMIN_LEVEL_G
#define FOUNDER_LEVEL ADMIN_IMMUNITY
#define VIP_PLATINUM_LEVEL ADMIN_LEVEL_E
#define VIP_DIAMOND_LEVEL ADMIN_LEVEL_F
#define VIP_BRONZE_LEVEL ADMIN_LEVEL_D

#if cellbits == 32
#define OFFSET_BZ 235
#else
#define OFFSET_BZ 268
#endif

//Shop
new SuperKnifeModel_V[] = "models/sk/v_superknife.mdl"
new bool: HaveSuperKnife[33]

//Settings
new bool:MakeVisible[33], Float:Wallorigin[33][3]

//Parachute
#define PARACHUTE_CLASS "Parachute"
new ParaENT[33];

new Menu;
new furienspawnhp, antifurienspawnhp, removebuyzone, superknife_damage_multiplier, cvar_autojoin_class, cvar_autojoin_team, cvar_aim_info,
MSGID_SayText, MSGID_StatusIcon, MSGID_TextMsg, MSGID_SendAudio, MSGID_ShowMenu, MSGID_VGUIMenu, MSGID_Health, MSGID_ScreenFade,
bool:CanPlant, C4_CountDownDelay;

public plugin_cfg() {
server_cmd("amx_cvar mp_playerid 2")
server_cmd("amx_cvar sv_maxspeed 999")
server_cmd("amx_cvar sv_restart 5")
}


//============================================= ============================================= =//
//===============================[Weapons Settings]=========================================//
//============================================= ============================================//
new bool:HavePrimaryWeapon[33], bool:HaveSecondaryWeapon[33], PrimaryWeapon[33], SecondaryWeapon[33];

//---|| Primary
#define M4A1_KEY 100
#define AK47_KEY 101
#define M3_KEY 102
#define AUG_KEY 103
#define FAMAS_KEY 104
#define MP5_KEY 105
#define XM1014_KEY 106

//---|| Secondary
#define USP_KEY 107
#define DEAGLE_KEY 108
#define ELITE_KEY 109
#define FIVESEVEN_KEY 110

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)

antifurienspawnhp = register_cvar("antifurien_spawnhp", "100")
furienspawnhp = register_cvar("furien_spawnhp", "100")
superknife_damage_multiplier = register_cvar("superknife_damage_multiplier", "2.0")
cvar_autojoin_team = register_cvar("furien_team", "5")
cvar_autojoin_class = register_cvar("furien_class", "5")
cvar_aim_info = register_cvar("furien_enable_aiminfo", "1")

MSGID_SayText = get_user_msgid("SayText")
MSGID_StatusIcon = get_user_msgid("StatusIcon")
MSGID_TextMsg = get_user_msgid("TextMsg")
MSGID_SendAudio = get_user_msgid("SendAudio")
MSGID_ShowMenu = get_user_msgid("ShowMenu")
MSGID_VGUIMenu = get_user_msgid("VGUIMenu")
MSGID_ScreenFade = get_user_msgid("ScreenFade")

register_clcmd("say shop", "CmdShopMenu")
register_clcmd("say /shop", "CmdShopMenu")
register_clcmd("say_team shop", "CmdShopMenu")
register_clcmd("say_team /shop", "CmdShopMenu")
//register_clcmd("say weapons", "CmdWeaponsMenu")
//register_clcmd("say /weapons", "CmdWeaponsMenu")
register_clcmd("jointeam", "CMD_BlockJoinTeam")
register_clcmd("jointeam 1", "CMD_BlockJoinTeam")
register_clcmd("jointeam 2", "CMD_BlockJoinTeam")
register_clcmd("jointeam 3", "CMD_BlockJoinTeam")
register_clcmd("chooseteam", "CMD_BlockChooseTeam")
register_clcmd("say /beneficii", "CmdShowMotd")
register_clcmd("say /rs", "CmdResetScore")
register_clcmd("say_team /rs", "CmdResetScore")
register_clcmd("say /resetscore", "CmdResetScore")
register_clcmd("say_team /resetscore", "CmdResetScore")

RegisterHam(Ham_Spawn, "player", "Ham_Spawn_Post", 1)
RegisterHam(Ham_Touch, "weaponbox", "HAM_Touch_Weapon")
RegisterHam(Ham_Touch, "armoury_entity", "HAM_Touch_Weapon")
RegisterHam(Ham_Touch, "weapon_shield", "HAM_Touch_Weapon")
RegisterHam(Ham_TakeDamage, "player", "SuperKnife_TakeDamage")
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_c4", "C4_PrimaryAttack");

register_forward(FM_PlayerPreThink, "Player_PreThink");
register_forward(FM_AddToFullPack, "FWD_AddToFullPack", 1);
register_forward(FM_PlayerPreThink, "FWD_ParachutePreThink");

register_event("CurWeapon", "EVENT_CurWeapon", "be", "1=1")
register_event("DeathMsg", "EVENT_Death", "a");
register_event("SendAudio", "EVENT_SwitchTeam", "a", "1=0", "2=%!MRAD_ctwin");
register_event("HLTV", "EVENT_NewRound", "a", "1=0", "2=0");
register_event("TextMsg", "EVENT_FireINTheHole", "b", "2&#Game_radio", "4&#Fire_in_the_hole")
register_event("TextMsg", "EVENT_FireINTheHole", "b", "3&#Game_radio", "5&#Fire_in_the_hole")


register_message(MSGID_StatusIcon, "MSG_StatusIcon");
register_message(MSGID_TextMsg, "MSG_TextMessage");
register_message(MSGID_ShowMenu, "MSG_ShowMenu");
register_message(MSGID_VGUIMenu, "MSG_VGUIMenu");
register_message(MSGID_SendAudio, "MSG_SendAudio");
register_message(MSGID_Health, "MSG_Health")
register_message(MSGID_ScreenFade, "MSG_ScreenFade")
}


public plugin_precache() {
removebuyzone = register_cvar("furien_removebuyzone", "1")

if(get_pcvar_num(removebuyzone)) {

remove_entity_name("info_map_parameters");
remove_entity_name("func_buyzone");

new Entity = create_entity("info_map_parameters");

DispatchKeyValue(Entity, "buying", "3");
DispatchSpawn(Entity);
}
precache_model(SuperKnifeModel_V)
}

public client_connect(id) {
client_cmd(id, "cl_forwardspeed 999.0")
client_cmd(id, "cl_sidespeed 999.0")
client_cmd(id, "cl_backspeed 999.0")
}

public client_putinserver(id) {
client_cmd(id, "cl_forwardspeed 999.0")
client_cmd(id, "cl_sidespeed 999.0")
client_cmd(id, "cl_backspeed 999.0")
PrimaryWeapon[id] = 0
SecondaryWeapon[id] = 0
}


public Ham_Spawn_Post(id) {
if(is_user_connected(id) && is_user_alive(id)) {
strip_user_weapons(id)
HavePrimaryWeapon[id] = false
HaveSecondaryWeapon[id] = false
switch(get_user_team(id)) {
case TEAM_FURIEN: {
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_knife")
set_user_footsteps(id, 1)
fm_set_user_health(id, get_pcvar_num(furienspawnhp))
}
case TEAM_ANTIFURIEN: {
fm_give_item(id, "weapon_hegrenade")
fm_give_item(id, "weapon_knife")
set_user_footsteps(id, 0)
fm_set_user_health(id, get_pcvar_num(antifurienspawnhp))
HaveSuperKnife[id] = false;
Equipment(id)
}
}
}
}

public EVENT_NewRound()
{
CanPlant = false;
remove_task(TASKID_CANPLANT)
remove_task(TASKID_C4COUNTDOWN)

new Float:FloatTime = get_cvar_num("mp_freezetime") + (get_cvar_num("mp_roundtime") * 60) - 60.0
set_task(FloatTime, "TASK_CanPlant", TASKID_CANPLANT)
}

public EVENT_FireINTheHole()
return PLUGIN_HANDLED

public HAM_Touch_Weapon(ent, id) {
if(is_user_alive(id) && get_user_team(id) == TEAM_FURIEN && !(get_pdata_cbase(ent, 39, 4) > 0))
return HAM_SUPERCEDE

return HAM_IGNORED
}

public SuperKnife_TakeDamage(Victim, Inflictor, Attacker, Floatamage, DamageType) {
if(is_user_connected(Attacker) && is_user_alive(Attacker) && is_user_connected(Victim)) {
if(get_user_weapon(Attacker) == CSW_KNIFE) {
if(HaveSuperKnife[Attacker])
SetHamParamFloat(4, Damage * get_pcvar_float(superknife_damage_multiplier) )
}
if(get_user_flags(Victim) & VIP_GOLD_LEVEL) {
if(DamageType & DMG_HEGRENADE)
return HAM_SUPERCEDE
}
}
return HAM_IGNORED
}

///////////////////////////////////////////////////////////////////////////////////////////////

public C4_PrimaryAttack(iEnt)
{
new id = pev( iEnt, pev_owner );

if(!CanPlant)
{
client_print( id, print_center, "Nu poti planta bomba decat in ultimele 60 secunde!" );
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}

public CmdResetScore(id) {
if(get_user_frags(id) == 0 && get_user_deaths(id) == 0)
ColorChat(id, "!y[!gFURIEN!y] Scorul tau este deja!g 0-0 !")
else {
for(new i = 0; i < 2; i++) {
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
}
ColorChat(id, "!y[!gFURIEN!y] Ti-ai resetat scorul cu succes !")
}
}

public CmdShopMenu(id) {
if(!is_user_alive(id))
return PLUGIN_HANDLED
switch(get_user_team(id)) {
case TEAM_FURIEN: CmdFurienShop(id)
case TEAM_ANTIFURIEN: CmdAntiFurienShop(id)
}
return PLUGIN_HANDLED
}

public CmdFurienShop(id) {
if(is_user_alive(id) && get_user_team(id) == TEAM_FURIEN) {
Menu = menu_create("\yFurien Shop", "CmdFurienHandler")

new SuperKnife[256];
formatex(SuperKnife, sizeof(SuperKnife)-1, "Super knife - \r10000$")
menu_additem(Menu, SuperKnife, "1", 0)

new Armor[256];
formatex(Armor, sizeof(Armor)-1, "50 AP + Helmet - \r500$")
menu_additem(Menu, Armor, "2", 0)

new Health[256];
formatex(Health, sizeof(Health)-1, "50 HP - \r3000$")
menu_additem(Menu, Health, "3", 0)

new Grenade[256];
formatex(Grenade, sizeof(Grenade)-1, "He grenade - \r4000$")
menu_additem(Menu, Grenade, "4", 0)

menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, Menu, 0);
}
}

public CmdAntiFurienShop(id) {
if(is_user_alive(id) && get_user_team(id) == TEAM_ANTIFURIEN) {
Menu = menu_create("\yAnti-Furien Shop", "CmdAntiFurienHandler")

new Defuse[256];
formatex(Defuse, sizeof(Defuse)-1, "Defuse kit - \r500$")
menu_additem(Menu, Defuse, "1", 0)

new Armor[256];
formatex(Armor, sizeof(Armor)-1, "50 AP + Helmet - \r500$")
menu_additem(Menu, Armor, "2", 0)

new Health[256];
formatex(Health, sizeof(Health)-1, "50 HP - \r3000$")
menu_additem(Menu, Health, "3", 0)

new Grenade[256];
formatex(Grenade, sizeof(Grenade)-1, "He grenade - \r4000$")
menu_additem(Menu, Grenade, "4", 0)

menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, Menu, 0);
}
}

public CmdFurienHandler(id, menu, item) {
if(item == MENU_EXIT || !is_user_alive(id) || get_user_team(id) != 1) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new Data[6], Name[64];
new Access, CallBack;
menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
new Key = str_to_num(Data);
switch(Key) {
case 1: {
if(HaveSuperKnife[id])
client_print(id, print_center, "You already have SuperKnife!")
else {
new Money = cs_get_user_money(id) - 10000
if(Money < 0)
client_print(id, print_center, "You have insufficient founds!")
else {
HaveSuperKnife[id] = true;
EVENT_CurWeapon(id)
cs_set_user_money(id, Money)
}
}
}
case 3: {
if(get_user_health(id) >= 250)
client_print(id, print_center, "You already have 250 HP!")
else {
new Money = cs_get_user_money(id) - 3000
if(Money < 0)
client_print(id, print_center, "You have insufficient founds!")
else {
if(get_user_health(id) + 50 > 250)
fm_set_user_health(id, 250)
else
fm_set_user_health(id, get_user_health(id) + 50)
cs_set_user_money(id, Money)
}
}
}
case 2: {
if(get_user_armor(id) >= 250)
client_print(id, print_center, "You already have 250 AP!")
else {
new Money = cs_get_user_money(id) - 500
if(Money < 0)
client_print(id, print_center, "You have insufficient founds!")
else {
if(get_user_armor(id) + 50 > 250)
fm_set_user_armor(id, 250)
else
fm_set_user_armor(id, get_user_armor(id) + 50)
cs_set_user_money(id, Money)
}
}
}
case 4: {
if(user_has_weapon(id, CSW_HEGRENADE))
client_print(id, print_center, "You already have HE GRENADE!")
else {
new Money = cs_get_user_money(id) - 4000
if(Money < 0)
client_print(id, print_center, "You have insufficient founds!")
else {
fm_give_item(id, "weapon_hegrenade")
cs_set_user_money(id, Money)
}
}
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}

public CmdAntiFurienHandler(id, menu, item) {
if(item == MENU_EXIT || !is_user_alive(id) || get_user_team(id) != 2) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new Data[6], Name[64];
new Access, CallBack;
menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
new Key = str_to_num(Data);
switch(Key) {
case 1: {
if(cs_get_user_defuse(id))
client_print(id, print_center, "You already have Defuse KIT!")
else {
new Money = cs_get_user_money(id) - 500
if(Money < 0)
client_print(id, print_center, "You have insufficient founds!")
else {
cs_set_user_defuse(id, 1)
cs_set_user_money(id, Money)
}
}
}
case 3: {
if(get_user_health(id) >= 250)
client_print(id, print_center, "You already have 250 HP!")
else {
new Money = cs_get_user_money(id) - 3000
if(Money < 0)
client_print(id, print_center, "You have insufficient founds!")
else {
if(get_user_health(id) + 50 > 250)
fm_set_user_health(id, 250)
else
fm_set_user_health(id, get_user_health(id) + 50)
cs_set_user_money(id, Money)
}
}
}
case 2: {
if(get_user_armor(id) >= 250)
client_print(id, print_center, "You already have 250 AP!")
else {
new Money = cs_get_user_money(id) - 500
if(Money < 0)
client_print(id, print_center, "You have insufficient founds!")
else {
if(get_user_armor(id) + 50 > 250)
fm_set_user_armor(id, 250)
else
fm_set_user_armor(id, get_user_armor(id) + 50)
cs_set_user_money(id, Money)
}
}
}
case 4: {
if(user_has_weapon(id, CSW_HEGRENADE))
client_print(id, print_center, "You already have HE GRENADE!")
else {
new Money = cs_get_user_money(id) - 4000
if(Money < 0)
client_print(id, print_center, "You have insufficient founds!")
else {
fm_give_item(id, "weapon_hegrenade")
cs_set_user_money(id, Money)
}
}
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}

//============================================= ============================//
//=======================[Weapons Settings]===============================//
//============================================= ==========================//

public Equipment(id) {
if(is_user_alive(id) && get_user_team(id) == 2) {
Menu = menu_create("\rWeapons Menu", "EquipmentCmd");
menu_additem(Menu, "\wNew Weapons", "1", 0);
if(PrimaryWeapon[id] && SecondaryWeapon[id])
menu_additem(Menu, "\wPrevious Setup", "2", 0);
else
menu_additem(Menu, "\dPrevious Setup", "2", 0);
menu_setprop(Menu, MPROP_EXIT, MEXIT_NEVER)
menu_display(id, Menu, 0);
}
}

public EquipmentCmd(id, menu, item) {
if(item == MENU_EXIT || !is_user_alive(id) || get_user_team(id) != 2) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new Data[6], Name[64];
new Access, CallBack;
menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
new Key = str_to_num(Data);
switch(Key) {
case 1: {
if(!HavePrimaryWeapon[id])
Primary(id)
else if(!HaveSecondaryWeapon[id])
Secondary(id)
}
case 2: {
if(PrimaryWeapon[id] && SecondaryWeapon[id])
GiveLastWeapons(id)
else Equipment(id)
}
default: return PLUGIN_HANDLED;
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}

public Primary(id) {
if(is_user_alive(id) && get_user_team(id) == TEAM_ANTIFURIEN) {
Menu = menu_create("\yAnti-Furien Weapons^n\rPrimary:", "CmdWeaponsHandler")

menu_additem(Menu, "M4A1", "1", 0)
menu_additem(Menu, "AK47", "2", 0)
menu_additem(Menu, "M3", "3", 0)
menu_additem(Menu, "Aug", "4", 0)
menu_additem(Menu, "Famas", "5", 0)
menu_additem(Menu, "MP5 Navy", "6", 0)
menu_additem(Menu, "XM1014", "7", 0)

menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, Menu, 0);
}
}

public CmdWeaponsHandler(id, menu, item) {
if(item == MENU_EXIT || !is_user_alive(id) || get_user_team(id) != 2) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new Data[6], Name[64];
new Access, CallBack;
menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
new Key = str_to_num(Data);
switch(Key) {
case 1: {
fm_give_item(id, "weapon_m4a1")
cs_set_user_bpammo(id, CSW_M4A1, 254)
PrimaryWeapon[id] = M4A1_KEY
HavePrimaryWeapon[id] = true;
Secondary(id)
}
case 2: {
fm_give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 254)
PrimaryWeapon[id] = AK47_KEY
HavePrimaryWeapon[id] = true;
Secondary(id)
}
case 3: {
fm_give_item(id, "weapon_m3")
cs_set_user_bpammo(id, CSW_M3, 254)
PrimaryWeapon[id] = M3_KEY
HavePrimaryWeapon[id] = true;
Secondary(id)
}
case 4: {
fm_give_item(id, "weapon_aug")
cs_set_user_bpammo(id, CSW_AUG, 254)
PrimaryWeapon[id] = AUG_KEY
HavePrimaryWeapon[id] = true;
Secondary(id)
}
case 5: {
fm_give_item(id, "weapon_famas")
cs_set_user_bpammo(id, CSW_FAMAS, 254)
PrimaryWeapon[id] = FAMAS_KEY
HavePrimaryWeapon[id] = true;
Secondary(id)
}
case 6: {
fm_give_item(id, "weapon_mp5navy")
cs_set_user_bpammo(id, CSW_MP5NAVY, 254)
PrimaryWeapon[id] = MP5_KEY
HavePrimaryWeapon[id] = true;
Secondary(id)
}
case 7: {
fm_give_item(id, "weapon_xm1014")
cs_set_user_bpammo(id, CSW_XM1014, 254)
PrimaryWeapon[id] = XM1014_KEY
HavePrimaryWeapon[id] = true;
Secondary(id)
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}

public Secondary(id) {
if(is_user_alive(id) && get_user_team(id) == TEAM_ANTIFURIEN) {
Menu = menu_create("\yAnti-Furien Weapons^n\rSecondary:", "CmdSecondaryHandler")

menu_additem(Menu, "USP", "1", 0)
menu_additem(Menu, "Deagle", "2", 0)
menu_additem(Menu, "Elite", "3", 0)
menu_additem(Menu, "Five Seven", "4", 0)

menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, Menu, 0);
}
}

public CmdSecondaryHandler(id, menu, item) {
if(item == MENU_EXIT || !is_user_alive(id) || get_user_team(id) != 2) {
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new Data[6], Name[64];
new Access, CallBack;
menu_item_getinfo(menu, item, Access, Data,5, Name, 63, CallBack);
new Key = str_to_num(Data);
switch(Key) {
case 1: {
fm_give_item(id, "weapon_usp")
cs_set_user_bpammo(id, CSW_USP, 256)
SecondaryWeapon[id] = USP_KEY
HaveSecondaryWeapon[id] = true;
}
case 2: {
fm_give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 256)
SecondaryWeapon[id] = DEAGLE_KEY
HaveSecondaryWeapon[id] = true;
}
case 3: {
fm_give_item(id, "weapon_elite")
cs_set_user_bpammo(id, CSW_ELITE, 256)
SecondaryWeapon[id] = ELITE_KEY
HaveSecondaryWeapon[id] = true;
}
case 4: {
fm_give_item(id, "weapon_fiveseven")
cs_set_user_bpammo(id, CSW_FIVESEVEN, 256)
SecondaryWeapon[id] = FIVESEVEN_KEY
HaveSecondaryWeapon[id] = true;
}
}
menu_destroy(menu)
return PLUGIN_HANDLED
}

public GiveLastWeapons(id) {
if(!HavePrimaryWeapon[id]) {
switch(PrimaryWeapon[id]) {
case M4A1_KEY: {
fm_give_item(id, "weapon_m4a1")
cs_set_user_bpammo(id, CSW_M4A1, 256)
HavePrimaryWeapon[id] = true;
}
case AK47_KEY: {
fm_give_item(id, "weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 256)
HavePrimaryWeapon[id] = true;
}
case M3_KEY: {
fm_give_item(id, "weapon_m3")
cs_set_user_bpammo(id, CSW_M3, 256)
HavePrimaryWeapon[id] = true;
}
case AUG_KEY: {
fm_give_item(id, "weapon_aug")
cs_set_user_bpammo(id, CSW_AUG, 256)
HavePrimaryWeapon[id] = true;
}
case FAMAS_KEY: {
fm_give_item(id, "weapon_famas")
cs_set_user_bpammo(id, CSW_FAMAS, 256)
HavePrimaryWeapon[id] = true;
}
case MP5_KEY: {
fm_give_item(id, "weapon_mp5navy")
cs_set_user_bpammo(id, CSW_MP5NAVY, 256)
HavePrimaryWeapon[id] = true;
}
case XM1014_KEY: {
fm_give_item(id, "weapon_xm1014")
cs_set_user_bpammo(id, CSW_XM1014, 256)
HavePrimaryWeapon[id] = true;
}
}
}
if(!HaveSecondaryWeapon[id]) {
switch(SecondaryWeapon[id]) {
case USP_KEY: {
fm_give_item(id, "weapon_usp")
cs_set_user_bpammo(id, CSW_USP, 256)
HaveSecondaryWeapon[id] = true;
}
case DEAGLE_KEY: {
fm_give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 256)
HaveSecondaryWeapon[id] = true;
}
case ELITE_KEY: {
fm_give_item(id, "weapon_elite")
cs_set_user_bpammo(id, CSW_ELITE, 256)
HaveSecondaryWeapon[id] = true;
}
case FIVESEVEN_KEY: {
fm_give_item(id, "weapon_fiveseven")
cs_set_user_bpammo(id, CSW_FIVESEVEN, 256)
HaveSecondaryWeapon[id] = true;
}
}
}
}
public CMD_BlockJoinTeam(id) {
console_print(id, "*** Nu ai voie sa foloseti JoinTeam ! ***")
return 1;
}

public CMD_BlockChooseTeam(id) {
console_print(id, "*** Nu ai voie sa foloseti ChooseTeam ! ***")
return 1;
}

public CmdShowMotd(id)
show_motd(id, "addons/amxmodx/configs/beneficii.html")

/////////////////////////////////////////////////////////////////////////

public EVENT_CurWeapon(id) {
if(is_user_connected(id)) {
if(get_user_weapon(id) == CSW_KNIFE) {
if(HaveSuperKnife[id])
set_pev(id, pev_viewmodel2, SuperKnifeModel_V)
}
new PlayerHealth;
PlayerHealth = get_user_health(id)
if(PlayerHealth == 256)
fm_set_user_health(id, 255)
}

}

public EVENT_Death()
{
static Attacker, Victim;
Attacker = read_data(1)
Victim = read_data(2)
HaveSuperKnife[Victim] = false;

if(Victim == Attacker)
return 1;

if(is_user_connected(Attacker))
{
if(get_user_flags(Attacker) & FOUNDER_LEVEL)
{
cs_set_user_money(Attacker, cs_get_user_money(Attacker) + 7000)
fm_set_user_health(Attacker, get_user_health(Attacker) + 70)
fm_set_user_armor(Attacker, get_user_armor(Attacker) + 70)
}
else if(get_user_flags(Attacker) & VIP_SILVER_LEVEL)
{
cs_set_user_money(Attacker, cs_get_user_money(Attacker) + 2000)
fm_set_user_health(Attacker, get_user_health(Attacker) + 20)
fm_set_user_armor(Attacker, get_user_armor(Attacker) + 20)
}
else if(get_user_flags(Attacker) & VIP_BRONZE_LEVEL)
{
cs_set_user_money(Attacker, cs_get_user_money(Attacker) + 1500)
fm_set_user_health(Attacker, get_user_health(Attacker) + 15)
fm_set_user_armor(Attacker, get_user_armor(Attacker) + 15)
}
else if(get_user_flags(Attacker) & VIP_DIAMOND_LEVEL)
{
cs_set_user_money(Attacker, cs_get_user_money(Attacker) + 5000)
fm_set_user_health(Attacker, get_user_health(Attacker) + 50)
fm_set_user_armor(Attacker, get_user_armor(Attacker) + 50)
}
else if(get_user_flags(Attacker) & VIP_PLATINUM_LEVEL)
{
cs_set_user_money(Attacker, cs_get_user_money(Attacker) + 4000)
fm_set_user_health(Attacker, get_user_health(Attacker) + 40)
fm_set_user_armor(Attacker, get_user_armor(Attacker) + 40)
}
else if(get_user_flags(Attacker) & VIP_GOLD_LEVEL)
{
cs_set_user_money(Attacker, cs_get_user_money(Attacker) + 3000)
fm_set_user_health(Attacker, get_user_health(Attacker) + 30)
fm_set_user_armor(Attacker, get_user_armor(Attacker) + 30)
}
else
{
if(get_user_team(Victim) == 2)
cs_set_user_money(Attacker, cs_get_user_money(Attacker) + 1000)
else if(get_user_team(Victim) == 1)
cs_set_user_money(Attacker, cs_get_user_money(Attacker) + 1000)
}
}
return 1;
}

public MSG_StatusIcon(msg_id, msg_dest, id) {
static Attrib
Attrib = get_msg_arg_int(2)

if(Attrib == (1<<1))
set_msg_arg_int(2, ARG_BYTE, 0)

new Icon[8];
get_msg_arg_string(2, Icon, 7);
if(get_pcvar_num(removebuyzone)) {
static const BuyZone[] = "buyzone";

if(equal(Icon, BuyZone)) {
set_pdata_int(id, OFFSET_BZ, get_pdata_int(id, OFFSET_BZ, 5) & ~(1 << 0), 5);

return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}

public MSG_TextMessage() {
static TextMsg[22];
get_msg_arg_string(2, TextMsg, charsmax(TextMsg))
if(equal(TextMsg, "#Terrorists_Win")) {
client_print(0, print_center, "The Furiens have won this round!")
return PLUGIN_HANDLED;
}
else if(equal(TextMsg, "#CTs_Win")) {
client_print(0, print_center, "The Anti-Furiens have won this round!")
return PLUGIN_HANDLED;
}
else if(equal(TextMsg, "#Bomb_Defused")) {
client_print(0, print_center, "The Anti-Furiens have won this round!")
return PLUGIN_HANDLED;
}
else if(equal(TextMsg, "#Target_Bombed")) {
client_print(0, print_center, "The Furiens have won this round!")
return PLUGIN_HANDLED;
}
else if(equal(TextMsg, "#Target_Saved")) {
client_print(0, print_center, "The Anti-Furiens have won this round!")
return PLUGIN_HANDLED;
}
else if(equal(TextMsg, "#Fire_in_the_hole"))
return PLUGIN_HANDLED
else if(equal(TextMsg, "#C4_Plant_At_Bomb_Spot")) {
if(!CanPlant)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE;
}

public MSG_ShowMenu(msgid, dest, id) {
if(!Should_AutoJoin(id))
return PLUGIN_CONTINUE

static team_select[] = "#Team_Select"
static menu_text_code[sizeof team_select]
get_msg_arg_string(4, menu_text_code, sizeof menu_text_code - 1)
if(!equal(menu_text_code, team_select))
return PLUGIN_CONTINUE

JoinTeam_Task(id, msgid)

return PLUGIN_HANDLED
}

public MSG_VGUIMenu(msgid, dest, id) {
if(get_msg_arg_int(1) != 2 || !Should_AutoJoin(id))
return PLUGIN_CONTINUE

JoinTeam_Task(id, msgid)

return PLUGIN_HANDLED
}

public MSG_SendAudio() {
static Sound[17]
get_msg_arg_string(2, Sound, sizeof Sound - 1)

if(equal(Sound, "terwin") || equal(Sound, "ctwin") || equal(Sound, "rounddraw") || equal(Sound, "bombpl") || equal(Sound, "bombdef"))
return PLUGIN_HANDLED;

return PLUGIN_CONTINUE;
}

public MSG_Health(msgid, dest, id) {
static Health;
Health = get_msg_arg_int(1)
if(Health > 255)
set_msg_arg_int(1, ARG_BYTE, 255);
else if(Health == 256)
set_msg_arg_int(1, ARG_BYTE, get_user_health(id) + 10)
}

public MSG_ScreenFade(msgid, dest, id) {
if(is_user_connected(id)) {
if(get_user_flags(id) & VIP_GOLD_LEVEL) {
static data[4]
data[0] = get_msg_arg_int(4)
data[1] = get_msg_arg_int(5)
data[2] = get_msg_arg_int(6)
data[3] = get_msg_arg_int(7)

if(data[0] == 255 && data[1] == 255 && data[2] == 255 && data[3] > 199)
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}

bool:Should_AutoJoin(id) {
return(get_pcvar_num(cvar_autojoin_team) && !get_user_team(id) && !task_exists(id))
}

JoinTeam_Task(id, menu_msgid) {
static param_menu_msgid[2]
param_menu_msgid[0] = menu_msgid

set_task(0.1, "Force_JoinTeam", id, param_menu_msgid, sizeof param_menu_msgid)
}

public Force_JoinTeam(menu_msgid[], id) {
if(get_user_team(id))
return

static team[2], class[2]
get_pcvar_string(cvar_autojoin_team, team, sizeof team - 1)
get_pcvar_string(cvar_autojoin_class, class, sizeof class - 1)
Force_Team_Join(id, menu_msgid[0], team, class)
}

stock Force_Team_Join(id, menu_msgid, team[] = "5", class[] = "0") {
static jointeam[] = "jointeam"
if(class[0] == '0') {
engclient_cmd(id, jointeam, team)
return
}

static msg_block, joinclass[] = "joinclass"
msg_block = get_msg_block(menu_msgid)
set_msg_block(menu_msgid, BLOCK_SET)
engclient_cmd(id, jointeam, team)
engclient_cmd(id, joinclass, class)
set_msg_block(menu_msgid, msg_block)
}

public bomb_planted(planter) {
C4_CountDownDelay = get_cvar_num("mp_c4timer") - 1
TASK_C4_CountDown();
set_hudmessage(random(255), random(255), random(255), -1.0, -1.0, 1, 3.1, 3.0)
show_hudmessage(0, "[FURIEN] Furienii au plantat bomba!")
}

public EVENT_SwitchTeam() {
new Players[32], PlayersNum, id;
get_players(Players, PlayersNum)
if(PlayersNum) {
for(new i; i < PlayersNum; i++)
{
id = Players[i]
BeginDelay(id)
}
}
}

public BeginDelay(id) {
if(is_user_connected(id)) {
switch(id) {
case 1..7: set_task(0.1, "BeginTeamSwap", id)
case 8..15: set_task(0.2, "BeginTeamSwap", id)
case 16..23: set_task(0.3, "BeginTeamSwap", id)
case 24..32: set_task(0.4, "BeginTeamSwap", id)
}
}
}

public BeginTeamSwap(id) {
if(is_user_connected(id)) {
switch(get_user_team(id)) {
case TEAM_FURIEN: cs_set_user_team(id, CS_TEAM_CT)
case TEAM_ANTIFURIEN: cs_set_user_team(id, CS_TEAM_T)
}
}
}

///////////////////////////////////////////////////////////////////////////////////////////////

public Player_PreThink(id) {
if(is_user_connected(id)) {
if(get_user_team(id) == TEAM_FURIEN) {
if(pev(id, pev_gravity) > FURIEN_GRAVITY && pev(id, pev_gravity) > 0.1)
set_pev(id, pev_gravity, FURIEN_GRAVITY)

if(pev(id, pev_maxspeed) < FURIEN_SPEED && pev(id, pev_maxspeed) > 1.0) {
set_pev(id, pev_maxspeed, FURIEN_SPEED)
set_user_footsteps(id, 1)
}
}
if(get_pcvar_num(cvar_aim_info)) {
new Target, Body;
get_user_aiming(id, Target, Body);
if(is_user_alive(id) && is_user_connected(Target) && is_user_alive(Target)) {
new TargetTeam, PlayerTeam, TargetName[32], Message[128], TargetHealth, TargetArmor, RED, GREEN, BLUE;
TargetTeam = get_user_team(Target)
PlayerTeam = get_user_team(id)
get_user_name(Target, TargetName, 31)
TargetHealth = get_user_health(Target)
TargetArmor = get_user_armor(Target)
if(PlayerTeam == TEAM_FURIEN && TargetTeam == TEAM_ANTIFURIEN) {
formatex(Message, sizeof(Message)-1, "%s^nHP: %i | AP: %i", TargetName, TargetHealth, TargetArmor)
RED = 20
GREEN = 200
BLUE = 50
}
else if(PlayerTeam == TEAM_FURIEN && TargetTeam == TEAM_FURIEN) {
formatex(Message, sizeof(Message)-1, "%s^nHP: %i | AP: %i", TargetName, TargetHealth, TargetArmor)
RED = 200
GREEN = 20
BLUE = 20
}
else if(PlayerTeam == TEAM_ANTIFURIEN && TargetTeam == TEAM_ANTIFURIEN) {
formatex(Message, sizeof(Message)-1, "%s^nHP: %i | AP: %i", TargetName, TargetHealth, TargetArmor)
RED = 200
GREEN = 20
BLUE = 20
}
else if(PlayerTeam == TEAM_ANTIFURIEN && TargetTeam == TEAM_FURIEN)
return
set_hudmessage(RED, GREEN, BLUE, -1.0, -1.0, 0, 0.0, 0.1, 0.0, 0.0, -1);
show_hudmessage(id, "%s", Message)
}
}
}
}

public FWD_AddToFullPack(es, e, ent, host, host_flags, player, p_set) {
if(is_user_connected(ent) && is_user_connected(host) && is_user_alive(ent)) {
if(is_user_alive(host) && get_user_team(ent) == 1 && get_user_team(host) == 1
|| !is_user_alive(host) && get_user_team(ent) == 1 && pev(host, pev_iuser2) == ent
|| get_user_team(ent) == 1 && pev(ent, pev_maxspeed) <= 1.0) {
set_es(es, ES_RenderFx, kRenderFxNone);
set_es(es, ES_RenderMode, kRenderTransTexture);
set_es(es, ES_RenderAmt, 255);
}
else if(get_user_team(ent) == 1) {
set_es(es, ES_RenderFx, kRenderFxNone);
set_es(es, ES_RenderMode, kRenderTransTexture);
static Float:Origin[3]
pev(ent, pev_origin, Origin)

if(get_user_weapon(ent) == CSW_KNIFE && !MakeVisible[ent] && fm_get_speed(ent) <= 5 || get_user_weapon(ent) == CSW_KNIFE && !MakeVisible[ent] && Origin[0] == Wallorigin[ent][0] && Origin[1] == Wallorigin[ent][1] && Origin[2] == Wallorigin[ent][2])
set_es(es, ES_RenderAmt, 0);
else
set_es(es, ES_RenderAmt, 255);
}
}
}

public FWD_ParachutePreThink(id) {
if(is_user_alive(id) && get_user_team(id) == TEAM_ANTIFURIEN) {
new Float:FallSpeed = -50.0;
new Float:Frame;

new Button = pev(id, pev_button);
new OldButton = pev(id, pev_oldbuttons);
new Flags = pev(id, pev_flags);

if(ParaENT[id] > 0 &&(Flags & FL_ONGROUND)) {

if(pev(ParaENT[id],pev_sequence) != 2) {
set_pev(ParaENT[id], pev_sequence, 2);
set_pev(ParaENT[id], pev_gaitsequence, 1);
set_pev(ParaENT[id], pev_frame, 0.0);
set_pev(ParaENT[id], pev_fuser1, 0.0);
set_pev(ParaENT[id], pev_animtime, 0.0);
return;
}

pev(ParaENT[id],pev_fuser1, Frame);
Frame += 2.0;
set_pev(ParaENT[id],pev_fuser1,Frame);
set_pev(ParaENT[id],pev_frame,Frame);

if(Frame > 254.0) {
engfunc(EngFunc_RemoveEntity, ParaENT[id]);
ParaENT[id] = 0;
}
else {
engfunc(EngFunc_RemoveEntity, ParaENT[id]);
ParaENT[id] = 0;
}
return;
}

if(Button & IN_USE) {
new Float:Velocity[3];
pev(id, pev_velocity, Velocity);

if(Velocity[2] < 0.0) {
if(ParaENT[id] <= 0) {
ParaENT[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));

if(ParaENT[id] > 0) {
set_pev(ParaENT[id],pev_classname, PARACHUTE_CLASS);
set_pev(ParaENT[id], pev_aiment, id);
set_pev(ParaENT[id], pev_owner, id);
set_pev(ParaENT[id], pev_movetype, MOVETYPE_FLY);
set_pev(ParaENT[id], pev_sequence, 0);
set_pev(ParaENT[id], pev_gaitsequence, 1);
set_pev(ParaENT[id], pev_frame, 0.0);
set_pev(ParaENT[id], pev_fuser1, 0.0);
}
}
if(ParaENT[id] > 0) {
set_pev(id, pev_sequence, 3);
set_pev(id, pev_gaitsequence, 1);
set_pev(id, pev_frame, 1.0);
set_pev(id, pev_framerate, 1.0);

Velocity[2] = (Velocity[2] + 40.0 < FallSpeed) ? Velocity[2] + 40.0 : FallSpeed;
set_pev(id, pev_velocity, Velocity);

if(pev(ParaENT[id],pev_sequence) == 0) {
pev(ParaENT[id],pev_fuser1, Frame);
Frame += 1.0;
set_pev(ParaENT[id],pev_fuser1,Frame);
set_pev(ParaENT[id],pev_frame,Frame);

if(Frame > 100.0) {
set_pev(ParaENT[id], pev_animtime, 0.0);
set_pev(ParaENT[id], pev_framerate, 0.4);
set_pev(ParaENT[id], pev_sequence, 1);
set_pev(ParaENT[id], pev_gaitsequence, 1);
set_pev(ParaENT[id], pev_frame, 0.0);
set_pev(ParaENT[id], pev_fuser1, 0.0);
}
}
}
}

else if(ParaENT[id] > 0) {
engfunc(EngFunc_RemoveEntity, ParaENT[id]);
ParaENT[id] = 0;
}
}

else if((OldButton & IN_USE) && ParaENT[id] > 0) {
engfunc(EngFunc_RemoveEntity, ParaENT[id]);
ParaENT[id] = 0;
}
}
}

public TASK_CanPlant()
{
CanPlant = true;

set_hudmessage( 255, 0, 0, -1.0, 0.35, 1, 0.01, 3.0, 1.0, 1.0 );

new iNum, iPlayers[ 32 ];
get_players( iPlayers, iNum, "ae", "TERRORIST" );

for( new i ; i < iNum ; i ++ )
show_hudmessage( iPlayers[ i ], "");
}

public TASK_C4_CountDown() {
new Red, Green, Blue
if(C4_CountDownDelay > 10)
Red = 0, Green = 255, Blue = 0;
else if(C4_CountDownDelay > 5)
Red = 255, Green = 200, Blue = 0;
else if(C4_CountDownDelay <= 5)
Red = 255, Green = 0, Blue = 0;

if(C4_CountDownDelay) {
new Message[256];
formatex(Message,sizeof(Message)-1,"----------^n| C4: %d |^n----------", C4_CountDownDelay);

set_hudmessage(Red, Green, Blue, -1.0, 0.78, 0, 6.0, 1.0)
show_hudmessage(0, "%s", Message)
set_task(1.0, "TASK_C4_CountDown", TASKID_C4COUNTDOWN);
C4_CountDownDelay--;
}
else if(!C4_CountDownDelay)
C4_CountDownDelay = 0;
}

stock ColorChat(const id, const input[], any:...) {
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);

replace_all(msg, 190, "!g", "^4");
replace_all(msg, 190, "!y", "^1");
replace_all(msg, 190, "!t", "^3");

if(id) players[0] = id;
else get_players(players, count, "ch"); {
for(new i = 0; i < count; i++) {
if(is_user_connected(players[i])) {
message_begin(MSG_ONE_UNRELIABLE, MSGID_SayText, _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}

Last edited by sssss1; 01-15-2022 at 07:28.
sssss1 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-15-2022 , 07:15   Re: help, plugin furien
Reply With Quote #2

Put the code in [code] or [php] tags.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
sssss1
Junior Member
Join Date: Jan 2022
Old 01-15-2022 , 07:30   Re: help, plugin furien
Reply With Quote #3

I changed it
So can anyone help me? I removed a code from the base and now I take dmg, but sometimes too small and sometimes too big, I tried with he controll damage but it doesn't work
sssss1 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-15-2022 , 07:42   Re: help, plugin furien
Reply With Quote #4

The point of putting it in tags was to make the code readable. You broke the indentation by posting it without the tags first.

This piece of the code prevents HE grenade damage for VIP players for whatever reason:

Code:
if(get_user_flags(Victim) & VIP_GOLD_LEVEL) {     if(DamageType & DMG_HEGRENADE)     return HAM_SUPERCEDE }

Furthermore, the entire code for modifying knife damage is wrong. It checks whether the player is holding a knife and changing the damage then. Of course when you throw the grenade you no longer have it in your hands and you're holding a knife, so the damage buff is applied to the grenade instead.

The entire SuperKnife_TakeDamage() function needs to look like this:

Code:
public SuperKnife_TakeDamage(Victim, Inflictor, Attacker, Floatamage, DamageType) {     if(is_user_connected(Attacker) && HaveSuperKnife[Attacker] && get_user_weapon(Attacker) == CSW_KNIFE && Attacker == Inflictor)     {         SetHamParamFloat(4, Damage * get_pcvar_float(superknife_damage_multiplier))     } }
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
sssss1
Junior Member
Join Date: Jan 2022
Old 01-15-2022 , 08:00   Re: help, plugin furien
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
The point of putting it in tags was to make the code readable. You broke the indentation by posting it without the tags first.

This piece of the code prevents HE grenade damage for VIP players for whatever reason:

Code:
if(get_user_flags(Victim) & VIP_GOLD_LEVEL) {     if(DamageType & DMG_HEGRENADE)     return HAM_SUPERCEDE }

Furthermore, the entire code for modifying knife damage is wrong. It checks whether the player is holding a knife and changing the damage then. Of course when you throw the grenade you no longer have it in your hands and you're holding a knife, so the damage buff is applied to the grenade instead.

The entire SuperKnife_TakeDamage() function needs to look like this:

Code:
public SuperKnife_TakeDamage(Victim, Inflictor, Attacker, Floatamage, DamageType) {     if(is_user_connected(Attacker) && HaveSuperKnife[Attacker] && get_user_weapon(Attacker) == CSW_KNIFE && Attacker == Inflictor)     {         SetHamParamFloat(4, Damage * get_pcvar_float(superknife_damage_multiplier))     } }
after add your code
Code:
9680cc46cb53f8c6dd9dcb3ef31933c9.sma(223) : error 017: undefined symbol "Damage"
9680cc46cb53f8c6dd9dcb3ef31933c9.sma(223) : error 001: expected token: ";", but found ")"
9680cc46cb53f8c6dd9dcb3ef31933c9.sma(223) : error 029: invalid expression, assumed zero
9680cc46cb53f8c6dd9dcb3ef31933c9.sma(223) : fatal error 107: too many error messages on one line

Last edited by sssss1; 01-15-2022 at 08:03.
sssss1 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-15-2022 , 09:25   Re: help, plugin furien
Reply With Quote #6

That's because of something you did to the code you posted.

"Floatamage" should be "Float:damage"
__________________

Last edited by OciXCrom; 01-15-2022 at 09:25.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
sssss1
Junior Member
Join Date: Jan 2022
Old 01-15-2022 , 11:01   Re: help, plugin furien
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
That's because of something you did to the code you posted.

"Floatamage" should be "Float:damage"
it worked, thank you very much
sssss1 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:42.


Powered by vBulletin®
Copyright ©2000 - 2022, vBulletin Solutions, Inc.
Theme made by Freecode