Zplague Conectar-se

Seu portal de Zombie Plague no Brasil


Compartilhe

description[Pedido] Novo Plugin

more_horiz
Nome Do Plugin: zp_drop_colete
Descrição: É um plugin parecido com pdm.amxx(Dropa Dinheiro(Tecla 'G')) Só que Ao Apertar 'G'  Dropa Colete, ou seja, A Cada vez q Apertarmos o 'G' Irá Cair 100 de Colete no chão ou o tanto q tivermos a menos q isso, nada mais.
De Onde Viu o Plugin: N sei se existe e não ví



OBS: O model do Colete dropado no chão poderia ficar com o 'w_medikit', encontrado em valve/valve/models/w_medikit.

descriptionRe: [Pedido] Novo Plugin

more_horiz
Tbm quero

descriptionRe: [Pedido] Novo Plugin

more_horiz
Seria uma boa em :)

____________________________________________

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


descriptionRe: [Pedido] Novo Plugin

more_horiz
Plugin Entregue !

Versão 4fun:

Código:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include < xs >

#define PLUGIN "Drop Armor"
#define VERSION "1.0"
#define AUTHOR "[P]erfec[T] [S]cr[@]s[H]"

#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))

new const armor_class[] = "colete"
new const armor_model[] = "models/w_kevlar.mdl"
new const armor_sound[] = "items/tr_kevlar.wav"

public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   register_clcmd("drop", "drop_armor")
   register_forward(FM_Touch, "fwd_Touch")
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}

public plugin_precache()
{
   precache_model(armor_model)
   precache_sound(armor_sound)
}

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

public fwd_Touch(toucher, touched)
{
   if (!is_user_alive(toucher) || !pev_valid(touched)) return FMRES_IGNORED;
   
   new class[32]; pev(touched, pev_classname, class, charsmax(class))

   if (equal(class, armor_class))
   {
      set_user_armor(toucher, get_user_armor(toucher) + 10)
      emit_sound(toucher, CHAN_WEAPON, armor_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
      
      set_pev(touched, pev_effects, EF_NODRAW)
      set_pev(touched, pev_solid, SOLID_NOT)
      return FMRES_IGNORED
   }
   return FMRES_IGNORED
}

public drop_armor(id)
{
   if(get_user_weapon(id) == CSW_KNIFE && get_user_armor(id) >= 10)
   {
      new Float:Origin[3]
      new Float:vAngle[3]
      new Float:flVelocity[3]
      
      // Get position from eyes
      get_user_eye_position(id, Origin)
      
      pev(id, pev_v_angle, vAngle)
      
      new NewEnt = fm_create_entity("info_target")
      
      set_pev(NewEnt, pev_classname, armor_class)
      
      engfunc(EngFunc_SetModel, NewEnt, armor_model)
      
      set_pev(NewEnt, pev_size, Float:{ -2.0, -2.0, -2.0 }, Float:{ 2.0, 2.0, 2.0 })
         
      set_pev(NewEnt, pev_origin, Origin)
      
      set_pev(NewEnt, pev_solid, SOLID_BBOX)
      
      set_pev(NewEnt, pev_movetype, MOVETYPE_TOSS)
      set_pev(NewEnt, pev_owner, id)
      
      velocity_by_aim(id, 300, flVelocity)
      set_pev(NewEnt, pev_velocity, flVelocity)
      
      set_task(0.3, "unset_owner", NewEnt)
      
      set_user_armor(id, get_user_armor(id) - 10)
   }
}

public unset_owner(ent)
{
   if(!pev_valid(ent)) return PLUGIN_HANDLED
   
   new class[32]; pev(ent, pev_classname, class, charsmax(class))
   if(!equal(class, armor_class)) return PLUGIN_HANDLED;
   
   set_pev(ent, pev_owner, ent)
   
   return PLUGIN_CONTINUE;
}

stock set_user_armor(index, armor) {
   set_pev(index, pev_armorvalue, float(armor));

   return 1;
}

stock get_user_eye_position(id, Float:flOrigin[3])
{
   static Float:flViewOffs[3]
   pev(id, pev_view_ofs, flViewOffs)
   pev(id, pev_origin, flOrigin)
   xs_vec_add(flOrigin, flViewOffs, flOrigin)
}


Versão ZP:

Código:

/* Plugin generated by AMXX-Studio */

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

#define PLUGIN "[ZP] Drop Armor"
#define VERSION "1.0"
#define AUTHOR "[P]erfec[T] [S]cr[@]s[H]"

#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))

new const armor_class[] = "colete"
new const armor_model[] = "models/w_kevlar.mdl"
new const armor_sound[] = "items/tr_kevlar.wav"

public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR)
   
   register_clcmd("drop", "drop_armor")
   register_forward(FM_Touch, "fwd_Touch")
   register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
}

public plugin_precache()
{
   precache_model(armor_model)
   precache_sound(armor_sound)
}

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

public fwd_Touch(toucher, touched)
{
   if (!is_user_alive(toucher) || !pev_valid(touched) || zp_get_user_zombie(toucher)) return FMRES_IGNORED;
   
   new class[32]; pev(touched, pev_classname, class, charsmax(class))

   if (equal(class, armor_class))
   {
      set_user_armor(toucher, get_user_armor(toucher) + 10)
      emit_sound(toucher, CHAN_WEAPON, armor_sound, 1.0, ATTN_NORM, 0, PITCH_NORM)
      
      set_pev(touched, pev_effects, EF_NODRAW)
      set_pev(touched, pev_solid, SOLID_NOT)
      return FMRES_IGNORED
   }
   return FMRES_IGNORED
}

public drop_armor(id)
{
   if(get_user_weapon(id) == CSW_KNIFE && get_user_armor(id) >= 10 && !zp_get_user_zombie(id))
   {
      new Float:Origin[3]
      new Float:vAngle[3]
      new Float:flVelocity[3]
      
      // Get position from eyes
      get_user_eye_position(id, Origin)
      
      pev(id, pev_v_angle, vAngle)
      
      new NewEnt = fm_create_entity("info_target")
      
      set_pev(NewEnt, pev_classname, armor_class)
      
      engfunc(EngFunc_SetModel, NewEnt, armor_model)
      
      set_pev(NewEnt, pev_size, Float:{ -2.0, -2.0, -2.0 }, Float:{ 2.0, 2.0, 2.0 })
         
      set_pev(NewEnt, pev_origin, Origin)
      
      set_pev(NewEnt, pev_solid, SOLID_BBOX)
      
      set_pev(NewEnt, pev_movetype, MOVETYPE_TOSS)
      set_pev(NewEnt, pev_owner, id)
      
      velocity_by_aim(id, 300, flVelocity)
      set_pev(NewEnt, pev_velocity, flVelocity)
      
      set_task(0.3, "unset_owner", NewEnt)
      
      set_user_armor(id, get_user_armor(id) - 10)
   }
}

public unset_owner(ent)
{
   if(!pev_valid(ent)) return PLUGIN_HANDLED
   
   new class[32]; pev(ent, pev_classname, class, charsmax(class))
   if(!equal(class, armor_class)) return PLUGIN_HANDLED;
   
   set_pev(ent, pev_owner, ent)
   
   return PLUGIN_CONTINUE;
}

stock set_user_armor(index, armor) {
   set_pev(index, pev_armorvalue, float(armor));

   return 1;
}

stock get_user_eye_position(id, Float:flOrigin[3])
{
   static Float:flViewOffs[3]
   pev(id, pev_view_ofs, flViewOffs)
   pev(id, pev_origin, flOrigin)
   xs_vec_add(flOrigin, flViewOffs, flOrigin)
}

____________________________________________


Dicas Para Ser um Bom Scripter :
* Pense no Plugin que ira criar (Seja Inovador)
* Crie um código SMA imaginário na cabeça de como vai ser o plugin
* Passe o Codigo mental para o AMX Studio
* Compile e Teste
* Corrija Todos os Bugs do Plugin (Caso tiver um)
* Poste o Plugin ;)

** Seguindo as Dicas você estara no Padrão [P]erfec[T] [S]cr[@]s[H] **  
Zplague24 Zplague20Zplague12 

descriptionRe: [Pedido] Novo Plugin

more_horiz
Vlw Perfect Scrash, xD

descriptionRe: [Pedido] Novo Plugin

more_horiz
@Closed

____________________________________________

Quem sabe faz ao vivo :)
-----------------------------------------
Salve - Leozinho - Hawk - Gkf - Junin - J0sh - Rotam
-----------------------------------------
Vem que com nois é vida HAHA!!!!

-----------------------------------------

descriptionRe: [Pedido] Novo Plugin

more_horiz
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum