AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   constantly running (https://forums.alliedmods.net/showthread.php?t=22338)

Sonic7145 12-24-2005 14:38

constantly running
 
pruned

Brad 12-24-2005 14:44

Moved from Support/Help.

LynX 12-24-2005 15:08

Code:
server_frame() // fastest ingame loop

Code:
client_PreThink(id) // just A BIT faster then PostThink

Code:
client_PostThink(id)

Anyway, if you do something in all these 3 - you wont be dissapointed.

P.S.

They are forwards, so that means you have to use them like this

Code:
public oneOfThoseThreeForwards( ) { }

In PreThink and PostThink you can use
Code:
return plugin_continue // dont EVER, EVER use plugin_handled in PostTHink cause that blocks animations of user
, but NEVER RETURN ANYTHING in server frame

v3x 12-24-2005 15:10

Well, you could check his name inside of the client_infochanged forward.
Code:
public client_infochanged( id ) {   new name[33];   get_user_info(id, "name", name, 32);   if(equali(name, "v3x"))   {     client_print(id, print_chat, "zomg, you stole my name!");   } }

LynX 12-24-2005 15:11

Quote:

Originally Posted by v3x
Well, you could check his name inside of the client_infochanged forward.
Code:
public client_infochanged( id ) {   new name[33];   get_user_info(id, "name", name, 32);   if(equali(name, "v3x"))   {     client_print(id, print_chat, "zomg, you stole my name!");   } }

pwned by v3x... :)

Atti53 12-24-2005 15:27

:o

how to forbid more then 1 name??

teame06 12-24-2005 16:00

Quote:

Originally Posted by Atti53
:o

how to forbid more then 1 name??

Code:
public client_infochanged( id ) {   new name[33], oldname[33];   get_user_info(id, "name", name, 32);   get_user_name(id, oldname, 32);       if(equali(name, "v3x"))     {         set_user_info(id, "name", oldname)         client_print(id, print_chat, "zomg, you stole my name!");     }     else if(equali(name, "v3x2"))     {          set_user_info(id, "name", oldname)         client_print(id, print_chat, "zomg, you stole my name!");     } }

Cheap_Suit 12-24-2005 18:21

How would you do this with a switch statement?

Brad 12-24-2005 19:00

I don't believe you would. I don't think you can switch on strings.

At any rate, isn't there already a plugin that does exactly what Sonic wants?


All times are GMT -4. The time now is 15:53.

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