Raised This Month: $51 Target: $400
 12% 

function on spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 02-25-2012 , 15:21   function on spawn
Reply With Quote #1

hello
I need the sshot function to be executed on player individual spawn (each normal respawn)
how can that be done?

Code:
public sshot( id ) {
    
    new szCID[32], szTimedata[9];
    get_time ( "%H:%M", szTimedata, 5 );
    get_user_authid( id, szCID, 31 );
        
    client_cmd( id, "snapshot; status" );
    client_print( id, print_chat, "Ehll - %s Snapshot has been taken at %s", szCID, szTimedata );
}

Last edited by vamppa; 02-25-2012 at 15:21.
vamppa is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 02-25-2012 , 15:40   Re: function on spawn
Reply With Quote #2

PHP Code:
RegisterHamHam_Spawn"player""fw_PlayerSpawn" ); 
PHP Code:
public fw_PlayerSpawnid )
{
    if( !
is_user_connectedid ) )
        return 
HAM_IGNORED;
    
// code...

__________________

Last edited by Neeeeeeeeeel.-; 02-25-2012 at 15:40.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 02-25-2012 , 16:07   Re: function on spawn
Reply With Quote #3

Wait, funcion is called if the player is connected , you didnt should check if player is alive ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 02-25-2012 , 16:09   Re: function on spawn
Reply With Quote #4

Quote:
Originally Posted by lucas_7_94 View Post
Wait, funcion is called if the player is connected , you didnt should check if player is alive ?
I forgot it, thanks.

PHP Code:
public fw_PlayerSpawnid )
{
    if( !
is_user_aliveid ) )
        return 
HAM_IGNORED;
    
// code...

Edit: Thx kramesa.
__________________

Last edited by Neeeeeeeeeel.-; 02-25-2012 at 17:39.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 02-25-2012 , 17:02   Re: function on spawn
Reply With Quote #5

You need check is user alive only on Ham_Spawn.
__________________
kramesa is offline
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 03-02-2012 , 18:32   Re: function on spawn
Reply With Quote #6

thank you, alright got it working.
how can I make it go through that code/function for each following respawn not just the 1st spawn?

Last edited by vamppa; 03-02-2012 at 18:33.
vamppa is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 03-02-2012 , 18:34   Re: function on spawn
Reply With Quote #7

Quote:
Originally Posted by vamppa View Post
how can I make it go through that code/function for each following respawn not just the 1st spawn?
It already does that, test it.
__________________
Hunter-Digital is offline
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 03-02-2012 , 18:57   Re: function on spawn
Reply With Quote #8

hm ok, it didn't work.
I've tested it with return Ham_handled and return 0;
is the mistake there or is it because it checks !is_user_alive
this is for death match based, not normal cs with rounds where one becomes status dead?

Last edited by vamppa; 03-02-2012 at 18:59.
vamppa is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 03-02-2012 , 19:29   Re: function on spawn
Reply With Quote #9

How are you respawning?

make sure its

ExecuteHamB
Doc-Holiday is offline
vamppa
Senior Member
Join Date: Apr 2010
Location: The Netherlands
Old 03-02-2012 , 19:54   Re: function on spawn
Reply With Quote #10

well just after you die, one presses fire(+attack) to respawn, otherwise if mp_forcerespawn is 1. you get respawned in 5sec automatically.
it is half-life deatmatch.
vamppa 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 11:26.


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