Raised This Month: $ Target: $400
 0% 

API Scripting Help Check if is an user has respawned in zombie


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dreamedward
Senior Member
Join Date: Aug 2010
Location: ZombieWorld
Old 08-05-2011 , 16:53   Check if is an user has respawned in zombie
Reply With Quote #1

When Deathmatch mode is active in respawning only zombies how can i check after a user is killed if he has respawned into zombie and then the plugin to do a function.

Last edited by dreamedward; 08-05-2011 at 16:59.
dreamedward is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-06-2011 , 04:01   Re: Check if is an user has respawned in zombie
Reply With Quote #2

You can check on Ham Player spawn Post whether the player is a zombie or human.
Also try debugging with Ham_CS_RoundRespawn, i think it will mostly be called when ZP respawns the player.
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
dreamedward
Senior Member
Join Date: Aug 2010
Location: ZombieWorld
Old 08-06-2011 , 04:53   Re: Check if is an user has respawned in zombie
Reply With Quote #3

Maybe like this:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
 
public plugin_init()
{    
    
RegisterHam Ham_Spawn"player""fwdPlayerSpawn"true); 

public 
fwdPlayerSpawn(id

    if(
is_user_alive(id) && zp_get_user_zombie(id)) 
    { 
          Function...
    } 
    else if
    {
         return 
PLUGIN_HANDLED
    
}
 


Last edited by dreamedward; 08-06-2011 at 05:22.
dreamedward is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-06-2011 , 05:23   Re: Check if is an user has respawned in zombie
Reply With Quote #4

Quote:
Originally Posted by dreamedward View Post
Maybe like this:
PHP Code:
#include <amxmodx>
#include <hamsandwich>

public plugin_init()
{    
    
RegisterHam Ham_Spawn"player""fwdPlayerSpawn"true); 

public 
fwdPlayerSpawn(id

    if(
is_user_alive(id) && zp_get_user_zombie(id)) 
    { 
          Function...
    } 

Yes, if it doesnt work you can also add a little delay:
Code:
#include <amxmodx> #include <hamsandwich> public plugin_init() {         RegisterHam ( Ham_Spawn, "player", "fwdPlayerSpawn", true); } public fwdPlayerSpawn(id) {    set_task( 0.5, "function", id ) } public function( id ) {    if (is_user_alive(id) && zp_get_user_zombie(id))    {         // do something    } }
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
dreamedward
Senior Member
Join Date: Aug 2010
Location: ZombieWorld
Old 08-06-2011 , 05:41   Re: Check if is an user has respawned in zombie
Reply With Quote #5

Thanks!
dreamedward is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 08-06-2011 , 06:21   Re: Check if is an user has respawned in zombie
Reply With Quote #6

Just for info, in post #3 return in such cases when you're using a function from a module it's returns, so it would be return HAM_IGNORED and an else if isn't needed there.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
dreamedward
Senior Member
Join Date: Aug 2010
Location: ZombieWorld
Old 08-06-2011 , 07:21   Re: Check if is an user has respawned in zombie
Reply With Quote #7

Thanks for the info, bibu! :]
dreamedward is offline
DSASDFGH
Senior Member
Join Date: Jul 2011
Location: Facebook
Old 08-06-2011 , 11:06   Re: Check if is an user has respawned in zombie
Reply With Quote #8

thanks for usefully information 6^
DSASDFGH 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 09:11.


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