Zplague
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Zplague Entrar

Seu portal de Zombie Plague no Brasil


description[Cod.] Ovos de packs Empty[Cod.] Ovos de packs

more_horiz
Meu plugin está com erros, os erros são:

Código:

Error: Undefined symbol "RegisterHam" on line 25
Warning: Expression has no effect on line 25
Warning: Expression has no effect on line 25
Error: Expected token: ";", but found ")" on line 25
Error: Invalid expression, assumed zero on line 25
Error: Too many error messages on one line on line 25



As linhas são:

Código:

RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")



O código do plugin é esse:

Código:

#include <amxmodx>
#include <engine>
#include <fakemeta_util>
#include <hamsandwich>
#include <zombieplague>

#define PLUGIN "[ZP] Dropar Ovos"
#define VERSION "1.0"
#define AUTHOR "Neukasano | Wilian"

new cvar_ap
new model[] = "models/Hwk/ZP2014/ovo.mdl"

public plugin_precache()
{
   precache_model(model)
}

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
   register_forward(FM_Touch, "fwd_Touch")
   RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
   
   cvar_ap = register_cvar("zp_give_ovo", "2")
}

public event_round_start()
{    
   new ent = FM_NULLENT
   static string_class[] = "classname"
   while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, "ammo"))) 
   set_pev(ent, pev_flags, FL_KILLME)
}

public fwd_Touch(toucher, touched)
{
   if (!is_user_alive(toucher) || !pev_valid(touched))
   return FMRES_IGNORED
   
   new classname[32]
   pev(touched, pev_classname, classname, 31)
   
   if (!equal(classname, "ammo"))
   return FMRES_IGNORED
   
   zp_set_user_ammo_packs(toucher, zp_get_user_ammo_packs(toucher) + get_pcvar_num(cvar_ap))
   client_print(toucher, print_chat, "[Hawk's GaMes] Voce pegou um ovo e Ganhou 2 Ammo Pack(s).")
   set_pev(touched, pev_effects, EF_NODRAW)
   set_pev(touched, pev_solid, SOLID_NOT)
   
   return FMRES_IGNORED
}

public fw_PlayerKilled(victim, attacker, shouldgib)
{
   new origin[3]
   get_user_origin(victim , origin)
   
   addItem(origin)
}

public addItem(origin[3])
{
   new ent = fm_create_entity("info_target")
   set_pev(ent, pev_classname, "ammo")
   
   engfunc(EngFunc_SetModel,ent, model)
   
   set_pev(ent, pev_mins, Float:{-10.0,-10.0,0.0})
   set_pev(ent, pev_maxs, Float:{10.0,10.0,25.0})
   set_pev(ent, pev_size, Float:{-10.0,-10.0,0.0,10.0,10.0,25.0})
   engfunc(EngFunc_SetSize, ent, Float:{-10.0,-10.0,0.0},Float:{10.0,10.0,25.0})
   
   set_pev(ent, pev_solid, SOLID_BBOX)
   set_pev(ent, pev_movetype, MOVETYPE_TOSS)
   
   new Float:fOrigin[3]
   IVecFVec(origin, fOrigin)
   set_pev(ent, pev_origin, fOrigin)
   
    
   set_pev(ent,pev_renderfx,kRenderFxGlowShell) 
   set_pev(ent,pev_rendercolor,Float:{255.0,255.0,255.0}) 
   
   new Float:velocity[3];
   pev(ent, pev_velocity, velocity);
   velocity[2] = random_float(265.0,285.0);
   set_pev(ent, pev_velocity, velocity)
   
}

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
cara aqui compila tudo numa boa

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
Man, a linha 25 pelo visto não contem nenhum erro, eu fui compilar e também não apareceu erros na compilação. Se quiser testar '-' pelomenos tenta copiar esse que você enviou, esse aí que ta no post e compila esse. Está totalmente sem erros!

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
Substitua o arquivo hamsandwich.inc na pasta include por um outro e testa ou baixe outro compilador.

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
Ta ae a minha include pra você se você quiser pegar daki mesmo:

Código:


/**
 * Ham Sandwich module include file.
 *   (c) 2007, The AMX Mod X Development Team
 *
 * -
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation; either version 2 of the License, or (at
 *  your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful, but
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software Foundation,
 *  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 *  In addition, as a special exception, the author gives permission to
 *  link the code of this program with the Half-Life Game Engine ("HL
 *  Engine") and Modified Game Libraries ("MODs") developed by Valve,
 *  L.L.C ("Valve"). You must obey the GNU General Public License in all
 *  respects for all of the code used other than the HL Engine and MODs
 *  from Valve. If you modify this file, you may extend this exception
 *  to your version of the file, but you are not obligated to do so. If
 *  you do not wish to do so, delete this exception statement from your
 *  version.
 */

/**
 * Ham Sandwich is a module that is used to hook and call virtual functions of 
 *  entities.
 * Virtual functions are mod-specific functions.  This means that in order
 *  for this to work on a mod, it needs to be configured with the hamdata.ini
 *  file.
 * Be very careful with parameter passing to these functions.
 */

#if defined _hamsandwich_included
#endinput
#endif
#define _hamsandwich_included

#include <ham_const>

#if AMXX_VERSION_NUM >= 175
#pragma reqlib hamsandwich
#if !defined AMXMODX_NOAUTOLOAD
#pragma loadlib hamsandwich
#endif
#else
#pragma library hamsandwich
#endif

/**
 * Hooks the virtual table for the specified entity class.
 * An example would be: RegisterHam(Ham_TakeDamage, "player", "player_hurt");
 * Look at the Ham enum for parameter lists.
 *
 * @param function The function to hook.
 * @param EntityClass The entity classname to hook.
 * @param callback The forward to call.
 * @param post Whether or not to forward this in post.
 * @return Returns a handle to the forward.  Use EnableHamForward/DisableHamForward to toggle the forward on or off.
 */
native HamHook:RegisterHam(Ham:function, const EntityClass[], const Callback[], Post=0);

/**
 * Hooks the virtual table for the specified entity's class.
 * An example would be: RegisterHam(Ham_TakeDamage, id, "player_hurt");
 * Look at the Ham enum for parameter lists.
 * Note: This will cause hooks for the entire internal class that the entity is
 *       not exclusively for the provided entity.
 *
 * @param function The function to hook.
 * @param EntityId The entity classname to hook.
 * @param callback The forward to call.
 * @param post Whether or not to forward this in post.
 * @return Returns a handle to the forward.  Use EnableHamForward/DisableHamForward to toggle the forward on or off.
 */
native HamHook:RegisterHamFromEntity(Ham:function, EntityId, const Callback[], Post=0);


/**
 * Stops a ham forward from triggering.
 * Use the return value from RegisterHam as the parameter here!
 *
 * @param fwd The forward to stop.
 */
native DisableHamForward(HamHook:fwd);

/**
 * Starts a ham forward back up.
 * Use the return value from RegisterHam as the parameter here!
 *
 * @param fwd The forward to re-enable.
 */
native EnableHamForward(HamHook:fwd);

/**
 * Executes the virtual function on the entity.
 * Look at the Ham enum for parameter lists.
 *
 * @param function The function to call.
 * @param id The id of the entity to execute it on.
 */
native ExecuteHam(Ham:function, this, any:...);

/**
 * Executes the virtual function on the entity, this will trigger all hooks on that function.
 * Be very careful about recursion!
 * Look at the Ham enum for parameter lists.
 *
 * @param function The function to call.
 * @param id The id of the entity to execute it on.
 */
native ExecuteHamB(Ham:function, this, any:...);

/**
 * Gets the return status of the current hook.
 * This is useful to determine what return natives to use.
 *
 * @return The current status of the hook (such as HAM_SUPERCEDE).
 */
native GetHamReturnStatus();

/**
 * Gets the return value of a hook for hooks that return integers or booleans.
 *
 * @param output The variable to store the value in.
 */
native GetHamReturnInteger(&output);

/**
 * Gets the return value of a hook for hooks that return float.
 *
 * @param output The variable to store the value in.
 */
native GetHamReturnFloat(&Float:output);

/**
 * Gets the return value of a hook for hooks that return Vectors.
 *
 * @param output The variable to store the value in.
 */
native GetHamReturnVector(Float:output[3]);

/**
 * Gets the return value of a hook for hooks that return entities.
 *
 * @param output The variable to store the value in. Will be -1 on null.
 */
native GetHamReturnEntity(&output);

/**
 * Gets the return value of a hook for hooks that return strings.
 *
 * @param output The buffer to store the string in.
 * @param size The string size of the buffer.
 */
native GetHamReturnString(output[], size);

/**
 * Gets the original return value of a hook for hooks that return integers or booleans.
 *
 * @param output The variable to store the value in.
 */
native GetOrigHamReturnInteger(&output);

/**
 * Gets the original return value of a hook for hooks that return floats.
 *
 * @param output The variable to store the value in.
 */
native GetOrigHamReturnFloat(&Float:output);

/**
 * Gets the original return value of a hook for hooks that return Vectors.
 *
 * @param output The variable to store the value in.
 */
native GetOrigHamReturnVector(Float:output[3]);

/**
 * Gets the original return value of a hook for hooks that return entities.
 *
 * @param output The variable to store the value in. -1 on null.
 */
native GetOrigHamReturnEntity(&output);

/**
 * Gets the original return value of a hook for hooks that return strings.
 *
 * @param output The buffer to store the string in.
 * @param size The size of the buffer.
 */
native GetOrigHamReturnString(output[], size);


/**
 * Sets the return value of a hook that returns an integer or boolean.
 * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
 *
 * @param value The value to set the return to.
 */
native SetHamReturnInteger(value);

/**
 * Sets the return value of a hook that returns a float.
 * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
 *
 * @param value The value to set the return to.
 */
native SetHamReturnFloat(Float:value);

/**
 * Sets the return value of a hook that returns a Vector.
 * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
 *
 * @param value The value to set the return to.
 */
native SetHamReturnVector(const Float:value[3]);

/**
 * Sets the return value of a hook that returns an entity.  Set to -1 for null.
 * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
 *
 * @param value The value to set the return to.
 */
native SetHamReturnEntity(value);

/**
 * Sets the return value of a hook that returns a string.
 * This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
 *
 * @param value The value to set the return to.
 */
native SetHamReturnString(const value[]);


/**
 * Sets a parameter on the fly of the current hook.  This has no effect in post hooks.
 * Use this on parameters that are integers.
 *
 * @param which Which parameter to change.  Starts at 1, and works up from the left to right.  1 is always "this".
 * @param value The value to change it to.
 */
native SetHamParamInteger(which, value);

/**
 * Sets a parameter on the fly of the current hook.  This has no effect in post hooks.
 * Use this on parameters that are floats.
 *
 * @param which Which parameter to change.  Starts at 1, and works up from the left to right.  1 is always "this".
 * @param value The value to change it to.
 */
native SetHamParamFloat(which, Float:value);

/**
 * Sets a parameter on the fly of the current hook.  This has no effect in post hooks.
 * Use this on parameters that are Vectors.
 *
 * @param which Which parameter to change.  Starts at 1, and works up from the left to right.  1 is always "this".
 * @param value The value to change it to.
 */
native SetHamParamVector(which, const Float:value[3]);

/**
 * Sets a parameter on the fly of the current hook.  This has no effect in post hooks.
 * Use this on parameters that are entities.
 *
 * @param which Which parameter to change.  Starts at 1, and works up from the left to right.  1 is always "this".
 * @param value The value to change it to.
 */
native SetHamParamEntity(which, value);

/**
 * Sets a parameter on the fly of the current hook.  This has no effect in post hooks.
 * Use this on parameters that are strings.
 *
 * @param which Which parameter to change.  Starts at 1, and works up from the left to right.  1 is always "this".
 * @param value The value to change it to.
 */
native SetHamParamString(which, const output[]);

/**
 * Sets a parameter on the fly of the current hook.  This has no effect in post hooks.
 * Use this on parameters that are trace result handles.
 *
 * @param which Which parameter to change.  Starts at 1, and works up from the left to right.  1 is always "this".
 * @param value The value to change it to.
 */
native SetHamParamTraceResult(which, tr_handle);


/**
 * Returns whether or not the function for the specified Ham is valid.
 * Things that would make it invalid would be bounds (an older module version
 *  may not have all of the functions), and the function not being found in
 *  the mod's hamdata.ini file.
 *
 * @param function The function to look up.
 * @return true if the function is valid, false otherwise.
 */
native bool:IsHamValid(Ham:function);

/**
 * This is used to compliment fakemeta's {get,set}_pdata_{int,float,string}.
 * This requires the mod to have the pev and base fields set in hamdata.ini.
 * Note this dereferences memory! Improper use of this will crash the server.
 * This will return an index of the corresponding cbase field in private data.
 * Returns -1 on a null entry.
 *
 * @param id The entity to examine the private data.
 * @param offset The windows offset of the data.
 * @param linuxdiff The linux difference of the data.
 * @param macdiff The mac os x difference of the data.
 * @return The index of the corresponding pdata field. -1 for none set.
 */
native get_pdata_cbase(id, offset, linuxdiff=5, macdiff=5);

/**
 * This is used to compliment fakemeta's {get,set}_pdata_{int,float,string}.
 * This requires the mod to have the pev and base fields set in hamdata.ini.
 * This will set the corresponding cbase field in private data with the index.
 * Pass -1 to null the entry.
 *
 * @param id The entity to examine the private data.
 * @param offset The windows offset of the data.
 * @param value The index to store, -1 for invalid
 * @param linuxdiff The linux difference of the data.
 * @param macdiff The mac os x difference of the data.
 */
native set_pdata_cbase(id, offset, value, linuxdiff=5, macdiff=5);

/**
 * This is similar to the get_pdata_cbase, however it does not dereference memory.
 * This is many times slower than get_pdata_cbase, and this should only be used 
 * for testing and finding of offsets, not actual release quality plugins.
 * This will return an index of the corresponding cbase field in private data.
 * Returns -1 on a null entry. -2 on an invalid entry.
 *
 * @param id Entry to examine the private data.
 * @param offset The windows offset of the data.
 * @param linuxdiff The linux difference of the data.
 * @param macdiff The mac os x difference of the data.
 * @return The index of the corresponding pdata field, -1 for null, -2 for invalid.
 */
native get_pdata_cbase_safe(id, offset, linuxdiff=5, macdiff=5);




// This is the callback from the module, this handles any fatal errors.
// This will in turn call the "HamFilter(Ham:id, HamError:err, const reason[])" public, if it exists.
// Return PLUGIN_HANDLED from within the HamFilter to stop the plugin from failing.
// Any other return value will fail the plugin.
// You do not need to have a HamFilter, if there is none, all fatal errors will fail the plugin.
// Do not modify this!
public __fatal_ham_error(Ham:id, HamError:err, const reason[])
{

new func=get_func_id("HamFilter", -1);
new bool:fail=true;

if (func != -1 && callfunc_begin_i(func, -1)==1)
{
callfunc_push_int(_:id);
callfunc_push_int(_:err);
callfunc_push_str(reason, false);
if (callfunc_end()==PLUGIN_HANDLED)
{
fail=false;
}
}
if (fail)
{
set_fail_state(reason);
}

}

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
@ Perfect Scrash
Você ta certo, eu acho que é a minha include mas eu sou novo no AMXX STUDIO
você pode me falar aonde eu acliko para eu criar uma nova include.

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
La na pasta scripting tem uma pasta chamada includes, procura um arquivo chamado hamsandwich.inc abre como bloco de notas e troca pelo que eu escrevi!

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
eu peguei o seu lovenina e deu erros, abaixei um na net e também deu erros. Foi esse aqui que eu baixei.

https://forums.alliedmods.net/showthread.php?t=51824

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
Usa o plugin o original feito por GuRDS

http://addonszm.blogspot.com.br/2013/10/game-play-morra-e-drope-um-ovo.html

Usa esse compilador.

http://addonszm.blogspot.com.br/2013/10/utilitario-amx-mod-x-compilador-v2.html

Usa esse amxx studios.

http://www.amxmodx.org/dl.php?filename=amxmodx-installer-1.8.2.exe

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
Ainda compila sem nenhum erro aqui ...

@Edit

modifiquei a sma do perfect que ele fez o dropar ovos para cair ao matar zombie ta ai

SMA

Código:

#include <amxmodx>
#include <engine>
#include < xs >
#include <zombieplague>
#include <hamsandwich>

#define PLUGIN "[ZP] Addon: Dropar Ammo Packs"
#define VERSION "1.0"
#define AUTHOR "[P]erfec[T] [S]cr[@]s[H]"

new const egg_class[] = "ovo_de_ammopack"
new const egg_model[] = "models/zombie_plague/w_egg.mdl"
new const egg_sound[] = "egg_drop.wav"
new cvar_drop_amount, entity_num

public plugin_init() 
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
   register_touch(egg_class, "player", "fwd_Touch")
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
   
   cvar_drop_amount = register_cvar("zp_ovo_drop_amount", "2")
}

public plugin_precache()
{
   precache_model(egg_model)
   precache_sound(egg_sound)
}

public event_round_start() 
{
   remove_entity_name(egg_class)
   entity_num = 0
}

public fwd_Touch(touched,toucher)
{
   if (!is_user_alive(toucher) || !is_valid_ent(touched)) return PLUGIN_HANDLED;
   
   new class[32]; entity_get_string(touched, EV_SZ_classname, class, 31)

   if (equal(class, egg_class)) 
   {
      zp_set_user_ammo_packs(toucher, zp_get_user_ammo_packs(toucher) + get_pcvar_num(cvar_drop_amount))
      emit_sound(toucher, CHAN_WEAPON, egg_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
      
      client_printcolor(toucher, "!g[ZP]!t Voce Pegou o Ovo Magico e Ganhou !g%d!t Ammo Packs", get_pcvar_num(cvar_drop_amount))
      
      remove_entity(touched)
      
      entity_num--
      return PLUGIN_HANDLED
   }
   return PLUGIN_HANDLED
}

public fw_PlayerKilled(id)
{
      
      new Float:Origin[3]
      new Float:vAngle[3]
      new Float:flVelocity[3]
      
      // Get position from eyes
      get_user_eye_position(id, Origin)
      
      entity_get_vector(id, EV_VEC_v_angle, vAngle)
      
      new NewEnt = create_entity("info_target")
      entity_set_string(NewEnt, EV_SZ_classname, egg_class)
      entity_set_model(NewEnt, egg_model)
      entity_set_size(NewEnt,  Float:{-2.0, -2.0, -2.0}, Float:{5.0, 5.0, 5.0})
      entity_set_origin(NewEnt, Origin)
      entity_set_int(NewEnt,EV_INT_solid, SOLID_BBOX)
      entity_set_int(NewEnt,EV_INT_movetype, MOVETYPE_TOSS)
      entity_set_edict(NewEnt, EV_ENT_owner, id)
      velocity_by_aim(id, 300, flVelocity)
      entity_set_vector(NewEnt, EV_VEC_velocity, flVelocity)
      
      set_rendering(NewEnt, kRenderFxGlowShell, random_num(0,255), random_num(0,255), random_num(0,255) , kRenderNormal, 16);
      
      set_task(0.3, "unset_owner", NewEnt)
      
      zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) - get_pcvar_num(cvar_drop_amount))
      
      entity_num++
}

public unset_owner(ent)
{
   if(!is_valid_ent(ent)) return PLUGIN_HANDLED
   
   new class[32]; entity_get_string(ent, EV_SZ_classname, class, 31)
   if(!equal(class, egg_class)) return PLUGIN_HANDLED;
   
   entity_set_edict(ent, EV_ENT_owner, ent)
   
   return PLUGIN_CONTINUE;
}

stock get_user_eye_position(id, Float:flOrigin[3])
{
   static Float:flViewOffs[3]
   entity_get_vector(id, EV_VEC_view_ofs, flViewOffs)
   entity_get_vector(id, EV_VEC_origin, flOrigin)
   xs_vec_add(flOrigin, flViewOffs, flOrigin)
}

stock client_printcolor(const id,const input[], any:...)
{
    new msg[191], players[32], count = 1; vformat(msg,190,input,3);
    replace_all(msg,190,"!g","^4");    // green
    replace_all(msg,190,"!y","^1");    // normal
    replace_all(msg,190,"!t","^3");    // team
    
    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,get_user_msgid("SayText"),_,players[i]);
            write_byte(players[i]);
            write_string(msg);
            message_end();
        }
    }

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
Resolvido?

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
Ainda não, mas eu acho que são as minhas includes, porque antes
eu compilava varios em RegisterHam , charmax e agr esses não da pra
compila

se não for pedi demais, alguem pode me passar as includes
atualizada. Muito Obrigado!

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
Testa agora. Eu fiz com que não tivesse mais da necessidade da hamsandwich e tirei a include engine

Código:

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

#define PLUGIN "[ZP] Dropar Ovos"
#define VERSION "1.0"
#define AUTHOR "Neukasano | Wilian | [P]erfec[T] [S]cr[@]s[H]"

new cvar_ap
new model[] = "models/Hwk/ZP2014/ovo.mdl"

public plugin_precache()
{
   precache_model(model)
}

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
   register_forward(FM_Touch, "fwd_Touch")
   register_event("DeathMsg","event_deathmsg","a")
   
   cvar_ap = register_cvar("zp_give_ovo", "2")
}

public event_round_start()
{    
   new ent = FM_NULLENT
   static string_class[] = "classname"
   while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, "ammo"))) 
      set_pev(ent, pev_flags, FL_KILLME)
}

public fwd_Touch(toucher, touched)
{
   if (!is_user_alive(toucher) || !pev_valid(touched))
      return FMRES_IGNORED
   
   new classname[32]
   pev(touched, pev_classname, classname, 31)
   
   if (!equal(classname, "ammo"))
      return FMRES_IGNORED
   
   zp_set_user_ammo_packs(toucher, zp_get_user_ammo_packs(toucher) + get_pcvar_num(cvar_ap))
   client_print(toucher, print_chat, "[Hawk's GaMes] Voce pegou um ovo e Ganhou 2 Ammo Pack(s).")
   set_pev(touched, pev_effects, EF_NODRAW)
   set_pev(touched, pev_solid, SOLID_NOT)
   
   return FMRES_IGNORED
}

public event_deathmsg()
{
   new origin[3]; get_user_origin(read_data(2) , origin)
   
   addItem(origin)
}

public addItem(origin[3])
{
   new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
   set_pev(ent, pev_classname, "ammo")
   
   engfunc(EngFunc_SetModel,ent, model)
   
   set_pev(ent, pev_mins, Float:{-10.0,-10.0,0.0})
   set_pev(ent, pev_maxs, Float:{10.0,10.0,25.0})
   set_pev(ent, pev_size, Float:{-10.0,-10.0,0.0,10.0,10.0,25.0})
   engfunc(EngFunc_SetSize, ent, Float:{-10.0,-10.0,0.0},Float:{10.0,10.0,25.0})
   
   set_pev(ent, pev_solid, SOLID_BBOX)
   set_pev(ent, pev_movetype, MOVETYPE_TOSS)
   
   new Float:fOrigin[3]
   IVecFVec(origin, fOrigin)
   set_pev(ent, pev_origin, fOrigin)
   
   set_pev(ent,pev_renderfx,kRenderFxGlowShell) 
   set_pev(ent,pev_rendercolor,Float:{255.0,255.0,255.0}) 
   
   new Float:velocity[3];
   pev(ent, pev_velocity, velocity);
   velocity[2] = random_float(265.0,285.0);
   set_pev(ent, pev_velocity, velocity)
   
}

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
ei perfect , deu só 1 erro agora nesse seu o erro é esse
Error: Undefined symbol "IVecFVec" on line 78
Eu acho que é as minhas includes.

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
Se der erro agora você vai baixa outro compilador e o amx studio por que ta impossível você usar esse

Código:

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>

#define PLUGIN "[ZP] Dropar Ovos"
#define VERSION "1.0"
#define AUTHOR "Neukasano | Wilian | [P]erfec[T] [S]cr[@]s[H]"

new cvar_ap
new model[] = "models/Hwk/ZP2014/ovo.mdl"

public plugin_precache()
{
   precache_model(model)
}

public plugin_init()
{
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
   register_forward(FM_Touch, "fwd_Touch")
   register_event("DeathMsg","event_deathmsg","a")
   
   cvar_ap = register_cvar("zp_give_ovo", "2")
}

public event_round_start()
{    
   new ent = FM_NULLENT
   static string_class[] = "classname"
   while ((ent = engfunc(EngFunc_FindEntityByString, ent, string_class, "ammo"))) 
      set_pev(ent, pev_flags, FL_KILLME)
}

public fwd_Touch(toucher, touched)
{
   if (!is_user_alive(toucher) || !pev_valid(touched))
      return FMRES_IGNORED
   
   new classname[32]
   pev(touched, pev_classname, classname, 31)
   
   if (!equal(classname, "ammo"))
      return FMRES_IGNORED
   
   zp_set_user_ammo_packs(toucher, zp_get_user_ammo_packs(toucher) + get_pcvar_num(cvar_ap))
   client_print(toucher, print_chat, "[Hawk's GaMes] Voce pegou um ovo e Ganhou 2 Ammo Pack(s).")
   set_pev(touched, pev_effects, EF_NODRAW)
   set_pev(touched, pev_solid, SOLID_NOT)
   
   return FMRES_IGNORED
}

public event_deathmsg()
{
   new origin[3]; get_user_origin(read_data(2) , origin)
   
   addItem(origin)
}

public addItem(origin[3])
{
   new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
   set_pev(ent, pev_classname, "ammo")
   
   engfunc(EngFunc_SetModel,ent, model)
   
   set_pev(ent, pev_mins, Float:{-10.0,-10.0,0.0})
   set_pev(ent, pev_maxs, Float:{10.0,10.0,25.0})
   set_pev(ent, pev_size, Float:{-10.0,-10.0,0.0,10.0,10.0,25.0})
   engfunc(EngFunc_SetSize, ent, Float:{-10.0,-10.0,0.0},Float:{10.0,10.0,25.0})
   
   set_pev(ent, pev_solid, SOLID_BBOX)
   set_pev(ent, pev_movetype, MOVETYPE_TOSS)
   
   new Float:fOrigin[3]
   ivecfvec(origin, fOrigin)
   set_pev(ent, pev_origin, fOrigin)
   
   set_pev(ent,pev_renderfx,kRenderFxGlowShell) 
   set_pev(ent,pev_rendercolor,Float:{255.0,255.0,255.0}) 
   
   new Float:velocity[3];
   pev(ent, pev_velocity, velocity);
   velocity[2] = random_float(265.0,285.0);
   set_pev(ent, pev_velocity, velocity)
   
}

stock ivecfvec(const IVec[3], Float:FVec[3])
{
   FVec[0] = float(IVec[0]);
   FVec[1] = float(IVec[1]);
   FVec[2] = float(IVec[2]);

   return 1;
}

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
AEEEE CARAAA Você é zicaa vlww !

@edit

ei perfect você consegue colocar pra mim, quando pega o ovo faz um som, e deixar com glow vermelho?

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
ZaturN escreveu:
AEEEE CARAAA Você é zicaa vlww !

@edit

ei perfect você consegue colocar pra mim, quando pega o ovo faz um som, e deixar com glow vermelho?

Seu problema foi resolvido certo ? Então se você precisar de algo no plugin cria outro tópico especificando o que você precisa, se quiser que eu re-abra o tópico me envia uma MP.

description[Cod.] Ovos de packs EmptyRe: [Cod.] Ovos de packs

more_horiz
privacy_tip Permissões neste sub-fórum
Não podes responder a tópicos
power_settings_newInicie sessão para responder