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

Round start


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 09-25-2005 , 01:04   Round start
Reply With Quote #1

How would I make a plugin read when the round starts, so I can like "reset" it.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 09-25-2005 , 01:14  
Reply With Quote #2

Nevermind got it.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
smallwimpyboy
Senior Member
Join Date: Aug 2005
Location: United States
Old 09-25-2005 , 02:22  
Reply With Quote #3

are you sure?
smallwimpyboy is offline
Send a message via AIM to smallwimpyboy Send a message via MSN to smallwimpyboy
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 09-25-2005 , 03:24  
Reply With Quote #4

I was. Lol. Now that doesn't work. So I'm open to any help. Thanks.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Batman/Gorlag
Senior Member
Join Date: Aug 2005
Old 09-25-2005 , 03:31  
Reply With Quote #5

Code:
register_logevent("round_start", 2, "0=World triggered" "1=Round_Start") public round_start(){ //hahahahahIMDOINGSOMETHING HERE }
And if you want to know other log events then dl this plugin
This will help alot if you want your plugins to do certain things at certain LOG events. I hope I answered your question. Since you helped me with my server problem in the off-topic forum .
__________________
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
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 09-25-2005 , 10:26  
Reply With Quote #6

Ok, I'm still a little confused(just woke up)

I have it so when they type "/ninja" thei hp,ap,grav,footsteps, and rendering gets set to something new.

I want it so every new round the plugin gets turned off, and go back to normal, at the moment I have "turning it off" is just setting the same values, but to a normal state.

If that makes any sense, and you can help, I would love you forever.
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-25-2005 , 10:42  
Reply With Quote #7

yes it makes sense do what batman said


Code:
public plugin_init() {      register_logevent("round_start", 2, "0=World triggered" "1=Round_Start") } public round_start() {      for( i =1; i < get_maxplayers(); i++ ) {          if( !is_user_connected(i) ) continue            if( hasNinja[i] == true ) {               // ZOMG NO POWERS FOR YOU               // just reset everthing here             }        } }


hope that helps
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 09-25-2005 , 10:56  
Reply With Quote #8

Quote:
Originally Posted by Zenith77
yes it makes sense do what batman said


Code:
public plugin_init() {      register_logevent("round_start", 2, "0=World triggered" "1=Round_Start") } public round_start() {      for( i =1; i < get_maxplayers(); i++ ) {          if( !is_user_connected(i) ) continue            if( hasNinja[i] == true ) {               // ZOMG NO POWERS FOR YOU               // just reset everthing here             }        } }


hope that helps
Just as a note, get_maxplayers() is called each time the loop is engaged, with that script.

It would be better to do it this way:

Code:
new maxplayers = get_maxplayers(); for(new i = 0;i <= maxplayers;i++) {         // omfg }

EDIT:

Code:
if( !is_user_connected(i) ) continue

The hell? I think you mean

Code:
if(is_user_connected(i)) continue
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-25-2005 , 11:06  
Reply With Quote #9

no that just skips over a slot if no user is in it....
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 09-25-2005 , 11:12  
Reply With Quote #10

1 to "maxplayers". Not 0.
Code:
new maxplayers = get_maxplayers(); for(new i = 1;i <= maxplayers;i++) {         // omfg }
Further, get_players() can alleviate the need of cycling through all of the players, skipping those not connected.
Brad 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 08:01.


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