Raised This Month: $ Target: $400
 0% 

Freeze On\Off


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ozakong
Junior Member
Join Date: Oct 2010
Old 02-18-2013 , 13:23   Freeze On\Off
Reply With Quote #1

Hey Guys , i maked plugin that give all terror freeze ,
and there are many options . (2 secs,5 secs)
I dis do just 2 sec but its not working to me , after 2 secs.
Thats the code:

Code:
public plugin_init() {
register_clcmd("say !cd", "cd");
register_clcmd("say /cd", "cd");
}
public cd(id)
 {
    new menu = menu_create("\w[\r JailBreak Dream \w] : Count Down", "cd_hand");
    if (cs_get_user_team(id) == CS_TEAM_CT) {
    menu_additem(menu, "2", "1", 0);
    menu_additem(menu, "5", "2", 0);
    menu_additem(menu, "7", "3", 0);
    menu_additem(menu, "10", "4", 0);
   }
    menu_display(id, menu, 0);
 }

public cd_hand(id, menu, item)
{
static id2
    if( item == MENU_EXIT )
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }

    new data[6], szName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
    new secid = str_to_num(data);
    switch(secid) {
    case 1: {
  for (id2 = 1; id2 <= get_maxplayers(); id2++)  {
  Freeze(id2)
set_task(2.0, "UnFreeze", id2)
}
}
    }
    menu_destroy(menu);
    return PLUGIN_HANDLED;
}
Freeze( id ) 
{ 
    if( is_user_alive(id) ) 
    { 
        new iFlags = pev(id, pev_flags) 
        if( ~iFlags & FL_FROZEN ) 
        { 
            set_pev(id, pev_flags, iFlags | FL_FROZEN) 
        } 
    } 
} 

UnFreeze( ) 
{ 

static id
  for (id = 1; id <= get_maxplayers(); id++)  {
    if( is_user_alive(id) ) 
    { 
        new iFlags = pev(id, pev_flags) 
        if( iFlags & FL_FROZEN ) 
        { 
            set_pev(id, pev_flags, iFlags & ~FL_FROZEN) 
        } 
    } 
}
}
So what should i do .
please explain me about the error , i want learn for antoher mods in future.

Last edited by ozakong; 02-18-2013 at 13:27.
ozakong is offline
 



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 21:40.


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