AlliedModders

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

v3x 02-18-2005 21:12

Getting round start
 
Hey, how can I return a value when the round is started?

knekter 02-18-2005 22:49

try this
 
Alot of people like to user ResetHud, but personally the REAL event is this:

Code:
register_logevent("restart_event", 2, "1=Round_Start")

Enjoy :)

v3x 02-18-2005 23:14

So..

Code:
new round = register_logevent("restart_event", 2, "1=Round_Start") if(round == 1) { // do something }

Also, how do I make a player freeze for the same amount of time as the freeze time?

knekter 02-18-2005 23:54

lol NOOOOOOOOO! lol.... THIS:

Code:
public plugin_init() {     register_logevent("restart_event", 2, "1=Round_Start") } public restart_event() {     add code here }

v3x 02-18-2005 23:57

LOL, oops! What about my other :?:

PS: Ignore me, I'm an AMXX noob! :lol:

XxAvalanchexX 02-19-2005 12:16

Hehe, v3x, making the switch from PHP to Small. And now go back and forget all your $ symbols!

Anyway, you can use get_cvar_float("mp_freezetime") to get how long the freezetime is, then you could use set_user_maxspeed(id,1.0) to freeze them, use set_task with the amount of time from the freezetime to set a task that sets their maxspeed back to 320.0.

v3x 02-19-2005 19:00

Quote:

Originally Posted by XxAvalanchexX
Hehe, v3x, making the switch from PHP to Small. And now go back and forget all your $ symbols!

Anyway, you can use get_cvar_float("mp_freezetime") to get how long the freezetime is, then you could use set_user_maxspeed(id,1.0) to freeze them, use set_task with the amount of time from the freezetime to set a task that sets their maxspeed back to 320.0.

Good idea, but my noob ass doesn't know how to do that, lol. :lol:

XxAvalanchexX 02-19-2005 19:57

Have you read any of the tutorials? There is a big sticky topic in the Scripting Help forum.

v3x 02-19-2005 20:23

Code:
new bool:speed = true public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("CurWeapon", "check_speed", "be")     register_cvar("sv_knifespeed", "410.0")     register_cvar("sv_c4speed", "410.0")     register_cvar("sv_awpspeed", "320.0")     register_logevent("new_round",2,"1=Round_Start") } public new_round() {     new ft = get_cvar_num("mp_freezetime")     set_task(float(ft), "allow_speed", 0)     return PLUGIN_CONTINUE } public allow_speed() {     speed = true     return PLUGIN_CONTINUE } public check_speed(id) {     if(speed == false)         return PLUGIN_CONTINUE     new clip, ammo     new weapon = get_user_weapon(id, clip, ammo)     switch (weapon) {         case CSW_KNIFE: set_user_maxspeed(id,(get_cvar_float("sv_knifespeed")))         case CSW_C4: set_user_maxspeed(id,(get_cvar_float("sv_c4speed")))         case CSW_AWP: set_user_maxspeed(id,(get_cvar_float("sv_awpspeed")))     }     return PLUGIN_CONTINUE }
But it still doesn't work! :(

XxAvalanchexX 02-20-2005 00:52

You never set speed to false...


All times are GMT -4. The time now is 14:04.

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