Raised This Month: $ Target: $400
 0% 

Performing multiple commands in an if/then statement


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 03-20-2007 , 05:23   Re: Performing multiple commands in an if/then statement
Reply With Quote #5

Code:
#include <amxmodx>
//#include <amxmisc>
#include <fun>
//#include <engine>
#include <cstrike>
 
new bool:invis[33]
 
public plugin_init()
{
    register_plugin("mod","1.0","author")
    register_clcmd("goinvis","hook_goinvis")
    register_event("CurWeapon", "even_CurWeapon", "be", "1=1")
}
 
public hook_goinvis(id)
{
    if(!invis[id])
    {
        invis[id]=true
        engclient_cmd(id,"weapon_knife")
        set_task(5.0,"un_invis",id)
        set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,0)
        client_print(id, print_chat, "You are now invisable.")
        set_user_footsteps(id, 1)
    }
    return PLUGIN_HANDLED
}
 
public un_invis(id)
{
    invis[id]=false
    set_user_rendering(id)
    client_print(id, print_chat, "You are now visible again.")
    set_user_footsteps(id, 0)
}
 
public even_CurWeapon(id)
{ 
   if (invis[id] && read_data(2)!=CSW_KNIFE)
   {
      engclient_cmd(id,"weapon_knife")
   }
}
player only can use knife when invisable.
__________________
QQ31537639
jopmako is offline
Send a message via MSN to jopmako
 



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 11:14.


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