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

[SOLVED] Double Say Command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wTf.
Senior Member
Join Date: Aug 2011
Location: This important?
Old 10-27-2013 , 07:12   [SOLVED] Double Say Command
Reply With Quote #1

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /light","OpenTheLight")
}
public 
OpenTheLight(id) {
    if(
get_user_team(id) == 2) {
        
set_pev(id,pev_effects,EF_BRIGHTLIGHT)
        
client_print(idprint_chat,"[Light]: Light ON")
    } else if(
get_user_team(id) == 2) {
        
set_pev(idpev_effectspev(idpev_effects) &~ EF_BRIGHTLIGHT)
        
client_print(idprint_chat,"[Light]: Light OFF")
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/ 
i want to double command ON/OFF

ex:

CT player in the game write say /light open the light again write say /light shut the light.

sorry for my very bad english
wTf. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-27-2013 , 07:29   Re: Double Say Command
Reply With Quote #2

PHP Code:
public OpenTheLight(id)

    if(
get_user_team(id) == 2)
    { 
        
set_pev(idpev_effectspev(idpev_effects) ^ EF_BRIGHTLIGHT
        
client_print(idprint_chat,"[Light]: Light Toggled"
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
razermamba
Member
Join Date: Aug 2010
Old 10-27-2013 , 07:29   Re: Double Say Command
Reply With Quote #3

connors great

Last edited by razermamba; 10-27-2013 at 07:30.
razermamba is offline
Balck
Senior Member
Join Date: Apr 2013
Location: Kosova-Mitrovica
Old 10-27-2013 , 07:39   Re: Double Say Command
Reply With Quote #4

Quote:
Originally Posted by wTf. View Post
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>

new bool:makeonoff[33] = false;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /light","OpenTheLight")
}
public 
OpenTheLight(id) {
    if(
get_user_team(id) == 2) {
        
set_pev(id,pev_effects,EF_BRIGHTLIGHT)
        
client_print(idprint_chat,"[Light]: Light ON")
    } else if(
get_user_team(id) == 2) {
        
set_pev(idpev_effectspev(idpev_effects) &~ EF_BRIGHTLIGHT)
        
client_print(idprint_chat,"[Light]: Light OFF")
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/ 
i want to double command ON/OFF

ex:

CT player in the game write say /light open the light again write say /light shut the light.

sorry for my very bad english

Use this and tell me if it work

PHP Code:
#include <amxmodx>
#include <fakemeta>

new bool:makeonoff[33];

public 
plugin_init(){
    
register_plugin("PLUGIN""VERSION""AUTHOR")
    
register_clcmd("say /light","OpenTheLight")
}

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

public 
OpenTheLight(id) {
    if(
get_user_team(id) == 2) {
        if(
makeonoff[id] == true){
            
set_pev(id,pev_effects,EF_BRIGHTLIGHT)
            
client_print(idprint_chat,"[Light]: Light ON")
            
makeonoff[id] = false
        
}
        else
        if(
makeonoff[id] == false){
            
set_pev(idpev_effectspev(idpev_effects) &~ EF_BRIGHTLIGHT)
            
client_print(idprint_chat,"[Light]: Light OFF")
            
makeonoff[id] = true
        
}
    }

but connor method is better
__________________

Last edited by Balck; 10-27-2013 at 07:40.
Balck is offline
wTf.
Senior Member
Join Date: Aug 2011
Location: This important?
Old 10-27-2013 , 07:41   Re: Double Say Command
Reply With Quote #5

perfect!! thank you so much connor

EDIT:

@balck

Ok, i try

EDIT2:

Thnx balck ur code perfect!

Last edited by wTf.; 10-27-2013 at 07:53.
wTf. 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:49.


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