Raised This Month: $ Target: $400
 0% 

change the player speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 04-13-2009 , 06:28   change the player speed
Reply With Quote #1

PHP Code:
/*================================================================================
    
    -----------------------------------
    -*- [ZP] Zombie Classes Example -*-
    -----------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This is just an example on how to add additional zombie classes in ZP.
    
================================================================================*/

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

// Zombie Attributes
new const zclass_name[] = { "My Zombie" // name
new const zclass_info[] = { "My Stats" // description
new const zclass_model[] = { "zombie_source" // model
new const zclass_clawmodel[] = { "v_knife_zombie.mdl" // claw model
const zclass_health 1800 // health
const zclass_speed 190 // speed
const Float:zclass_gravity 1.0 // gravity
const Float:zclass_knockback 1.0 // knockback

// Class IDs
new g_zclassid1

// Zombie Classes MUST be registered on plugin_precache
public plugin_precache()
{
    
register_plugin("[ZP] Additional Zombie Classes""0.1""Example")
    
register_event("DeathMsg""hc_death""b")
    
register_event("HLTV""hc_newround""a""1=0""2=0")
    
    
// Register the new class and store ID for reference
    
g_zclassid1 zp_register_zombie_class(zclass_namezclass_infozclass_modelzclass_clawmodelzclass_healthzclass_speedzclass_gravityzclass_knockback)    
}

// User Infected forward
public zp_user_infected_post(idinfector)
{
    if(!
is_user_alive(id))
        return;
    
    
// Check if the infected player is using our custom zombie class
    
if (zp_get_user_zombie_class(id) == g_zclassid1)
    {
        
set_pev(idpev_bInDuck1)
        
console_cmd(id"+duck")
        
client_print(idprint_chat"[ZP] You're using a headcrab class!")
    }
}

public 
hc_death(id)
{
    if(
is_user_alive(id))
        return 
PLUGIN_HANDLED
    
    set_pev
(idpev_bInDuck0)
    
console_cmd(id"-duck")
    
console_cmd(id"-duck")
    
    return 
PLUGIN_HANDLED
}

public 
hc_newround()
{
    
set_pev(idpev_bInDuck0)
    
console_cmd(id"-duck")
    
console_cmd(id"-duck")

How to change the player speed if the player is duck ???
thanks for you help.
Anggara_nothing is offline
Shard
Member
Join Date: Mar 2009
Old 04-13-2009 , 12:33   Re: change the player speed
Reply With Quote #2

Ducking reduces a percentage of the maximum speed of a person. So maybe, you can try making the maximum speed of the zombie higher, so the duck speed would be higher. If you want to know about not affecting the maximum speed, that one i do not know sorry.
Shard is offline
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 04-14-2009 , 02:12   Re: change the player speed
Reply With Quote #3

Quote:
Originally Posted by Shard View Post
Ducking reduces a percentage of the maximum speed of a person. So maybe, you can try making the maximum speed of the zombie higher, so the duck speed would be higher. If you want to know about not affecting the maximum speed, that one i do not know sorry.
i try to add "set_user_maxspeed(id, ....)" and not working. why?
Anggara_nothing is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-14-2009 , 08:37   Re: change the player speed
Reply With Quote #4

Have you used a float?
__________________
alan_el_more is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-15-2009 , 08:28   Re: change the player speed
Reply With Quote #5

Since you are using fakemeta, there's no need for fun is there? Uc_handle + pev_maxspeed. There's also threads about this on the same forum, so search.
SnoW is offline
Send a message via MSN to SnoW
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 04-15-2009 , 08:42   Re: change the player speed
Reply With Quote #6

Quote:
Originally Posted by SnoW View Post
Since you are using fakemeta, there's no need for fun is there? Uc_handle + pev_maxspeed. There's also threads about this on the same forum, so search.
look like this:
https://forums.alliedmods.net/showpo...33&postcount=3
Anggara_nothing is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-15-2009 , 08:38   Re: change the player speed
Reply With Quote #7

Using native fun is more efficient than pev(). It doesn't matter the module used.
Arkshine is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-15-2009 , 08:48   Re: change the player speed
Reply With Quote #8

Quote:
Originally Posted by arkshine View Post
Using native fun is more efficient than pev(). It doesn't matter the module used.
Sure, if other plugins are using fun as well, so it can't be disabled.
In my last server I had cstrike, engine and fun disabled, though dunno if it would be better to make less native calls and more modules. But aye it's just me, so here fun's better, suposing he's using fun.
SnoW is offline
Send a message via MSN to SnoW
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 04-15-2009 , 08:55   Re: change the player speed
Reply With Quote #9

Quote:
Originally Posted by arkshine View Post
Using native fun is more efficient than pev(). It doesn't matter the module used.
are you can give me example code ??? please.
Anggara_nothing is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-15-2009 , 13:21   Re: change the player speed
Reply With Quote #10

Quote:
Originally Posted by Anggara_nothing View Post
are you can give me example code ??? please.
How about the code u linked, what's wrong with that?
SnoW is offline
Send a message via MSN to SnoW
Reply


Thread Tools
Display Modes

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 02:16.


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