hlmod.hu https://hlmod.hu/ |
|
ZP - Respawn https://hlmod.hu/viewtopic.php?f=31&t=3277 |
Oldal: 1 / 1 |
Szerző: | norbee.16 [2012.02.01. 13:24 ] |
Hozzászólás témája: | ZP - Respawn |
valaki le tudná fordítani??:) előreis THX Kód: #include <amxmodx> |
Szerző: | HuBaBuBa [2012.02.01. 14:13 ] |
Hozzászólás témája: | Re: ZP - Respawn |
Ja és mellékesen a !delayed parancsal 1x tudsz újraéledni, de ingyen! Remélem megfele a fordítás ![]() [spoiler]#include <amxmodx> #include <fakemeta> #include <hamsandwich> #include <zombieplague> #define PLUGIN "[ZP] Extra Item : zSpawn" #define VERSION "1.4.1" #define AUTHOR "Fry!" new g_itemid_zspawn, g_zspawn_cost, g_zspawn_time, g_delayed_zspawn_time, g_zspawn_protection_time new bool:g_canzSpawn[33], bool:g_justConnected[33] new Float:g_gameTime public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_cvar("zp_extra_zSpawn",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY) g_zspawn_cost = register_cvar("zp_zspawn_cost", "15") //Újraéledés ára g_zspawn_time = register_cvar("zp_zspawn_time", "2.0") //Újraéledés ideje g_zspawn_protection_time = register_cvar("zp_zspawn_protection_time", "0") //Újraéledés utánni védelem (ideje) g_delayed_zspawn_time = register_cvar("zp_delay_zspawn_time", "0") //Késön csatlakozó újraéledési ideje(!delayed parancsal) register_clcmd("say /ujra", "buy_respawn") register_clcmd("say /respawn", "buy_respawn") register_clcmd("say !delayed", "cmd_delay") //Csak 1x hasznalhatod ezt a parancsot a szerverre csatlakozastol szamitva ! register_clcmd("say_team !delayed", "cmd_delay") register_event("DeathMsg", "Death", "a") register_logevent("RoundStart", 2, "1=Round_Start") RegisterHam(Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1) } public client_connect(id) { g_canzSpawn[id] = false g_justConnected[id] = true remove_protection(id) client_print(id, print_chat, "[ZP] A szerveren 'Ujraeledes' plugin fut. Ujraeledeshez ird be chatbe /ujra") } public client_disconnect(id) { g_canzSpawn[id] = false remove_protection(id) } public RoundStart() { g_gameTime = get_gametime() } public Death() { new player = read_data( 2 ) if (g_canzSpawn[player]) set_task(get_pcvar_float(g_zspawn_time), "respawn_player", player) } public zp_extra_item_selected(player, itemid) { if (itemid == g_itemid_zspawn) { if (is_user_alive(player)) { g_canzSpawn[player] = false zp_set_user_ammo_packs(player, zp_get_user_ammo_packs(player) + get_pcvar_num(g_zspawn_cost)) client_print(player, print_chat, "[ZP] Csak halott szeme'lyek tudjak megvasarolni az ujraeledes kepesseget!") } } } public buy_respawn(id) { new money = zp_get_user_ammo_packs(id) new cost = get_pcvar_num(g_zspawn_cost) if (is_user_alive(id)) { g_canzSpawn[id] = false client_print(id, print_chat, "[ZP] Csak halott szeme'lyek tudjak megvasarolni az ujraeledes kepesseget!") } else if (g_canzSpawn[id]) { client_print(id, print_center, "*** Mar megvasaroltad az ujraeledest! ***") } else if (money < cost) { client_print(id, print_chat, "[ZP] Nincs eleg 'Loszer Csomagod' a vasarlashoz", cost) } else { zp_set_user_ammo_packs(id, money - cost) g_canzSpawn[id] = true respawn_player(id) client_print(id, print_chat, "[ZP] Ujraeledest vasaroltal!") } return PLUGIN_HANDLED } public cmd_delay(id) { if (is_user_alive(id)) { client_print(id, print_chat, "[ZP] Csak 'halott' es 'kes'o'n csatlakozo' jatekosok tudnak ujraeledni") return PLUGIN_HANDLED } if (g_justConnected[id]) { set_task(get_pcvar_float(g_delayed_zspawn_time), "HasJoined", id) g_justConnected[id] = false client_print(id, print_chat, "[ZP] Ujra fogsz eledni %d masodperc mulva", get_pcvar_num(g_delayed_zspawn_time)) } return PLUGIN_CONTINUE } public HasJoined(id) { new Float:gmtm = get_gametime() if (gmtm - g_gameTime >= get_pcvar_float(g_delayed_zspawn_time) && get_user_team(id) != 3) { respawn_player(id) client_print(id, print_chat, "[ZP] Ujraeledtel a 'keson csatlakozasi' parancsal (!delayed).") } return PLUGIN_CONTINUE } public fw_PlayerSpawn_Post(id) { if (!is_user_alive(id) || !is_user_bot(id)) return HAM_IGNORED if (g_canzSpawn[id] == true) { if (get_pcvar_float(g_zspawn_protection_time) > 0.0) { set_pev(id, pev_effects, pev(id, pev_effects) | EF_NODRAW) set_task(get_pcvar_float(g_zspawn_protection_time), "remove_protection", id) } } return HAM_IGNORED } public respawn_player(id) { ExecuteHamB(Ham_CS_RoundRespawn, id) g_canzSpawn[id] = false } public remove_protection(id) { if (!is_user_alive(id) || !is_user_bot(id)) return PLUGIN_HANDLED g_canzSpawn[id] = false set_pev(id, pev_effects, pev(id, pev_effects) &~ EF_NODRAW) return PLUGIN_CONTINUE } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par } */[/spoiler] |
Szerző: | norbee.16 [2012.02.01. 14:50 ] |
Hozzászólás témája: | Re: ZP - Respawn |
tökéletes lesz csak a /ujra val ujra éled akármikor?? |
Szerző: | HuBaBuBa [2012.02.01. 15:15 ] |
Hozzászólás témája: | Re: ZP - Respawn |
!delayed parancs azért van benne a pluginba hogy amikor valaki kör közben csatlakozik a szerverre akkro ne kelljen várni 3 -4 percet ha nincs bennt az automatikus ujraéledés. Így megcsinálták 1x használatosra ami nem vesz le semmi löszer csomag-ot ! Viszont a /ujra -t akármikor használhatod ha van hozzá elég löszer csomagod! |
Szerző: | norbee.16 [2012.02.01. 15:28 ] |
Hozzászólás témája: | Re: ZP - Respawn |
oks kösz |
Oldal: 1 / 1 | Minden időpont UTC+02:00 időzóna szerinti |
Powered by phpBB® Forum Software © phpBB Limited https://www.phpbb.com/ |