AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Timed command for each round (https://forums.alliedmods.net/showthread.php?t=92829)

TitANious 05-20-2009 15:57

Timed command for each round
 
I just want a command (say /WMenu) for a specific time, how would that be the best way to solve?
PHP Code:

//////////////////////////////////////////

////////            //////////

///////*    Description    */////////

////////            //////////

//////////////////////////////////////////
/*
//            WESTERN MOD!
// Heroes
* You have a possibility to choose 8 heroes thats the following:
* "Lucky Luke:"
* "He has an AWP, Deagle and faster run speed."
* "Billy the Kid:"
* "He have a g3sg1 a p228 and lower gravity"
* "Clint Eastwood:"
* "He got a sg550, dual elites and more armor"
* "Johnny Thunder:"
* "He have a scout, a glock18 and more health"
* "Pow Wow Smith"
* "He have a m3, a usp, more health, more armor, but lower  speed"
* "Warren Olney"
* "He have a xm1014, a fiveseven, more health, more armor, but lower speed"
* "Charlie Nader"
* "He got a glock18, all nades and faster speed "
* "Chilli NoSee"
* "He have no footsteps, faster runspeed and you can nearly not see him, a perfect assassin"
*/

// What have i removed?
/*
* I have removed buyzone, and i strips all weapons when you choose a hero and give some abiltys.
*/

// Commands
/*
* Say /WMenu to get Western Menu up
*/

////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////

////////            //////////

///////*    Pcvars        */////////

////////            //////////

//////////////////////////////////////////

/*        
*    Pcvars!
*    "amx_western_mod"     =     "1"         (On or off)
*    "WM_LLMS"         =     "300.0"     (Lucky Luke Maxspeed)                    *
*    "WM_BKidG"         =     "0.6"        (Billy the Kid gravity)                    *
*    "WM_CEarmor"        =    "255"        (Clint Eastwoods armor)                    *
*    "WM_JThealth"         =    "255"        (Johnny Thunder health)                    *
*    "WM_PShealth"         =    "255"        (Pow Wow Smiths health)                    *
*    "WM_PSarmor"         =    "255"        (Pow Wow Smiths armor)                    *
*    "WM_PSMS"         =    "200"        (Pow Wow Smiths maxspeed)                *
*    "WM_WOhealth"         =    "255"        (Warren Olneys health)                    *
*    "WM_WOarmor"         =    "255"        (Warren Olneys armor)                    *
*    "WM_WOMS"         =    "200"        (Warren Olneys maxspeed)                *
*    "WM_NaderMS"         =    "310"        (Chalie Naders maxspeed)                *
*    "WM_NoSeeFS"         =    "1"        (Chilli NoSees footsteps)                *
*    "WM_NoSeeInvisible"     =    "30"        (Chilli NoSees Invisiblety)                *
*    "WM_NoSeeHealth"     =    "150"        (Chilli NoSees health)                    *
*    "amx_gamename"        =    "Western Mod by One and TitANious" (You can add here what you want in hud)*
*    "amx_hudhelp"        =    "1"        (Enabled if you want to show^)                *
*/
////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////

////////            //////////

///////*    Changelog    */////////

////////            //////////

//////////////////////////////////////////

/*
* [1.0] The release of Western Mod
*/

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////

////////              ////////////

///////*    Credits       *///////////

////////              ////////////

////////////////////////////////////////////

/*
* TitANious     -    For making the most code
* One         -    For the most msg, main idea, models
* ConnorMcLeod    -    For stripping without c4 bomb
* Milord (quim)    -    Helping with som constant, i hope it would be faster now 
*
* Of Course some more
*/

////////////////////////////////////////////////////////////////////////////////////////////////////
                            
////////*    Includes    */////////

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich> 
#include <amxmisc>

///////*    Defines        */////////

#define TASK_MENU_DISLPAY_TIME 3.0
#define OFFSET_PRIMARYWEAPON    116
#define OFFSET_C4_SLOT        372

///////*    Pcvar News    */////////

new g_EnablegCvarLLMSgCvarBKidGgCvarCEarmorgCvarJThealth
gCvarPShealthgCvarPSarmorgCvarPSMSgCvarWOhealthgCvarWOarmor
gCvarWOMSgCvarNaderMSgCvarNoSeeFSgCvarNoSeeInvisiblegCvarNoSeeHealth
g_GameNamegCvarLuckyLukegCvarBillytheKidgCvarClintEastwoodgCvarJohnnyThunder
gCvarPowWowSmithgCvarWarrenOlneygCvarCharlieNadergCvarChilliNoSeegCvarMenuOpen,
gCvarCEhealth;

///////*    Other News    */////////

new g_bJustConnected[33];
new 
g_Hudhelp;
new 
g_MaxPlayers;

///////*    Constants    */////////

// Constant For Weapons

new WEAPONS[] = 
{
    
CSW_P228,CSW_SCOUT,CSW_XM1014,CSW_ELITE,CSW_FIVESEVEN,CSW_SG550,CSW_USP,CSW_GLOCK18,CSW_AWP,
    
CSW_M3,CSW_G3SG1,CSW_G3SG1,CSW_DEAGLE,CSW_KNIFE,CSW_HEGRENADE,CSW_SMOKEGRENADE,CSW_FLASHBANG
}

new 
iWeapBits

// Constant for Custom Models

new const CUSTOM_MODELS[33][] =
{
    
"",
    
"models/WesternMod/v_p228.mdl",
    
"",
    
"models/WesternMod/v_scout.mdl",
    
"models/WesternMod/v_hegrenade.mdl",
    
"models/WesternMod/v_xm1014.mdl",
    
"",
    
"",
    
"",
    
"models/WesternMod/v_smokegrenade.mdl",
    
"models/WesternMod/v_elite.mdl",
    
"models/WesternMod/v_fiveseven.mdl",
    
"",
    
"models/WesternMod/v_sg550.mdl",
    
"",
    
"",
    
"models/WesternMod/v_usp.mdl",
    
"models/WesternMod/v_glock18.mdl",
    
"models/WesternMod/v_awp.mdl",
    
"",
    
"",
    
"models/WesternMod/v_m3.mdl",
    
"",
    
"",
    
"models/WesternMod/v_g3sg1.mdl",
    
"models/WesternMod/v_flashbang.mdl",
    
"models/WesternMod/v_deagle.mdl",
    
"",
    
"",
    
"models/WesternMod/v_knife.mdl",
    
"",
    
"",
    
""
};


///////*    Precache Models     */////

public plugin_precache()
{
    
g_Enable register_cvar("amx_western_mod""1");

    if(
get_pcvar_num(g_Enable))
    {
        for(new 
i=0;i<sizeof WEAPONS;i++)
        {
            
precache_model(CUSTOM_MODELS[WEAPONS[i]])
            
iWeapBits |= << WEAPONS[i]
        }
        
        
///////*    Precache Buyzone     *////

        
RegisterHam(Ham_Spawn,"func_buyzone","buyZoneSpawn"
    }
}

///////*    Register Plugin      *//////

public plugin_init()
{
///////* Register random stuff     *////

    // Register plugin
    
register_plugin("Western Mod""1.0""One/TitANious");
    
    
// The game description
    
register_forward(FM_GetGameDescription,"fw_GameDesc");
    
    
// The task for Hud Help Message
    
set_task(1.0"mod_ihelp"0""0"b");
    
    
// Register the menu
    
register_menucmd(register_menuid("Menu"), 1023"We_Menu");
    
    
// The Help MOTD
    
register_clcmd("say /help""help_motd");
    
    
// Again Help MOTD just in say_team
    
register_clcmd("say_team /help""help_motd");
    
    
// Registering the model
    
register_event("CurWeapon""Event_CurWeapon""be""1=1");
    
    
// Blocking drop
    
register_clcmd("drop""blockDrop")
    
    
// You can't pick things up, except c4 bomb
    
register_forward(FM_Touch,"fwTouch"); 
    
    
// Get maxplayers
    
g_MaxPlayers get_maxplayers();
    
    
// Command to the Western Menu
    
register_clcmd("say /WMenu""cmdWMenu");
    
    
register_clcmd("say_team /WMenu""cmdWMenu");
    
    
register_clcmd("say /wmenu""cmdWMenu");
    
    
register_clcmd("say_team /wmenu""cmdWMenu");
    
    
// Task for menu
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
    
    
///////*    Register Pcvars        */////

    // For Enable
    
g_Enable register_cvar("amx_western_mod""1");
    
    
// Lucky Luke
    
gCvarLuckyLuke register_cvar("WM_LuckyLuke""1")
    
    
// For Lucky Luke Maxspeed
    
gCvarLLMS register_cvar("WM_LLMS""300.0")
    
    
// Billythekid
    
gCvarBillytheKid register_cvar("WM_BillytheKid""1")
    
    
// For Billy the Kids Gravity
    
gCvarBKidG register_cvar("WM_BKidG""0.6")
    
    
// Clint Eastwood
    
gCvarClintEastwood register_cvar ("WM_ClintEastwood""1")
    
    
// For Clint Eastwoods armor
    
gCvarCEarmor register_cvar("WM_CEarmor""255")
    
    
// For Clint Eastwoods health
    
gCvarCEhealth register_cvar("WM_CEhealth""75")
    
    
// Johnny Thunder
    
gCvarJohnnyThunder register_cvar("WM_JohnnyThunder""1")
    
    
// For Johnny Thunder health
    
gCvarJThealth register_cvar("WM_JThealth""255")
    
    
// Pow Wow Smith
    
gCvarPowWowSmith register_cvar("WM_PowWowSmith""1")
    
    
// For Pow Wow Smith health
    
gCvarPShealth register_cvar("WM_PShealth""255")
    
    
// For Pow Wow Smith armor
    
gCvarPSarmor register_cvar("WM_PSarmor""255")
    
    
// For Pow Wow Smith maxspeed
    
gCvarPSMS register_cvar("WM_PSMS""200")
    
    
// Warren Olney
    
gCvarWarrenOlney register_cvar("WM_WarrenOlney""1")
    
    
// For Warren Olneys health
    
gCvarWOhealth register_cvar("WM_WOhealth""255")
    
    
// For Warren Olneys armor
    
gCvarWOarmor register_cvar("WM_WOarmor""255")
    
    
// For Warren Olneys maxspeed
    
gCvarWOMS register_cvar("WM_WOMS""200")
    
    
// Charlie Nader
    
gCvarCharlieNader register_cvar("WM_CharlieNader""1")
    
    
// For Charlie Naders maxspeed
    
gCvarNaderMS register_cvar("WM_NaderMS""310")
    
    
// Chilli NoSee
    
gCvarChilliNoSee register_cvar("WM_ChilliNoSee""1")
    
    
// For Chilli NoSees footstep
    
gCvarNoSeeFS register_cvar("WM_NoSeeFS""1")
    
    
// Chilli NoSees invisiblety
    
gCvarNoSeeInvisible register_cvar("WM_NoSeeInvisible""30")
    
    
// For Chilli NoSees health
    
gCvarNoSeeHealth register_cvar("WM_NoSeeHealth""150")
    
    
// For the gamename, which is in the right cornor
    
g_GameName register_cvar("amx_gamename""Western Mod by One and TitANious");
    
    
// Should the help hud be there?
    
g_Hudhelp register_cvar("amx_hudhelp""1");
    
    
// Menu Method
    
gCvarMenuOpen register_cvar("WM_MenuMethod""0");
    
}

///////*    Say command for menu *///////

public cmdWMenu(id)
{
    if(
get_pcvar_num(gCvarMenuOpen) == 1)
        return 
PLUGIN_HANDLED
        
    
if(get_pcvar_num(gCvarMenuOpen) == 0)
    {
        
set_task(TASK_MENU_DISLPAY_TIME"choose_menu");
    }
    return 
PLUGIN_CONTINUE
}

///////*    Client connect    */////////

public client_putinserver(id)
{
        
g_bJustConnected[id] = true
}

///////*    Connect+Menu    */////////
 
public fnFunction(id)
{
    if(
get_pcvar_num(gCvarMenuOpen) == 0)
    {
        
// Check if player has just connected
        
if (g_bJustConnected[id])
        {
            
// Player has just connected, set the task
            
set_task(TASK_MENU_DISLPAY_TIME"choose_menu"id);
 
            
// Now set that player is no longer "just connected"
            
g_bJustConnected[id] = false;
        }    
    }
}

///////*    Removal of Buyzone     */////////

public buyZoneSpawn(id)
{
    return 
HAM_SUPERCEDE;
}  

///////*    You cant pick weapons up!   *////

public fwTouchent id )
{
    if ( !( 
<= id <= g_MaxPlayers ) || !pev_valident ) || !( pevent pev_flags ) & FL_ONGROUND ) )
        return 
FMRES_IGNORED;
    
    
//This will block picking up all weapons except backpack (c4)

    
static szEntModel[32];
    
pevent pev_model szEntModel 31 );
    
    return 
equalszEntModel "models/w_backpack.mdl" ) ? FMRES_IGNORED FMRES_SUPERCEDE
}  

///////*    Blocking drop    */////////

public blockDrop() 
    return 
PLUGIN_HANDLED

///////*    Strips weapons    */////////

StripUserWeapons(id)
{
    
set_user_footsteps(id1)
    
set_user_rendering(id,kRenderFxGlowShell,0,00,kRenderTransAlpha255);
    new 
iC4Ent get_pdata_cbase(idOFFSET_C4_SLOT)
    if( 
iC4Ent )
    {
        
set_pdata_cbase(idOFFSET_C4_SLOTFM_NULLENT)
    }

    
strip_user_weapons(id)
    
set_pdata_int(idOFFSET_PRIMARYWEAPON0)

    if( 
iC4Ent )
    {
        
entity_set_int(idEV_INT_weaponsentity_get_int(idEV_INT_weapons) | (1<<CSW_C4))
        
set_pdata_cbase(idOFFSET_C4_SLOTiC4Ent)
        
cs_set_user_bpammo(idCSW_C41)
        
cs_set_user_plant(id1)
    }
    return 
PLUGIN_HANDLED
}

///////*    Models        */////////

public Event_CurWeapon(id)
{
    new 
iWeapon read_data(2);
    
    if( 
pev_validid ) && ( iWeapBits & ( << iWeapon ) ) )
    
set_pevid pev_viewmodel2 CUSTOM_MODELS[iWeapon] );
}  

///////*    Cfg File    */////////

public plugin_cfg()
{
    if(
get_pcvar_num(g_Enable) == 0)
        return 
PLUGIN_HANDLED;

    new 
configsDir[32],file[192];
    
get_configsdir(configsDirsizeof configsDir 1);
    
formatex(file,sizeof file 1,"%s/western.cfg",configsDir);
    
    if(
file_exists(file))
    {
        
server_cmd("exec %s"file);
    }
    else
    {
        
log_amx("####################################");
        
log_amx("[ERROR] western.cfg not Found!");
        
log_amx("####################################");
    }

    return 
PLUGIN_CONTINUE;
}

///////*    Task for menu        *///////

public fwHamPlayerSpawnPost(id)
{
    if(
get_pcvar_num(g_Enable) == 0)
        return 
HAM_SUPERCEDE;
        
    if(
get_pcvar_num(gCvarMenuOpen) == 1)
    {
        
set_task(TASK_MENU_DISLPAY_TIME"choose_menu"id);

        return 
HAM_IGNORED;
    }
    return 
HAM_IGNORED
}

///////*    Things for the menu     *//////

public choose_menu(id)
{        
    if((
get_pcvar_num(g_Enable) == 0) && is_user_alive(id) && is_user_bot(id) && is_user_hltv(id))
    return 
HAM_SUPERCEDE;
    
    new 
menu menu_create("\rChoose the Hero!""We_Menu")
        
    if(
get_pcvar_num(gCvarLuckyLuke))
    {
        
menu_additem(menu"\wLucky Luke""1"0)
    }
    if(
get_pcvar_num(gCvarBillytheKid))
    {
        
menu_additem(menu"\wBilly the Kid""2"0)
    }
    if(
get_pcvar_num(gCvarClintEastwood))
    {
        
menu_additem(menu"\wClint Eastwood""3"0)
    }
    if(
get_pcvar_num(gCvarJohnnyThunder))
    {
        
menu_additem(menu"\wJohnny Thunder""4"0)
    }
    if(
get_pcvar_num(gCvarPowWowSmith))
    {
        
menu_additem(menu"\wPow Wow Smith""5"0)
    }
    if(
get_pcvar_num(gCvarWarrenOlney))
    {
        
menu_additem(menu"\wWarren Olney""6"0)
    }
    if(
get_pcvar_num(gCvarCharlieNader))
    {
        
menu_additem(menu"\wCharlie Nader""7"0)
    }
    if(
get_pcvar_num(gCvarChilliNoSee))
    {
        
menu_additem(menu"\wChilli NoSee""8"0)
    }
    
menu_setprop(menuMPROP_EXITMEXIT_NEVER); 
    
menu_display(idmenu0)
    return 
PLUGIN_HANDLED;
}  

///////*    The menu    */////////

public We_Menu(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
set_task(TASK_MENU_DISLPAY_TIME"choose_menu"id);
        return 
PLUGIN_HANDLED
    
}

    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)
    new 
key str_to_num(data)
    switch(
key
    {
        case 
1:/*     Lucky Luke    */  
        

            
// Stip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife" )
            
            
// AWP
            
give_item id"weapon_awp" )
            
cs_set_user_bpammoidCSW_AWP30 );  
            
            
// Deagle
            
give_item id"weapon_deagle")
            
cs_set_user_bpammoidCSW_DEAGLE35 );  
            
            
// Costum abilitys
            
set_user_maxspeed(idget_pcvar_float(gCvarLLMS));
                    
            
// Message
            
client_print(idprint_chat,"You are now Lucky Luke.");
        }
        case 
2:/*    Billy the Kid    */
        
{    
            
/// Strip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife")
            
            
// G3SG1
            
give_item id"weapon_g3sg1")
            
cs_set_user_bpammoidCSW_G3SG160 );  
            
            
// P228
            
give_item id"weapon_p228")
            
cs_set_user_bpammoidCSW_P22852 );  
            
            
// Custom abilitys
            
set_user_gravity idget_pcvar_float(gCvarBKidG));
                
            
// Message
            
client_print(idprint_chat,"You are now Billy the Kid.");
        }
        case 
3:/*    Clint Eastwood    */
        
{
            
// Strip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife" )
            
            
// SG550
            
give_item id"weapon_sg550");
            
cs_set_user_bpammoidCSW_SG55050 );  
            
            
// Dual elite
            
give_item id"weapon_elite")
            
cs_set_user_bpammoidCSW_ELITE120 );  
            
            
// Custom abilitys
            
set_user_armoridget_pcvar_num(gCvarCEarmor));
            
set_user_healthidget_pcvar_num(gCvarCEhealth));
                        
            
// Message
            
client_print(idprint_chat,"You are now Clint Eastwood.");
        }
        case 
4:/*    Johnny Thunder    */
        
{
            
// Strip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife" )
            
            
// Scout
            
give_item id"weapon_scout" )
            
cs_set_user_bpammoidCSW_SCOUT90 );  
            
            
// Glock18
            
give_item id"weapon_glock18")
            
cs_set_user_bpammoidCSW_GLOCK1890 );  
            
            
// Custom abilitys
            
set_user_healthidget_pcvar_num(gCvarJThealth));
            
            
// Message
            
client_print(idprint_chat,"You are now Johnny Thunder.");
        }
        case 
5:/*    Pow Wow Smith    */
        
{
            
// Strip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife" )
            
            
// M3
            
give_item id"weapon_m3")
            
cs_set_user_bpammoidCSW_M350 );  
            
            
// USP
            
give_item id"weapon_usp")
            
cs_set_user_bpammoidCSW_USP100 );  
            
            
// Custom abilitys
            
set_user_armoridget_pcvar_num(gCvarPShealth));
            
set_user_healthidget_pcvar_num(gCvarPSarmor));
            
set_user_maxspeed(idget_pcvar_float(gCvarPSMS));
            
            
// Message
            
client_print(idprint_chat,"You are now Pow Wow Smith.");
        }
        case 
6:/*    Warren Olney    */
        
{
            
// Strip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife" )
            
            
// XM1014
            
give_item id"weapon_xm1014")
            
cs_set_user_bpammoidCSW_XM101450 );  
            
            
// Fiveseven
            
give_item id"weapon_fiveseven")
            
cs_set_user_bpammoidCSW_FIVESEVEN50 );  

            
// Custom abilitys
            
set_user_armoridget_pcvar_num(gCvarWOarmor));
            
set_user_healthidget_pcvar_num(gCvarWOhealth));
            
set_user_maxspeed(idget_pcvar_float(gCvarWOMS));
                    
            
// Message
            
client_print(idprint_chat,"You are now Warren Olney.");
        }
        case 
7:/*    Charlie Nader    */
        
{
            
// Strip weapons
            
StripUserWeapons(id)
            
            
// knife
            
give_item id"weapon_knife")
            
            
// Glock18
            
give_item id"weapon_glock18")
            
cs_set_user_bpammoidCSW_GLOCK1850 );  
            
            
// Flashbang
            
give_item id"weapon_flashbang" )
            
give_item id"weapon_flashbang" )
            
            
// High Explosive grenade
            
give_item id"weapon_hegrenade" )
            
            
// Smoke grenade
            
give_item id"weapon_smokegrenade" )
            
            
// Custom ablitys
            
set_user_maxspeed idget_pcvar_float(gCvarNaderMS));
                    
            
// Message
            
client_print(idprint_chat,"You are now Charlie Nader.");
        }
        case 
8:/*    Chilli NoSee    */
        
{
            
// Strip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife" 
            
            
// Custom abilitys
            
set_user_rendering(id,kRenderFxGlowShell,0,00,kRenderTransAlpha,get_pcvar_num(gCvarNoSeeInvisible)); 
            
set_user_footsteps idget_pcvar_num(gCvarNoSeeFS));
            
set_user_health idget_pcvar_num(gCvarNoSeeHealth))
                    
            
// Message
            
client_print(idprint_chat,"You are now Chilli NoSee.");
        }
    }
    return 
PLUGIN_HANDLED;
}

///////*    Game Description    */////

public fw_GameDesc()
{
    if(
get_pcvar_num(g_Enable) == 0)
        return 
FMRES_IGNORED;

    new 
gamename[32];
    
get_pcvar_string(g_GameNamegamename31);
    
forward_return(FMV_STRINGgamename);

    return 
FMRES_SUPERCEDE;
}    

///////*    Hud Message    */////////

public mod_ihelp()
{
    if(
get_pcvar_num(g_Hudhelp) == 1)
    {
        
set_hudmessage(255,255,255,0.75,0.05,01.01.00.10.213);
        
show_hudmessage(0"This server is running Western Mod 1.0 by TitANious and One^nType /help to know more!");
    }
    return 
PLUGIN_CONTINUE;
}

///////*    MOTD Help    */////////

public help_motd(id)
{
    const 
SIZE 1024;
    new 
msg[SIZE+1],len 0;
    
len += formatex(msg[len], SIZE len"<html><body style=^"background-color:yellow;color:blue;font-size:16^"");
    
len += formatex(msg[len], SIZE len"Choose a hero<br>");
    
len += formatex(msg[len], SIZE len"Lucky Luke:<br>");
    
len += formatex(msg[len], SIZE len"He has an AWP, Deagle and faster run speed.<br>");    
    
len += formatex(msg[len], SIZE len"Billy the Kid:<br>");
    
len += formatex(msg[len], SIZE len"He have a g3sg1 a p228 and lower gravity<br>");
    
len += formatex(msg[len], SIZE len"Clint Eastwood:<br>");
    
len += formatex(msg[len], SIZE len"He got a sg550, dual elites and more armor<br>");
    
len += formatex(msg[len], SIZE len"Johnny Thunder:<br>");
    
len += formatex(msg[len], SIZE len"He have a scout, a glock18 and more health<br>");    
    
len += formatex(msg[len], SIZE len"Pow Wow Smith<br>");
    
len += formatex(msg[len], SIZE len"He have a m3, a usp, more health, more armor, but lower  speed<br>");
    
len += formatex(msg[len], SIZE len"Warren Olney<br>");
    
len += formatex(msg[len], SIZE len"He have a xm1014, a fiveseven, more health, more armor, but lower speed<br>");
    
len += formatex(msg[len], SIZE len"Charlie Nader<br>");
    
len += formatex(msg[len], SIZE len"He got a glock18, all nades and faster speed <br>");
    
len += formatex(msg[len], SIZE len"Chilli NoSee<br>");
    
len += formatex(msg[len], SIZE len"He have no footsteps, faster runspeed and you can nearly not see him, a perfect assassin<br>");
    
len += formatex(msg[len], SIZE len"</body></html>");

    
show_motd(idmsg"Western Mod Help");
    return 
PLUGIN_CONTINUE;



Metanabol 05-20-2009 17:01

Re: Timed command for each round
 
few steps:
1) add new bool variable
2) then catch start round event and start timer( set_task and start your function for specific time :) + set variable to true. ( to start menu for certain time )
3) then your function will set variable to false...


PHP Code:

public cmdWMenu(id)
{
   if(
variable) {
    if(
get_pcvar_num(gCvarMenuOpen) == 1)
        return 
PLUGIN_HANDLED
        
    
if(get_pcvar_num(gCvarMenuOpen) == 0)
    {
        
set_task(TASK_MENU_DISLPAY_TIME"choose_menu");
    }
}
else {
     
//client_print or etc...
}
    return 
PLUGIN_CONTINUE


im too drunk to write full code :D sry next time

minimiller 05-20-2009 18:33

Re: Timed command for each round
 
new bool:isInMenu[33] = false;
cmdOpenMenu() { isInMenu(id) = true; set_task(10.0, "check_menu", id); }
public check_menu(id) { if(isInMenu(id) { destroy_menu(menu); } return PLUGIN_CONTINUE; }

TitANious 05-20-2009 18:41

Re: Timed command for each round
 
Quote:

Originally Posted by Metanabol (Post 831246)
few steps:
1) add new bool variable
2) then catch start round event and start timer( set_task and start your function for specific time :) + set variable to true. ( to start menu for certain time )
3) then your function will set variable to false...


PHP Code:

public cmdWMenu(id)
{
   if(
variable) {
    if(
get_pcvar_num(gCvarMenuOpen) == 1)
        return 
PLUGIN_HANDLED
        
    
if(get_pcvar_num(gCvarMenuOpen) == 0)
    {
        
set_task(TASK_MENU_DISLPAY_TIME"choose_menu");
    }
}
else {
     
//client_print or etc...
}
    return 
PLUGIN_CONTINUE


im too drunk to write full code :D sry next time

Well, i dont think i can understand this, can anyone help me get the right stuff (Pls comment, so i know where it is ^^ And set it right in the code

Dr.G 05-20-2009 22:09

Re: Timed command for each round
 
Dude! Ive told you before. Try something YOURSELF before asking. This is just giving up before faceing the problem! Dont be lazy!

TitANious 05-21-2009 03:38

Re: Timed command for each round
 
Lol okay, i try :D
[EDIT]

I've tryied, but only "1" in the WM_MenuMethod works :(
PHP Code:

//////////////////////////////////////////

////////            //////////

///////*    Description    */////////

////////            //////////

//////////////////////////////////////////
/*
//            WESTERN MOD!
// Heroes
* You have a possibility to choose 8 heroes thats the following:
* "Lucky Luke:"
* "He has an AWP, Deagle and faster run speed."
* "Billy the Kid:"
* "He have a g3sg1 a p228 and lower gravity"
* "Clint Eastwood:"
* "He got a sg550, dual elites and more armor"
* "Johnny Thunder:"
* "He have a scout, a glock18 and more health"
* "Pow Wow Smith"
* "He have a m3, a usp, more health, more armor, but lower  speed"
* "Warren Olney"
* "He have a xm1014, a fiveseven, more health, more armor, but lower speed"
* "Charlie Nader"
* "He got a glock18, all nades and faster speed "
* "Chilli NoSee"
* "He have no footsteps, faster runspeed and you can nearly not see him, a perfect assassin"
*/

// What have i removed?
/*
* I have removed buyzone, and i strips all weapons when you choose a hero and give some abiltys.
*/

// Commands
/*
* Say /WMenu to get Western Menu up
*/

////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////

////////            //////////

///////*    Pcvars        */////////

////////            //////////

//////////////////////////////////////////

/*        
*    Pcvars!
*    "amx_western_mod"     =     "1"         (On or off)
*    "WM_LLMS"         =     "300.0"     (Lucky Luke Maxspeed)                    *
*    "WM_BKidG"         =     "0.6"        (Billy the Kid gravity)                    *
*    "WM_CEarmor"        =    "255"        (Clint Eastwoods armor)                    *
*    "WM_JThealth"         =    "255"        (Johnny Thunder health)                    *
*    "WM_PShealth"         =    "255"        (Pow Wow Smiths health)                    *
*    "WM_PSarmor"         =    "255"        (Pow Wow Smiths armor)                    *
*    "WM_PSMS"         =    "200"        (Pow Wow Smiths maxspeed)                *
*    "WM_WOhealth"         =    "255"        (Warren Olneys health)                    *
*    "WM_WOarmor"         =    "255"        (Warren Olneys armor)                    *
*    "WM_WOMS"         =    "200"        (Warren Olneys maxspeed)                *
*    "WM_NaderMS"         =    "310"        (Chalie Naders maxspeed)                *
*    "WM_NoSeeFS"         =    "1"        (Chilli NoSees footsteps)                *
*    "WM_NoSeeInvisible"     =    "30"        (Chilli NoSees Invisiblety)                *
*    "WM_NoSeeHealth"     =    "150"        (Chilli NoSees health)                    *
*    "amx_gamename"        =    "Western Mod by One and TitANious" (You can add here what you want in hud)*
*    "amx_hudhelp"        =    "1"        (Enabled if you want to show^)                *
*/
////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////

////////            //////////

///////*    Changelog    */////////

////////            //////////

//////////////////////////////////////////

/*
* [1.0] The release of Western Mod
*/

////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////

////////              ////////////

///////*    Credits       *///////////

////////              ////////////

////////////////////////////////////////////

/*
* TitANious     -    For making the most code
* One         -    For the most msg, main idea, models
* ConnorMcLeod    -    For stripping without c4 bomb
* Milord (quim)    -    Helping with som constant, i hope it would be faster now 
*
* Of Course some more
*/

////////////////////////////////////////////////////////////////////////////////////////////////////
                            
////////*    Includes    */////////

#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich> 
#include <amxmisc>

///////*    Defines        */////////

#define TASK_MENU_DISLPAY_TIME 3.0
#define OFFSET_PRIMARYWEAPON    116
#define OFFSET_C4_SLOT        372

///////*    Pcvar News    */////////

new g_EnablegCvarLLMSgCvarBKidGgCvarCEarmorgCvarJThealth
gCvarPShealthgCvarPSarmorgCvarPSMSgCvarWOhealthgCvarWOarmor
gCvarWOMSgCvarNaderMSgCvarNoSeeFSgCvarNoSeeInvisiblegCvarNoSeeHealth
g_GameNamegCvarLuckyLukegCvarBillytheKidgCvarClintEastwoodgCvarJohnnyThunder
gCvarPowWowSmithgCvarWarrenOlneygCvarCharlieNadergCvarChilliNoSeegCvarMenuOpen,
gCvarCEhealth;

///////*    Other News    */////////

new g_bJustConnected[33];
new 
g_Hudhelp;
new 
g_MaxPlayers;
new 
bool:g_b10Gone[33];

///////*    Constants    */////////

// Constant For Weapons

new WEAPONS[] = 
{
    
CSW_P228,CSW_SCOUT,CSW_XM1014,CSW_ELITE,CSW_FIVESEVEN,CSW_SG550,CSW_USP,CSW_GLOCK18,CSW_AWP,
    
CSW_M3,CSW_G3SG1,CSW_G3SG1,CSW_DEAGLE,CSW_KNIFE,CSW_HEGRENADE,CSW_SMOKEGRENADE,CSW_FLASHBANG
}

new 
iWeapBits

// Constant for Custom Models

new const CUSTOM_MODELS[33][] =
{
    
"",
    
"models/WesternMod/v_p228.mdl",
    
"",
    
"models/WesternMod/v_scout.mdl",
    
"models/WesternMod/v_hegrenade.mdl",
    
"models/WesternMod/v_xm1014.mdl",
    
"",
    
"",
    
"",
    
"models/WesternMod/v_smokegrenade.mdl",
    
"models/WesternMod/v_elite.mdl",
    
"models/WesternMod/v_fiveseven.mdl",
    
"",
    
"models/WesternMod/v_sg550.mdl",
    
"",
    
"",
    
"models/WesternMod/v_usp.mdl",
    
"models/WesternMod/v_glock18.mdl",
    
"models/WesternMod/v_awp.mdl",
    
"",
    
"",
    
"models/WesternMod/v_m3.mdl",
    
"",
    
"",
    
"models/WesternMod/v_g3sg1.mdl",
    
"models/WesternMod/v_flashbang.mdl",
    
"models/WesternMod/v_deagle.mdl",
    
"",
    
"",
    
"models/WesternMod/v_knife.mdl",
    
"",
    
"",
    
""
};


///////*    Precache Models     */////

public plugin_precache()
{
    
g_Enable register_cvar("amx_western_mod""1");

    if(
get_pcvar_num(g_Enable))
    {
        for(new 
i=0;i<sizeof WEAPONS;i++)
        {
            
precache_model(CUSTOM_MODELS[WEAPONS[i]])
            
iWeapBits |= << WEAPONS[i]
        }
        
        
///////*    Precache Buyzone     *////

        
RegisterHam(Ham_Spawn,"func_buyzone","buyZoneSpawn"
    }
}

///////*    Register Plugin      *//////

public plugin_init()
{
///////* Register random stuff     *////

    // Register plugin
    
register_plugin("Western Mod""1.0""One/TitANious");
    
    
// The game description
    
register_forward(FM_GetGameDescription,"fw_GameDesc");
    
    
// The task for Hud Help Message
    
set_task(1.0"mod_ihelp"0""0"b");
    
    
// Register the menu
    
register_menucmd(register_menuid("Menu"), 1023"We_Menu");
    
    
// The Help MOTD
    
register_clcmd("say /help""help_motd");
    
    
// Again Help MOTD just in say_team
    
register_clcmd("say_team /help""help_motd");
    
    
// Registering the model
    
register_event("CurWeapon""Event_CurWeapon""be""1=1");
    
    
// Blocking drop
    
register_clcmd("drop""blockDrop")
    
    
// You can't pick things up, except c4 bomb
    
register_forward(FM_Touch,"fwTouch"); 
    
    
// Get maxplayers
    
g_MaxPlayers get_maxplayers();
    
    
// Command to the Western Menu
    
register_clcmd("say /WMenu""cmdWMenu");
    
    
register_clcmd("say_team /WMenu""cmdWMenu");
    
    
register_clcmd("say /wmenu""cmdWMenu");
    
    
register_clcmd("say_team /wmenu""cmdWMenu");
    
    
// Task for menu
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
    
    
///////*    Register Pcvars        */////

    // For Enable
    
g_Enable register_cvar("amx_western_mod""1");
    
    
// Lucky Luke
    
gCvarLuckyLuke register_cvar("WM_LuckyLuke""1")
    
    
// For Lucky Luke Maxspeed
    
gCvarLLMS register_cvar("WM_LLMS""300.0")
    
    
// Billythekid
    
gCvarBillytheKid register_cvar("WM_BillytheKid""1")
    
    
// For Billy the Kids Gravity
    
gCvarBKidG register_cvar("WM_BKidG""0.6")
    
    
// Clint Eastwood
    
gCvarClintEastwood register_cvar ("WM_ClintEastwood""1")
    
    
// For Clint Eastwoods armor
    
gCvarCEarmor register_cvar("WM_CEarmor""255")
    
    
// For Clint Eastwoods health
    
gCvarCEhealth register_cvar("WM_CEhealth""75")
    
    
// Johnny Thunder
    
gCvarJohnnyThunder register_cvar("WM_JohnnyThunder""1")
    
    
// For Johnny Thunder health
    
gCvarJThealth register_cvar("WM_JThealth""255")
    
    
// Pow Wow Smith
    
gCvarPowWowSmith register_cvar("WM_PowWowSmith""1")
    
    
// For Pow Wow Smith health
    
gCvarPShealth register_cvar("WM_PShealth""255")
    
    
// For Pow Wow Smith armor
    
gCvarPSarmor register_cvar("WM_PSarmor""255")
    
    
// For Pow Wow Smith maxspeed
    
gCvarPSMS register_cvar("WM_PSMS""200")
    
    
// Warren Olney
    
gCvarWarrenOlney register_cvar("WM_WarrenOlney""1")
    
    
// For Warren Olneys health
    
gCvarWOhealth register_cvar("WM_WOhealth""255")
    
    
// For Warren Olneys armor
    
gCvarWOarmor register_cvar("WM_WOarmor""255")
    
    
// For Warren Olneys maxspeed
    
gCvarWOMS register_cvar("WM_WOMS""200")
    
    
// Charlie Nader
    
gCvarCharlieNader register_cvar("WM_CharlieNader""1")
    
    
// For Charlie Naders maxspeed
    
gCvarNaderMS register_cvar("WM_NaderMS""310")
    
    
// Chilli NoSee
    
gCvarChilliNoSee register_cvar("WM_ChilliNoSee""1")
    
    
// For Chilli NoSees footstep
    
gCvarNoSeeFS register_cvar("WM_NoSeeFS""1")
    
    
// Chilli NoSees invisiblety
    
gCvarNoSeeInvisible register_cvar("WM_NoSeeInvisible""30")
    
    
// For Chilli NoSees health
    
gCvarNoSeeHealth register_cvar("WM_NoSeeHealth""150")
    
    
// For the gamename, which is in the right cornor
    
g_GameName register_cvar("amx_gamename""Western Mod by One and TitANious");
    
    
// Should the help hud be there?
    
g_Hudhelp register_cvar("amx_hudhelp""1");
    
    
// Menu Method
    
gCvarMenuOpen register_cvar("WM_MenuMethod""0");
    
}

///////*    Say command for menu *///////

public cmdWMenu(id)
{
    if(
g_b10Gone[id]) 
    {
        if(
get_pcvar_num(gCvarMenuOpen) == 1)
            return 
PLUGIN_HANDLED
        
        
if(get_pcvar_num(gCvarMenuOpen) == 0)
        {
            
set_task(TASK_MENU_DISLPAY_TIME"choose_menu");
        }
    }
    else 
    {
        
client_print(idprint_chat"10 Secunds have gone, try next round");
    }
    return 
PLUGIN_CONTINUE
}  

///////*    Client connect    */////////

public client_connect(id)
{
    
g_bJustConnected[id] = true
    
g_b10Gone[id] = true;
}

///////*    Connect+Menu    */////////
 
public fnFunction(id)
{
    if(
get_pcvar_num(gCvarMenuOpen) == 0)
    {
        
// Check if player has just connected
        
if (g_bJustConnected[id])
        {
            
// Player has just connected, set the task
            
set_task(TASK_MENU_DISLPAY_TIME"choose_menu"id);
 
            
// Now set that player is no longer "just connected"
            
g_bJustConnected[id] = false;
        }    
    }
}

///////*    Removal of Buyzone     */////////

public buyZoneSpawn(id)
{
    return 
HAM_SUPERCEDE;
}  

///////*    You cant pick weapons up!   *////

public fwTouchent id )
{
    if ( !( 
<= id <= g_MaxPlayers ) || !pev_valident ) || !( pevent pev_flags ) & FL_ONGROUND ) )
        return 
FMRES_IGNORED;
    
    
//This will block picking up all weapons except backpack (c4)

    
static szEntModel[32];
    
pevent pev_model szEntModel 31 );
    
    return 
equalszEntModel "models/w_backpack.mdl" ) ? FMRES_IGNORED FMRES_SUPERCEDE
}  

///////*    Blocking drop    */////////

public blockDrop() 
    return 
PLUGIN_HANDLED

///////*    Strips weapons    */////////

StripUserWeapons(id)
{
    
set_user_footsteps(id1)
    
set_user_rendering(id,kRenderFxGlowShell,0,00,kRenderTransAlpha255);
    new 
iC4Ent get_pdata_cbase(idOFFSET_C4_SLOT)
    if( 
iC4Ent )
    {
        
set_pdata_cbase(idOFFSET_C4_SLOTFM_NULLENT)
    }

    
strip_user_weapons(id)
    
set_pdata_int(idOFFSET_PRIMARYWEAPON0)

    if( 
iC4Ent )
    {
        
entity_set_int(idEV_INT_weaponsentity_get_int(idEV_INT_weapons) | (1<<CSW_C4))
        
set_pdata_cbase(idOFFSET_C4_SLOTiC4Ent)
        
cs_set_user_bpammo(idCSW_C41)
        
cs_set_user_plant(id1)
    }
    return 
PLUGIN_HANDLED
}

///////*    Models        */////////

public Event_CurWeapon(id)
{
    new 
iWeapon read_data(2);
    
    if( 
pev_validid ) && ( iWeapBits & ( << iWeapon ) ) )
    
set_pevid pev_viewmodel2 CUSTOM_MODELS[iWeapon] );
}  

///////*    Cfg File    */////////

public plugin_cfg()
{
    if(
get_pcvar_num(g_Enable) == 0)
        return 
PLUGIN_HANDLED;

    new 
configsDir[32],file[192];
    
get_configsdir(configsDirsizeof configsDir 1);
    
formatex(file,sizeof file 1,"%s/western.cfg",configsDir);
    
    if(
file_exists(file))
    {
        
server_cmd("exec %s"file);
    }
    else
    {
        
log_amx("####################################");
        
log_amx("[ERROR] western.cfg not Found!");
        
log_amx("####################################");
    }

    return 
PLUGIN_CONTINUE;
}

///////*    Task for menu        *///////

public fwHamPlayerSpawnPost(id)
{
    if(
get_pcvar_num(g_Enable) == 0)
        return 
HAM_SUPERCEDE;
        
    if(
get_pcvar_num(gCvarMenuOpen) == 1)
    {
        
set_task(TASK_MENU_DISLPAY_TIME"choose_menu"id);

        return 
HAM_IGNORED;
    }
    return 
HAM_IGNORED
}

///////*    Things for the menu     *//////

public choose_menu(id)
{        
    if((
get_pcvar_num(g_Enable) == 0) && is_user_alive(id) && is_user_bot(id) && is_user_hltv(id))
    return 
HAM_SUPERCEDE;
    
    new 
menu menu_create("\rChoose the Hero!""We_Menu")
        
    if(
get_pcvar_num(gCvarLuckyLuke))
    {
        
menu_additem(menu"\wLucky Luke""1"0)
    }
    if(
get_pcvar_num(gCvarBillytheKid))
    {
        
menu_additem(menu"\wBilly the Kid""2"0)
    }
    if(
get_pcvar_num(gCvarClintEastwood))
    {
        
menu_additem(menu"\wClint Eastwood""3"0)
    }
    if(
get_pcvar_num(gCvarJohnnyThunder))
    {
        
menu_additem(menu"\wJohnny Thunder""4"0)
    }
    if(
get_pcvar_num(gCvarPowWowSmith))
    {
        
menu_additem(menu"\wPow Wow Smith""5"0)
    }
    if(
get_pcvar_num(gCvarWarrenOlney))
    {
        
menu_additem(menu"\wWarren Olney""6"0)
    }
    if(
get_pcvar_num(gCvarCharlieNader))
    {
        
menu_additem(menu"\wCharlie Nader""7"0)
    }
    if(
get_pcvar_num(gCvarChilliNoSee))
    {
        
menu_additem(menu"\wChilli NoSee""8"0)
    }
    
menu_setprop(menuMPROP_EXITMEXIT_NEVER); 
    
menu_display(idmenu0)
    return 
PLUGIN_HANDLED;
}  

///////*    The menu    */////////

public We_Menu(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
set_task(TASK_MENU_DISLPAY_TIME"choose_menu"id);
        return 
PLUGIN_HANDLED
    
}

    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)
    new 
key str_to_num(data)
    switch(
key
    {
        case 
1:/*     Lucky Luke    */  
        

            
// Stip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife" )
            
            
// AWP
            
give_item id"weapon_awp" )
            
cs_set_user_bpammoidCSW_AWP30 );  
            
            
// Deagle
            
give_item id"weapon_deagle")
            
cs_set_user_bpammoidCSW_DEAGLE35 );  
            
            
// Costum abilitys
            
set_user_maxspeed(idget_pcvar_float(gCvarLLMS));
                    
            
// Message
            
client_print(idprint_chat,"You are now Lucky Luke.");
        }
        case 
2:/*    Billy the Kid    */
        
{    
            
/// Strip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife")
            
            
// G3SG1
            
give_item id"weapon_g3sg1")
            
cs_set_user_bpammoidCSW_G3SG160 );  
            
            
// P228
            
give_item id"weapon_p228")
            
cs_set_user_bpammoidCSW_P22852 );  
            
            
// Custom abilitys
            
set_user_gravity idget_pcvar_float(gCvarBKidG));
                
            
// Message
            
client_print(idprint_chat,"You are now Billy the Kid.");
        }
        case 
3:/*    Clint Eastwood    */
        
{
            
// Strip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife" )
            
            
// SG550
            
give_item id"weapon_sg550");
            
cs_set_user_bpammoidCSW_SG55050 );  
            
            
// Dual elite
            
give_item id"weapon_elite")
            
cs_set_user_bpammoidCSW_ELITE120 );  
            
            
// Custom abilitys
            
set_user_armoridget_pcvar_num(gCvarCEarmor));
            
set_user_healthidget_pcvar_num(gCvarCEhealth));
                        
            
// Message
            
client_print(idprint_chat,"You are now Clint Eastwood.");
        }
        case 
4:/*    Johnny Thunder    */
        
{
            
// Strip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife" )
            
            
// Scout
            
give_item id"weapon_scout" )
            
cs_set_user_bpammoidCSW_SCOUT90 );  
            
            
// Glock18
            
give_item id"weapon_glock18")
            
cs_set_user_bpammoidCSW_GLOCK1890 );  
            
            
// Custom abilitys
            
set_user_healthidget_pcvar_num(gCvarJThealth));
            
            
// Message
            
client_print(idprint_chat,"You are now Johnny Thunder.");
        }
        case 
5:/*    Pow Wow Smith    */
        
{
            
// Strip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife" )
            
            
// M3
            
give_item id"weapon_m3")
            
cs_set_user_bpammoidCSW_M350 );  
            
            
// USP
            
give_item id"weapon_usp")
            
cs_set_user_bpammoidCSW_USP100 );  
            
            
// Custom abilitys
            
set_user_armoridget_pcvar_num(gCvarPShealth));
            
set_user_healthidget_pcvar_num(gCvarPSarmor));
            
set_user_maxspeed(idget_pcvar_float(gCvarPSMS));
            
            
// Message
            
client_print(idprint_chat,"You are now Pow Wow Smith.");
        }
        case 
6:/*    Warren Olney    */
        
{
            
// Strip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife" )
            
            
// XM1014
            
give_item id"weapon_xm1014")
            
cs_set_user_bpammoidCSW_XM101450 );  
            
            
// Fiveseven
            
give_item id"weapon_fiveseven")
            
cs_set_user_bpammoidCSW_FIVESEVEN50 );  

            
// Custom abilitys
            
set_user_armoridget_pcvar_num(gCvarWOarmor));
            
set_user_healthidget_pcvar_num(gCvarWOhealth));
            
set_user_maxspeed(idget_pcvar_float(gCvarWOMS));
                    
            
// Message
            
client_print(idprint_chat,"You are now Warren Olney.");
        }
        case 
7:/*    Charlie Nader    */
        
{
            
// Strip weapons
            
StripUserWeapons(id)
            
            
// knife
            
give_item id"weapon_knife")
            
            
// Glock18
            
give_item id"weapon_glock18")
            
cs_set_user_bpammoidCSW_GLOCK1850 );  
            
            
// Flashbang
            
give_item id"weapon_flashbang" )
            
give_item id"weapon_flashbang" )
            
            
// High Explosive grenade
            
give_item id"weapon_hegrenade" )
            
            
// Smoke grenade
            
give_item id"weapon_smokegrenade" )
            
            
// Custom ablitys
            
set_user_maxspeed idget_pcvar_float(gCvarNaderMS));
                    
            
// Message
            
client_print(idprint_chat,"You are now Charlie Nader.");
        }
        case 
8:/*    Chilli NoSee    */
        
{
            
// Strip weapons
            
StripUserWeapons(id)
            
            
// Knife
            
give_item id"weapon_knife" 
            
            
// Custom abilitys
            
set_user_rendering(id,kRenderFxGlowShell,0,00,kRenderTransAlpha,get_pcvar_num(gCvarNoSeeInvisible)); 
            
set_user_footsteps idget_pcvar_num(gCvarNoSeeFS));
            
set_user_health idget_pcvar_num(gCvarNoSeeHealth))
                    
            
// Message
            
client_print(idprint_chat,"You are now Chilli NoSee.");
        }
    }
    return 
PLUGIN_HANDLED;
}

///////*    Game Description    */////

public fw_GameDesc()
{
    if(
get_pcvar_num(g_Enable) == 0)
        return 
FMRES_IGNORED;

    new 
gamename[32];
    
get_pcvar_string(g_GameNamegamename31);
    
forward_return(FMV_STRINGgamename);

    return 
FMRES_SUPERCEDE;
}    

///////*    Hud Message    */////////

public mod_ihelp()
{
    if(
get_pcvar_num(g_Hudhelp) == 1)
    {
        
set_hudmessage(255,255,255,0.75,0.05,01.01.00.10.213);
        
show_hudmessage(0"This server is running Western Mod 1.0 by TitANious and One^nType /help to know more!");
    }
    return 
PLUGIN_CONTINUE;
}

///////*    MOTD Help    */////////

public help_motd(id)
{
    const 
SIZE 1024;
    new 
msg[SIZE+1],len 0;
    
len += formatex(msg[len], SIZE len"<html><body style=^"background-color:yellow;color:blue;font-size:16^"");
    
len += formatex(msg[len], SIZE len"Choose a hero<br>");
    
len += formatex(msg[len], SIZE len"Lucky Luke:<br>");
    
len += formatex(msg[len], SIZE len"He has an AWP, Deagle and faster run speed.<br>");    
    
len += formatex(msg[len], SIZE len"Billy the Kid:<br>");
    
len += formatex(msg[len], SIZE len"He have a g3sg1 a p228 and lower gravity<br>");
    
len += formatex(msg[len], SIZE len"Clint Eastwood:<br>");
    
len += formatex(msg[len], SIZE len"He got a sg550, dual elites and more armor<br>");
    
len += formatex(msg[len], SIZE len"Johnny Thunder:<br>");
    
len += formatex(msg[len], SIZE len"He have a scout, a glock18 and more health<br>");    
    
len += formatex(msg[len], SIZE len"Pow Wow Smith<br>");
    
len += formatex(msg[len], SIZE len"He have a m3, a usp, more health, more armor, but lower  speed<br>");
    
len += formatex(msg[len], SIZE len"Warren Olney<br>");
    
len += formatex(msg[len], SIZE len"He have a xm1014, a fiveseven, more health, more armor, but lower speed<br>");
    
len += formatex(msg[len], SIZE len"Charlie Nader<br>");
    
len += formatex(msg[len], SIZE len"He got a glock18, all nades and faster speed <br>");
    
len += formatex(msg[len], SIZE len"Chilli NoSee<br>");
    
len += formatex(msg[len], SIZE len"He have no footsteps, faster runspeed and you can nearly not see him, a perfect assassin<br>");
    
len += formatex(msg[len], SIZE len"</body></html>");

    
show_motd(idmsg"Western Mod Help");
    return 
PLUGIN_CONTINUE;



minimiller 05-21-2009 06:21

Re: Timed command for each round
 
Im confused at what your trying to do

PHP Code:

public cmdWMenu(id)
{
    if(
g_b10Gone[id]) //This is set to false by default unless you declare it true
    
{
        if(
get_pcvar_num(gCvarMenuOpen) == 1//This is set to 1 in plugin_init, therefore none of the code below will be executed
            
return PLUGIN_HANDLED
        
        
if(get_pcvar_num(gCvarMenuOpen) == 0)
        {
            
set_task(TASK_MENU_DISLPAY_TIME"choose_menu");
        }
    }
    else 
    {
        
client_print(idprint_chat"10 Secunds have gone, try next round");
    }
    return 
PLUGIN_CONTINUE




All times are GMT -4. The time now is 01:34.

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