Raised This Month: $ Target: $400
 0% 

Question about Speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 05-27-2009 , 03:28   Re: Question about Speed
Reply With Quote #1

Codes:

Code:
#include <amxmodx>
#include <zombieplague>
#include <fakemeta>
new g_itemhp, Armor, Health, Gravity
public plugin_init()
{
 register_plugin("[ZP] Human Pack", "1.3", "zombieplague")
 g_itemhp = zp_register_extra_item("Human Pack", 35, ZP_TEAM_HUMAN)
 Health = register_cvar("zp_hp_health", "500");    // Amount of HP
 Armor = register_cvar("zp_hp_armor", "500");    // Amount of Armor
 Gravity = register_cvar("zp_hp_gravity", "0.7");    // Amount of Gravity  
}
public zp_extra_item_selected(id, itemid)
{
 if (itemid == g_itemhp)
 {
   // Speed
   set_pev(id, pev_maxspeed, 370.0)
   // Health
   set_pev(id, pev_health, (pev(id, pev_health) + get_pcvar_float(Health)))
  // Armor
   set_pev(id, pev_armorvalue, (pev(id, pev_armorvalue) + get_pcvar_float(Armor)))
         // Gravity
  fm_set_user_gravity(id, get_pcvar_float(Gravity))
         // Weapon
         fm_give_item(id, "weapon_mp5navy")
         fm_give_item(id, "weapon_ak47")
         fm_give_item(id, "weapon_m4a1")
  fm_give_item(id, "weapon_awp")
  fm_give_item(id, "weapon_deagle")
         // Item
         fm_give_item(id, "weapon_hegrenade")
  fm_give_item(id, "weapon_flashbang")
         fm_give_item(id, "weapon_smokegrenade")
         // BP ammo
         fm_set_user_bpammo(id, CSW_DEAGLE, 150)
         fm_set_user_bpammo(id, CSW_AK47, 250)
         fm_set_user_bpammo(id, CSW_M4A1, 250)
         fm_set_user_bpammo(id, CSW_AWP, 200)
         fm_set_user_bpammo(id, CSW_MP5NAVY, 250)
         client_print(id, print_chat, "[ZP] You have bought a Human Pack")
 }
}
stock fm_set_user_bpammo(id, weaponid, amnt) 
{ 
    static offset; 
    switch(weaponid) 
    { 
        case CSW_AWP: offset = 377; 
        case CSW_SCOUT,CSW_AK47,CSW_G3SG1: offset = 378; 
        case CSW_M249: offset = 379;         
        case CSW_FAMAS,CSW_M4A1,CSW_AUG,CSW_SG550,CSW_GALI,CSW_SG552: offset = 380; 
        case CSW_M3,CSW_XM1014: offset = 381; 
        case CSW_USP,CSW_UMP45,CSW_MAC10: offset = 382; 
        case CSW_FIVESEVEN,CSW_P90: offset = 383; 
        case CSW_DEAGLE: offset = 384; 
        case CSW_P228: offset = 385; 
        case CSW_GLOCK18,CSW_MP5NAVY,CSW_TMP,CSW_ELITE: offset = 386; 
        case CSW_FLASHBANG: offset = 387; 
        case CSW_HEGRENADE: offset = 388; 
        case CSW_SMOKEGRENADE: offset = 389; 
        default: return 0; 
    } 
    set_pdata_int(id,offset,amnt,5); 
     
    return 1; 
}
stock fm_set_user_gravity(index, Float:gravity = 1.0) {
    set_pev(index, pev_gravity, gravity);
    return 1;
}
stock fm_give_item(id, const item[])
{
    static ent
    ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item))
    if (!pev_valid(ent)) return;
    
    static Float:originF[3]
    pev(id, pev_origin, originF)
    set_pev(ent, pev_origin, originF)
    set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
    dllfunc(DLLFunc_Spawn, ent)
    
    static save
    save = pev(ent, pev_solid)
    dllfunc(DLLFunc_Touch, ent, id)
    if (pev(ent, pev_solid) != save)
        return;
    
    engfunc(EngFunc_RemoveEntity, ent)
}
I put at here:

PHP Code:
 if (itemid == g_itemhp)
 {
   
// Speed
   
set_pev(idpev_maxspeed370.0
Mr.Noobie is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode