AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Freeze Code. (https://forums.alliedmods.net/showthread.php?t=99392)

lolzin123 08-04-2009 17:44

Freeze Code.
 
How to freeze the player per 10 seconds...

OBS: if use set_user_maxspeed when the player stwich the weapon your maxspeed set to default.

Arkshine 08-04-2009 17:47

Re: Freeze Code.
 
You can use : set_pev( id, pev_flags, pev( id, pev_flags ) | FL_FROZEN ); + set_task() to remove by doing : set_pev( id, pev_flags, pev( id, pev_flags ) & ~FL_FROZEN );

hleV 08-04-2009 17:52

Re: Freeze Code.
 
Code:
new g_IsFrozen[33];   public plugin_init()         register_event("CurWeapon", "CurWeapon", "be", "1=1");   public CurWeapon(Cl) {         static LastWeap[33];           if (g_IsFrozen[Cl] && LastWeap[Cl] != (LastWeap[Cl] = read_data(2)))                 set_user_maxspeed(Cl, 1.0); }   public Freeze(Cl) {         g_IsFrozen[Cl] = true;           set_task(10.0, "SetUnfrozen", Cl); }   public SetUnfrozen(Cl) {         g_IsFrozen[Cl] = false;           set_user_maxspeed(Cl, 250.0); // Could use a better way }
EDIT: Or use Arkshine's way instead of set_user_maxspeed().

ConnorMcLeod 08-04-2009 17:53

Re: Freeze Code.
 
Quote:

Originally Posted by hleV (Post 890357)
EDIT: Or use Arkshine's way instead of set_user_maxspeed().


lolzin123 08-05-2009 08:25

Re: Freeze Code.
 
Thanx man! :D


All times are GMT -4. The time now is 18:25.

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