AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Round start (https://forums.alliedmods.net/showthread.php?t=18466)

Kensai 09-25-2005 01:04

Round start
 
How would I make a plugin read when the round starts, so I can like "reset" it.

Kensai 09-25-2005 01:14

Nevermind got it.

smallwimpyboy 09-25-2005 02:22

are you sure?

Kensai 09-25-2005 03:24

I was. Lol. Now that doesn't work. So I'm open to any help. Thanks.

Batman/Gorlag 09-25-2005 03:31

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 :D .

Kensai 09-25-2005 10:26

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.

Zenith77 09-25-2005 10:42

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 :)

Hawk552 09-25-2005 10:56

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

Zenith77 09-25-2005 11:06

no that just skips over a slot if no user is in it....

Brad 09-25-2005 11:12

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.


All times are GMT -4. The time now is 11:40.

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