Raised This Month: $ Target: $400
 0% 

Freeze Players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-11-2013 , 08:11   Freeze Players
Reply With Quote #1

PHP Code:
for(new icounti++) {
        
set_user_maxspeed(players[i], -1.0)
        
set_task(11.0"RemoveFreeze"players[i])
    } 
What i'm trying to do is freeze the players, but it ain't working... I just keep frozen after those 11 seconds...
PHP Code:
public RemoveFreeze(id) {
    if(
is_user_alive(id)) {
        
set_user_maxspeed(id)
    }

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-11-2013 , 08:17   Re: Freeze Players
Reply With Quote #2

Use FL_FROZEN with pev_flags.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 05-11-2013 , 08:18   Re: Freeze Players
Reply With Quote #3

There are better ways for freezing a player, Take a look at: https://forums.alliedmods.net/showthread.php?p=1262605
EpicMonkey is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-11-2013 , 08:23   Re: Freeze Players
Reply With Quote #4

how to unfreeze using set_pev?
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-11-2013 , 08:30   Re: Freeze Players
Reply With Quote #5

Freeze:
Code:
set_pev( id, pev_flags, pev( id, pev_flags ) | FL_FROZEN );
Unfreeze:
Code:
set_pev( id, pev_flags, pev( id, pev_flags ) & ~FL_FROZEN );
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-11-2013 , 08:32   Re: Freeze Players
Reply With Quote #6

Quote:
Originally Posted by hornet View Post
Freeze:
Code:
set_pev( id, pev_flags, pev( id, pev_flags ) | FL_FROZEN );
Unfreeze:
Code:
set_pev( id, pev_flags, pev( id, pev_flags ) & ~FL_FROZEN );
Thanks, will try it
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-11-2013 , 08:39   Re: Freeze Players
Reply With Quote #7

still doesn't work....

PHP Code:
public Cmdround(id)
{
    if (
task_exists(TASKID))
        
remove_task(TASKID)
    
    
set_hudmessage(25500, -1.00.000.114.00.11.01)
    
show_hudmessage(0"[HideNseeK]")
    
    
Timer 10
    set_task
(1.0"Cmdcountdown"TASKID__"a"Timer)
    
    new 
players[32], count
    get_players
(playerscount"ae""CT")
    
    for(new 
icounti++) {
        
set_pev(idpev_flagspev(ipev_flags) | FL_FROZEN
        
set_task(11.0"RemoveFreeze"players[i])
    }
    
    
get_players(playerscount"ae""TERRORIST")
    
    for(new 
icounti++) {
        
strip_user_weapons(players[i])
    }
}

public 
Cmdcountdown(id)
{
    
Timer--
    
    if (
Timer 0)
    {
        
set_hudmessage(255255255, -1.00.0300.11.00.10.12)
        
show_hudmessage(0"%i"Timer)
    }
    else
    {
        
set_hudmessage(255255255, -1.00.0300.13.00.11.03)
        
show_hudmessage(0"Ready or not, here we come!")
        new 
players[32], count
        get_players
(playerscount"ae""CT")
        
        for(new 
icounti++) {
            
set_task(2.0"StripWeapons"players[i])
        }
    }
}

public 
RemoveFreeze(id) {
    if(
is_user_alive(id)) {
        
set_pev(idpev_flagspev(idpev_flags) & ~FL_FROZEN)
    }

PHP Code:
register_logevent("Cmdround"2"1=Round_Start"
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-11-2013 , 09:07   Re: Freeze Players
Reply With Quote #8

Quote:
Originally Posted by Napoleon_be View Post
still doesn't work....
Wow, you still don't know how to use get_players
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-11-2013 , 09:05   Re: Freeze Players
Reply With Quote #9

Code:
public Cmdround(id) {     if (task_exists(TASKID))         remove_task(TASKID)         set_hudmessage(255, 0, 0, -1.0, 0.0, 0, 0.1, 14.0, 0.1, 1.0, 1)     show_hudmessage(0, "[HideNseeK]")         Timer = 10     set_task(1.0, "Cmdcountdown", TASKID, _, _, "a", Timer)         new players[32], count     get_players(players, count, "ae", "CT")         for(new i; i < count; i++) {         set_pev(players[ i ], pev_flags, pev(i, pev_flags) | FL_FROZEN) // you still had id here instead of players[ i ]         set_task(11.0, "RemoveFreeze", players[i])     }         get_players(players, count, "ae", "TERRORIST")         for(new i; i < count; i++) {         strip_user_weapons(players[i])     } } public Cmdcountdown(id) {     Timer--         if (Timer > 0)     {         set_hudmessage(255, 255, 255, -1.0, 0.03, 0, 0.1, 1.0, 0.1, 0.1, 2)         show_hudmessage(0, "%i", Timer)     }     else     {         set_hudmessage(255, 255, 255, -1.0, 0.03, 0, 0.1, 3.0, 0.1, 1.0, 3)         show_hudmessage(0, "Ready or not, here we come!")         new players[32], count         get_players(players, count, "ae", "CT")                 for(new i; i < count; i++) {             set_task(2.0, "StripWeapons", players[i])         }     } } public RemoveFreeze(id) {     if(is_user_alive(id)) {         set_pev(id, pev_flags, pev(id, pev_flags) & ~FL_FROZEN)     } }
__________________
Blizzard_87 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-11-2013 , 09:08   Re: Freeze Players
Reply With Quote #10

-.^ Whats this:
Code:
set_pev(id, pev_flags, pev(i, pev_flags) | FL_FROZEN)
You didn't use the players array
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 05-11-2013 at 09:09.
hornet 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 16:14.


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