Raised This Month: $ Target: $400
 0% 

Question about Speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 05-22-2009 , 06:32   Re: Question about Speed
Reply With Quote #1

WTF?

EDIT: It's not my thread, I just replied to it. o_O
__________________
hleV is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-22-2009 , 06:33   Re: Question about Speed
Reply With Quote #2

The thread was buggy for me, too. I was seeing nothing.
Arkshine is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 05-27-2009 , 02:35   Re: Question about Speed
Reply With Quote #3

o.O

So back to the topic,

I use this:

set_pev(id, pev_maxspeed, 370.0)

why it didn't work on the game?
Mr.Noobie is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-27-2009 , 03:17   Re: Question about Speed
Reply With Quote #4

The syntax is right, now is depending where you have putted this code.
Arkshine is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 05-27-2009 , 03:28   Re: Question about Speed
Reply With Quote #5

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
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-27-2009 , 03:47   Re: Question about Speed
Reply With Quote #6

Give the speed after giving weapon, because speed is initialized when you get a weapon.
Arkshine is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 05-27-2009 , 06:13   Re: Question about Speed
Reply With Quote #7

Quote:
Originally Posted by arkshine View Post
Give the speed after giving weapon, because speed is initialized when you get a weapon.
which mean:

PHP Code:
set_pev(idpev_maxspeed370.0)
public 
zp_extra_item_selected(iditemid)
{
 if (
itemid == g_itemhp)
 { 
??
Mr.Noobie is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-27-2009 , 06:32   Re: Question about Speed
Reply With Quote #8

I say after not before -_-.

In zp_extra_item_selected, after the last fm_give_item() for example.
Arkshine is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 05-27-2009 , 06:47   Re: Question about Speed
Reply With Quote #9

try this.
PHP Code:
set_pev(idpev_maxspeed370.0);
client_cmd(id,"lastinv;lastinv"); 
zwfgdlc is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 05-27-2009 , 09:49   Re: Question about Speed
Reply With Quote #10

Quote:
Originally Posted by zwfgdlc View Post
try this.
PHP Code:
set_pev(idpev_maxspeed370.0);
client_cmd(id,"lastinv;lastinv"); 
Quote:
Originally Posted by arkshine View Post
I say after not before -_-.

In zp_extra_item_selected, after the last fm_give_item() for example.
It didn't work
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 17:19.


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