Raised This Month: $ Target: $400
 0% 

detecting when a player spawns


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Anthraxnz
Senior Member
Join Date: May 2005
Location: New Zealand
Old 05-01-2006 , 23:06   detecting when a player spawns
Reply With Quote #1

how do i check for if a player has spawned yet?
theres client_spawn but that doesnt seem to work.
__________________
Dont know how to add admins?

use my program
http://www.amxmodx.org/forums/viewto...=129092#129092

it does the work for you ... sort of
Anthraxnz is offline
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 05-01-2006 , 23:29  
Reply With Quote #2

Code:
register_event("ResetHUD", "yourfunction", "be")   //calls a function, yourfunction, whenever you respawn

Use that.
__________________
GRR If only the amxmod programming were in Java.....
Java and C used to be two different languages, now Java is turning into another C. My logevent plugin
Batman/Gorlag is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 05-01-2006 , 23:38  
Reply With Quote #3

be aware that event can be called other ways. It is a good idea to have a check in place to make sure the player actually died first or the round ended.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 05-02-2006 , 05:07  
Reply With Quote #4

There is a better way: (VEN invented it if I remember correct)

Code:
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")

Mind that it is global.
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 05-02-2006 , 06:52  
Reply With Quote #5

Quote:
Originally Posted by MaximusBrood
There is a better way: (VEN invented it if I remember correct)

Code:
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")

Mind that it is global.
thats every new round though, not when a player spawns
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-02-2006 , 07:23  
Reply With Quote #6

And you should always make a delayed function. Here's a brief example:
Code:
#include <amxmodx> public plugin_init() {   register_plugin("test" , "0.1" , "v3x");   register_event("ResetHUD" , "event_ResetHUD" , "b"); } public event_ResetHUD(id)   set_task(0.1 , "delayed_ResetHUD" , id); public delayed_ResetHUD(id) {   if(is_user_alive(id)) // you don't need to check if the person is alive if you're just setting variables though   {     //   } }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 05-02-2006 , 08:34  
Reply With Quote #7

v3x: yes that is a good idea since there are lots of things where if they are done DURING resethud cause problems.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-02-2006 , 13:57  
Reply With Quote #8

I learned my lesson on that a while ago
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Kiloboban
New Member
Join Date: May 2006
Old 05-08-2006 , 21:32  
Reply With Quote #9

#include <CSX>

and 'client_spawn' will work xD
Kiloboban is offline
Send a message via MSN to Kiloboban
Smokey485
Senior Member
Join Date: Dec 2004
Location: Newt 'Ellin
Old 05-08-2006 , 22:14  
Reply With Quote #10

Note that ResetHUD happens twice most of the time(atleast with the specialists mod)
__________________
+karma if I am helpful to you.
I am one in a few million.
Smokey485 is offline
Send a message via AIM to Smokey485 Send a message via MSN to Smokey485
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:34.


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