Raised This Month: $51 Target: $400
 12% 

Stop players and 15 seconds to resume


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Administrator
Member
Join Date: Jun 2014
Old 07-26-2014 , 07:27   Stop players and 15 seconds to resume
Reply With Quote #1

Hi.
Prompt why players do not stop?

PHP Code:
new g_Timer 15 
PHP Code:
public plugin_init()
{
set_task(15.5"frozen")

PHP Code:
public frozen()
{
g_Timer -= 1
new g_Tume g_Timer -= 1
if(g_Tume >= 1)
{
set_hudmessage(25500, -1.0, -1.006.01.0)
show_hudmessage(0"You will be able to move after: %d"g_Tume)
set_task(1.0"frozen")
set_user_maxspeed(00.0)
}
else
{
un_frozen()
}
}

public 
un_frozen()
{
set_user_maxspeed(0300.0)
client_print(0print_chat,"unfrozen")


Last edited by Administrator; 07-26-2014 at 07:28.
Administrator is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-26-2014 , 08:23   Re: Stop players and 15 seconds to resume
Reply With Quote #2

You can use this to freeze players:

PHP Code:
UTIL_FreezePlayer index value 
{
    if (!
is_user_alive(id))
    {
        return;
    }
    
    new 
Flags pev(index pev_flags);
    
    if (
value && !(Flags FL_FROZEN))
    {
        
set_pev(indexpev_flags, (Flags FL_FROZEN));
    }        
    
    else if (!
value && (Flags FL_FROZEN))
    {
        
set_pev(indexpev_flags, (Flags &~ FL_FROZEN));
    }

UTIL_FreezePlayer(id , 1) freeze a player. UTIL_FreezePlayer(id, 0) unfreeze it.

About your code, set the speed to 0.1 if you want to stop them from moving. Setting to 0.0 let them move normally.

Last edited by HamletEagle; 07-26-2014 at 08:24.
HamletEagle is offline
Administrator
Member
Join Date: Jun 2014
Old 07-26-2014 , 08:30   Re: Stop players and 15 seconds to resume
Reply With Quote #3

Thanks!
Administrator 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 19:44.


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