- | Afiseaza codul
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <fun> #include <hamsandwich> #include <engine> // #define PLUGIN "[ZP] Mario Coins" // #define VERSIO "1.0" // #define AUTHOR "tuty // london modifications" new const ClassName[] = "Coins"; new const SoundPick[] = "ZombieOutStanding/coin.wav"; new const SoundBonu[] = "ZombieOutStanding/pickup.wav"; new const CoinModel[] = "models/ZombieOutStanding/coin.mdl"; new const SpriteExp[] = "sprites/ZombieOutStanding/blue.spr"; new g_bonus_health, g_bonus_armor, g_bonus_packs; new Sprite; native zp_set_user_ammo_packs(id, packs); native zp_get_user_ammo_packs(id); native zp_get_user_zombie(id); public plugin_init() { register_event("DeathMsg", "make_coin", "a"); register_logevent("RoundEnd", 2, "1=Round_End"); register_think(ClassName, "coin_think"); register_touch(ClassName, "player", "coin_bonus"); g_bonus_armor = register_cvar("zp_bonus_armor", "15"); g_bonus_health = register_cvar("zp_bonus_health", "20"); g_bonus_packs = register_cvar("zp_bonus_packs", "5"); } public plugin_precache() { engfunc(EngFunc_PrecacheModel, CoinModel); engfunc(EngFunc_PrecacheSound, SoundPick); engfunc(EngFunc_PrecacheSound, SoundBonu); Sprite = engfunc(EngFunc_PrecacheModel, SpriteExp); } public make_coin() { new killer = read_data(1); new victim = read_data(2); if(killer == victim) return PLUGIN_HANDLED; new fOrigin[3]; pev(victim, pev_origin, fOrigin); fOrigin[2] += 4.0; new iEnt = create_entity("info_target"); if(!pev_valid(iEnt)) return PLUGIN_HANDLED; engfunc(EngFunc_SetOrigin, iEnt, fOrigin); engfunc(EngFunc_SetModel, iEnt, CoinModel); set_pev(iEnt, pev_classname, ClassName); set_pev(iEnt, pev_solid, SOLID_SLIDEBOX); set_pev(iEnt, pev_movetype, MOVETYPE_NONE); set_pev(iEnt, pev_framerate, 1.0); set_pev(iEnt, pev_sequence, 1.0); engfunc(EngFunc_SetSize, iEnt, Float:{ -10.0, -10.0, -10.0}, Float:{ 10.0, 10.0, 10.0 }); engfunc(EngFunc_DropToFloor, iEnt); set_pev(iEnt, pev_nextthink, get_gametime() + 1.0); return PLUGIN_CONTINUE; } public RoundEnd() remove_entity_name(ClassName); public coin_think(iEnt) { if(pev_valid(iEnt)) { set_pev(iEnt, pev_nextthink, get_gametime() + 1.0); set_pev(iEnt, pev_framerate, 1.0); set_pev(iEnt, pev_sequence, 1.0); } } public coin_bonus(iEnt) { if(pev_valid(iEnt)) { switch(random_num(1, 4)) { case 1: { for(new i = 1; i < 32; i++) { if(!is_user_alive(i)) return PLUGIN_HANDLED; if(zp_get_user_zombie(i)) return PLUGIN_HANDLED; new szData = get_pcvar_num(g_bonus_armor); set_user_armor(i, get_user_armor(i) + szData); ColorChat(i, "!x04[ZP] !x03You found !x04%d AP", szData); client_cmd(i, "spk ^"%s^"", SoundBonu); set_pev(iEnt, pev_flags, FL_KILLME); } } case 2: { for(new i = 1; i < 32; i++) { if(!is_user_alive(i)) return PLUGIN_HANDLED; if(zp_get_user_zombie(i)) return PLUGIN_HANDLED; new szData = get_pcvar_num(g_bonus_health); set_user_health(i, get_user_health(i) + szData); ColorChat(i, "!x04[ZP] !x03You Found !x04%d HP", szData); client_cmd(i, "spk ^"%s^"", SoundBonu); set_pev(iEnt, pev_flags, FL_KILLME); } } case 3: { for(new i = 1; i < 32; i++) { if(!is_user_alive(i)) return PLUGIN_HANDLED; if(zp_get_user_zombie(i)) return PLUGIN_HANDLED; new szData = get_pcvar_num(g_bonus_packs); zp_set_user_ammo_packs(i, zp_get_user_ammo_packs(i) + szData); ColorChat(i, "!x04[ZP] !x03You Found !x04%d Packs", szData); client_cmd(i, "spk ^"%s^"", SoundBonu); set_pev(iEnt, pev_flags, FL_KILLME); } } case 4: { for(new i = 1; i < 32; i++) { if(!is_user_alive(i)) return PLUGIN_HANDLED; new iOrigin[3]; pev(i, pev_origin, iOrigin); message_begin(MSG_ONE, SVC_TEMPENTITY); write_byte(TE_EXPLOSION); write_coord(iOrigin[0]); write_coord(iOrigin[1]); write_coord(iOrigin[2]); write_short(Sprite); write_byte(30); write_byte(10); write_byte(2); write_byte(50); write_byte(10); message_end(); user_silentkill(i); ColorChat(i, "!x04[ZP] !x03You found a !x04Mine"); client_cmd(i, "spk ^"%s^"", SoundBonu); set_pev(iEnt, pev_flags, FL_KILLME); } } } } return PLUGIN_CONTINUE; } stock ColorChat(const id, const input[], any:...) { new count = 1, players[32]; static msg[191]; vformat(msg, 190, input, 3); replace_all(msg, 190, "!x04", "^4"); replace_all(msg, 190, "!x03", "^3"); if(id) players[0] = id; else get_players(players, count, "ch"); { for(new i = 0; i < count; i++) { if(is_user_connected(players)) { message_begin(MSG_ONE_UNRELIABLE, get_user_msgid ( "SayText" ), _, players); write_byte(players); write_string(msg); message_end(); } } } }
De ce nu imi apare coin-ul cand fac un kill?