It is currently 15 Nov 2018 15:35



Forum rules


Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .



Reply to topic  [ 3 posts ] 
 Cerere plugin Happy Hours ZM 
Author Message
Membru, skill 0
Membru, skill 0

Joined: 27 Oct 2018 13:29
Posts: 22
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Salut!
As dori un plugin de Happy Hours Event , sa-l pornesc eu cand vreau, printr-o comanda spre ex " amx_happy on" amx_happy off, dar sa porneasca si la orele setate.
Multumesc!
Voi lasa aici link-ul catre sursa pluginului .
Quote:
https://forums.alliedmods.net/showthread.php?t=118036


01 Nov 2018 14:00
Profile multumesc WWW
Membru, skill +3
Membru, skill +3
User avatar

Joined: 24 Aug 2011 12:24
Posts: 1386
Location: |<()|)
Detinator Steam: Da
CS Status: HLDS Builder
Detinator server CS: liber de contract
SteamID: riseofevo
Fond eXtream: 0
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <zombieplague>

new bool:g_happyhour
new cvar_init,cvar_end,cvar_on,cvar_multi,g_packs[33],message[80]

// Uncomment this line if you use the zombie plague 4.2 or an older
//#define ZP_42_OR_OLDER

public plugin_init()
{
register_plugin("Happy hour", "1.0", "capostrike")

cvar_init = register_cvar("zp_happyinit", "2")
cvar_end = register_cvar("zp_happyend", "7")
cvar_on = register_cvar("zp_happyhour", "1")
cvar_multi = register_cvar("zp_happymultipler", "2")

RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage_post",1)
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled_post", 1)
RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_post",1)

register_clcmd("amx_happy","ClcmdHAPP",ADMIN_CVAR,"Folosire: amx_happy on/off - pornire/oprire event VIP")
}

public ClcmdHAPP(id,level,cid)
{
if(!cmd_access(id,level,cid,1)) return console_print(id,"[AMXX]: Nu ai acces!")

if(!get_pcvar_num(cvar_on)) return console_print(id,"[AMXX]: Functie dezactivata!")

new arg1[32]
read_argv(1,arg1,charsmax(arg1))

if(equali(arg1,"")||str_to_num(arg1)) return console_print(id,"[AMXX]: Folosire corecta > amx_happy ON/OFF")

if(equali(arg1,"on"))
{
if(!g_happyhour) g_happyhour=true
return console_print(id,"[AMXX]: Eventul VIP a fost pornit cu succes.")
}

if(equali(arg1,"off"))
{
if(g_happyhour) g_happyhour=false
return console_print(id,"[AMXX]: Eventul VIP a fost oprit cu succes.")
}

return PLUGIN_HANDLED
}

public plugin_cfg()
{
if(get_pcvar_num(cvar_on))
{
new data[3]
get_time("%H", data, 2)

if(get_pcvar_num(cvar_end) > str_to_num(data) >= get_pcvar_num(cvar_init))
{
g_happyhour = true
formatex(message, charsmax(message), "[Happy Hour]!! Init: %d - End: %d", get_pcvar_num(cvar_init), get_pcvar_num(cvar_end))
}
}
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
if(!g_happyhour) return HAM_IGNORED;
if(victim == attacker || !is_user_alive(attacker)) return HAM_IGNORED;
#if !defined ZP_42_OR_OLDER
if(!zp_get_user_zombie(victim) || zp_get_user_zombie(attacker)) return HAM_IGNORED;
#endif

g_packs[attacker] = zp_get_user_ammo_packs(attacker)

return HAM_IGNORED;
}
public fw_TakeDamage_post(victim, inflictor, attacker, Float:damage, damage_type)
{
if(!g_happyhour) return HAM_IGNORED;
if(victim == attacker || !is_user_alive(attacker)) return HAM_IGNORED;
#if !defined ZP_42_OR_OLDER
if(!zp_get_user_zombie(victim) || zp_get_user_zombie(attacker)) return HAM_IGNORED;
#endif
if(!g_packs[attacker]) return HAM_IGNORED;

new diff = (zp_get_user_ammo_packs(attacker) - g_packs[attacker]);

if(diff)
{
diff *= get_pcvar_num(cvar_multi);
zp_set_user_ammo_packs(attacker, g_packs[attacker]+diff)
g_packs[attacker] = 0;
}

return HAM_IGNORED;
}
public fw_PlayerKilled(victim, attacker, shouldgib)
{
if(!g_happyhour) return HAM_IGNORED;
if(victim == attacker || !is_user_alive(attacker)) return HAM_IGNORED;

g_packs[attacker] = zp_get_user_ammo_packs(attacker)

return HAM_IGNORED;
}
public fw_PlayerKilled_post(victim, attacker, shouldgib)
{
if(!g_happyhour) return HAM_IGNORED;
if(victim == attacker || !is_user_alive(attacker)) return HAM_IGNORED;
if(!g_packs[attacker]) return HAM_IGNORED;

new diff = (zp_get_user_ammo_packs(attacker) - g_packs[attacker]);

if(diff)
{
diff *= get_pcvar_num(cvar_multi);
zp_set_user_ammo_packs(attacker, g_packs[attacker]+diff)
g_packs[attacker] = 0;
}

return HAM_IGNORED;
}
#if !defined ZP_42_OR_OLDER
public zp_user_infected_pre(victim,attacker)
{
if(!g_happyhour) return HAM_IGNORED;
if(victim == attacker || !is_user_alive(attacker)) return HAM_IGNORED;

g_packs[attacker] = zp_get_user_ammo_packs(attacker)

return HAM_IGNORED;
}
public zp_user_infected_post(victim,attacker)
{
if(!g_happyhour) return HAM_IGNORED;
if(victim == attacker || !is_user_alive(attacker)) return HAM_IGNORED;
if(!g_packs[attacker]) return HAM_IGNORED;

new diff = (zp_get_user_ammo_packs(attacker) - g_packs[attacker]);

if(diff)
{
diff *= get_pcvar_num(cvar_multi);
zp_set_user_ammo_packs(attacker, g_packs[attacker]+diff)
g_packs[attacker] = 0;
}

return HAM_IGNORED;
}
#endif
public fw_PlayerSpawn_post(id)
{
if(message[0]) client_print(id,print_chat, message)
}

_________________
Stick with the best & regards Adryyy .


x , daNzeT , Arion , Chaos , Exolent , aNNakin , PoSiTiOn Of PoWeR , ExoTiQ , -UnQ- UHD , ViciousVixen , Arkshine , Askhanar , KronoS eXtream , alkaline , CryWolf , Fuffy , tre3fla , Rap^ , Hades Ownage , xPaw .


05 Nov 2018 12:52
Profile multumesc ICQ YIM WWW
Membru, skill 0
Membru, skill 0

Joined: 27 Oct 2018 13:29
Posts: 22
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Multumesc!


06 Nov 2018 00:11
Profile multumesc WWW
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 73 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  

În cazul în care aveți probleme cu contul trimiteți un email sau mesaj la servicii_extream[arond]yahoo[punct]com

Powered by phpBB® Forum Software © phpBB Group