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

change the team, and check the flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xfire97
Member
Join Date: Aug 2011
Old 03-26-2012 , 08:51   change the team, and check the flags
Reply With Quote #1

I want that Terrorist change to the team CT (only who have ADMIN_RESERVATION), who dont have flag but have the money appears a message like "u must be vip", if dont have money "u dont have money" if player dead "you are dead u cant buy antidote", and if ct "u cant buy antidote".
Thanks
PHP Code:
/* Plugin generated by Emilioneri */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "T-Virus Antidote"
#define VERSION "1.0"
#define AUTHOR "Emilioneri"

new g_Cost


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
    
g_Cost register_cvar("amx_antidotecost""5000")
    
register_clcmd("say /antidote""cmd_antidote")
    
register_logevent("Event_Round_Start"2"1=Round_Start")
}

public 
Event_Round_Start()
{
    
client_print(0print_chat"To buy an Antidote type in chat: /antidote")
}

public 
cmd_antidote(id)
{       
    if(!
is_user_alive(id))
    {
        
client_print(idprint_chat"You can't buy an antidote while you are dead!");
        return 
PLUGIN_HANDLED;
    }
    
    if(
get_user_team(id) == CS_TEAM_CT)
    {
        
client_print(idprint_chat"You can't buy an antidote, because you are a human");
        return 
PLUGIN_HANDLED;
    }
    
    new 
iMoney cs_get_user_money(id)
    new 
iCost get_pcvar_num(g_Cost)
    
    if(
iMoney >= iCost && get_user_flags(id) == ADMIN_RESERVATION)
    {
        
cs_set_user_money(idiMoney iCost)
        
cs_set_user_team(idCS_TEAM_CTCS_CT_GSG9)
        
client_print(idprint_chat"You have used an antidote");
        return 
PLUGIN_HANDLED;
    }
    if(
iMoney iCost)
    {
        
client_print(idprint_chat"You don't have enaugh moeny! $%i needed!"iCost)
    }
    
    if(
iMoney >= iCost && get_user_flags(id) != ADMIN_RESERVATION)
    {
        
client_print(idprint_chat"Tens de ser VIP")
    return 
PLUGIN_HANDLED;
    }


Last edited by xfire97; 03-26-2012 at 08:52. Reason: Forget the code
xfire97 is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 03-26-2012 , 12:05   Re: change the team, and check the flags
Reply With Quote #2

What?, i cant understand you!
Bilal Pro is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-26-2012 , 14:59   Re: change the team, and check the flags
Reply With Quote #3

PHP Code:
    if(iMoney >= iCost && get_user_flags(id) == ADMIN_RESERVATION)
    {
        
cs_set_user_money(idiMoney iCost)
        
cs_set_user_team(idCS_TEAM_CTCS_CT_GSG9)
        
client_print(idprint_chat"You have used an antidote");
        return 
PLUGIN_HANDLED;
    }
    if(
iMoney iCost)
    {
        
client_print(idprint_chat"You don't have enaugh moeny! $%i needed!"iCost)
    }
    
    if(
iMoney >= iCost && get_user_flags(id) != ADMIN_RESERVATION)
    {
        
client_print(idprint_chat"Tens de ser VIP")
    return 
PLUGIN_HANDLED;
    } 
->

PHP Code:
    if( get_user_flags(id) & ADMIN_RESERVATION )
    {
        if(
iMoney >= iCost )
        {
            
cs_set_user_money(idiMoney iCost)
            
cs_set_user_team(idCS_TEAM_CTCS_CT_GSG9)
            
client_print(idprint_chat"You have used an antidote");
        }
        else
        {
            
client_print(idprint_chat"You don't have enaugh moeny! $%i needed!"iCost)
        }
    }
    else
    {
        
client_print(idprint_chat"Tens de ser VIP")
    }
    return 
PLUGIN_HANDLED 
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 03-27-2012 at 01:49.
ConnorMcLeod is offline
xfire97
Member
Join Date: Aug 2011
Old 03-26-2012 , 18:13   Re: change the team, and check the flags
Reply With Quote #4

Didnt work connor i have the b flag (ADMIN_RESERVATION), and appears a message
<span style="color: #000000"><span style="color: #007700">
PHP Code:
else
    {
        
client_print(idprint_chat"Tens de ser VIP")
    } 
xfire97 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-27-2012 , 01:50   Re: change the team, and check the flags
Reply With Quote #5

Fixed, i had edited but in the first part of code...
See how admin flags are checked and the way you were doing it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
xfire97
Member
Join Date: Aug 2011
Old 03-27-2012 , 14:14   Re: change the team, and check the flags
Reply With Quote #6

I use this now, but when the plugin, but when the guy write change he change the team, but can u make to spawn in Ct Spawn? and to ct appears a message "only for T"
PHP Code:
#include <amxmodx>
#include <cstrike>

#define PLUGIN "Antidote"
#define VERSION "1.0"
#define AUTHOR "Rocha"


public plugin_init() {
        
register_plugin(PLUGINVERSIONAUTHOR)
        
register_clcmd("say /antidote" "cmd_antidote")
        
        
}
public 
cmd_antidoteid ) {
        if(
cs_get_user_teamid ) == CS_TEAM_T 
        
&& get_user_flagsid ) & ADMIN_RESERVATION
        
&& is_user_aliveid ) ) {
                new 
money cs_get_user_moneyid )
                if(
money >= 5000) {
                        
cs_set_user_team(idCS_TEAM_CTCS_CT_GSG9)
                        
cs_set_user_money(idmoney 5000)
                        
                }
        }
        else
                
client_print(idprint_chat"U must be VIP, or u cant use the command")
        

xfire97 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 11:57.


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