Raised This Month: $ Target: $400
 0% 

help make the map a player when it comes to T flag


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kent4
Junior Member
Join Date: Oct 2011
Location: Russia, Perm
Old 11-04-2011 , 10:47   help make the map a player when it comes to T flag
Reply With Quote #1

PHP Code:
#define DAMAGE_RECIEVED
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#define VIP_FLAG ADMIN_LEVEL_H


public plugin_init()
{
    
register_plugin("VIP Privileges""1.1""Kent-4");
    
register_event("HLTV""event_round_start""a""1=0""2=0");
    
register_event("ResetHUD""ResetHUD""be")
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
    
    
register_clcmd("say /adminka""adminka");
    
register_clcmd("say /vip","ShowMotd");
    
register_clcmd("say""handle_say");
    }

public 
plugin_precache() 
{
    
precache_model("models/player/vip_t/vip_t.mdl")
    
precache_model("models/player/vip_ct/vip_ct.mdl")
        return 
PLUGIN_CONTINUE
}

public 
fwHamPlayerSpawnPost(id
{
        if (
get_user_flags(id) & VIP_FLAG
        {
                new 
CsTeams:userTeam cs_get_user_team(id)
                if (
userTeam == CS_TEAM_T) {
                        
cs_set_user_model(id"vip_t")
                }
                else if(
userTeam == CS_TEAM_CT) {
                        
cs_set_user_model(id"vip_ct")
                }
                else {
                        
cs_reset_user_model(id)
                }
        }

        return 
PLUGIN_CONTINUE
}

public 
client_putinserver(id)
{
    
set_task(0.1"vip_connect"id);
}

public 
vip_connect(id)
{
if ( 
get_user_flags id ) & VIP_FLAG )
    {
        new 
name[32];
        
get_user_name(idname31);
        
client_print(0,print_chat"Внимание подключился VIP"name)
    }
return 
PLUGIN_HANDLED
}
public 
ResetHUD(id)
{
    
set_task(0.5"VIP"id 6910)
}
public 
VIP(TaskID)
{
    new 
id TaskID 6910
    
    
if ( get_user_flags id ) & VIP_FLAG )
    {
        
message_begin(MSG_ALLget_user_msgid("ScoreAttrib"))
        
write_byte(id)
        
write_byte(4)
        
message_end()
        
give_item(id,"weapon_hegrenade")
        
give_item(id,"weapon_flashbang")
        
give_item(id,"weapon_flashbang")
        
give_item(id,"weapon_smokegrenade")
        
give_item(id,"item_assaultsuit")    
    }
    
    return 
PLUGIN_HANDLED
}

public 
ShowMotd(id)
{
 
show_motd(id"vip.txt")
}

public 
adminka(id)
{
 
show_motd(id"adminka.txt")
}

stock ChatColor(const id, const input[], any:...) 
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4"// Green Color
    
replace_all(msg190"!y""^1"// Default Color
    
replace_all(msg190"!team""^3"// Team Color
    
replace_all(msg190"!team2""^0"// Team2 Color
    
    
if (idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1251\\ deff0\\ deflang1049{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/ 
plug-in compiles, but does not work
player when it comes to the flag T, there is no chat messages

the mistake in my code?
kent4 is offline
Send a message via ICQ to kent4
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-04-2011 , 12:18   Re: help make the map a player when it comes to T flag
Reply With Quote #2

Add is_user_alive() check to ham spawn forward. If you're referring to the connecting player not seeing the msg then your problem is probably the short set_task() interval, the player probably hasn't been shown the MOTD yet, change to atleast 4.0. if you don't care about player seeing msg then do client print directly in putinserver, set_task serves no purpose. Double check that T==ADMIN_LEVEL_H? Any errors?
__________________

Last edited by Bugsy; 11-04-2011 at 12:26.
Bugsy is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 11-04-2011 , 12:22   Re: help make the map a player when it comes to T flag
Reply With Quote #3

Quote:
Originally Posted by kent4 View Post
PHP Code:
#define VIP_FLAG ADMIN_LEVEL_H 
player when it comes to the flag T, there is no chat messages
Maybe this is your issue?
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
kent4
Junior Member
Join Date: Oct 2011
Location: Russia, Perm
Old 11-04-2011 , 12:28   Re: help make the map a player when it comes to T flag
Reply With Quote #4

PHP Code:
public client_putinserver(id

    
set_task(0.7"vip_connect"id); 

so?
kent4 is offline
Send a message via ICQ to kent4
Old 11-04-2011, 12:36
joshknifer
This message has been deleted by joshknifer. Reason: blah
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 11-04-2011 , 12:36   Re: help make the map a player when it comes to T flag
Reply With Quote #5

Quote:
Originally Posted by kent4 View Post
PHP Code:
public client_putinserver(id

    
set_task(0.7"vip_connect"id); 

so?
You said you were having problems with the "T" flag. VIP Flag is set to "H"
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
kent4
Junior Member
Join Date: Oct 2011
Location: Russia, Perm
Old 11-04-2011 , 13:06   Re: help make the map a player when it comes to T flag
Reply With Quote #6

Quote:
Originally Posted by amxconst.inl
#define ADMIN_LEVEL_H (1<<19) /* flag "t" */
All I have right
kent4 is offline
Send a message via ICQ to kent4
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-04-2011 , 13:23   Re: help make the map a player when it comes to T flag
Reply With Quote #7

ADMIN_LEVEL_H isn't the same as flag "h" in users.ini..joshknifer
__________________

Last edited by Bugsy; 11-04-2011 at 13:24.
Bugsy is offline
joshknifer
Veteran Member
Join Date: Jun 2011
Location: Denver, CO
Old 11-04-2011 , 14:09   Re: help make the map a player when it comes to T flag
Reply With Quote #8

Quote:
Originally Posted by Bugsy View Post
ADMIN_LEVEL_H isn't the same as flag "h" in users.ini..joshknifer
Yeah i see that. Thanks for the heads up
__________________
joshknifer is offline
Send a message via Skype™ to joshknifer
kent4
Junior Member
Join Date: Oct 2011
Location: Russia, Perm
Old 11-04-2011 , 14:11   Re: help make the map a player when it comes to T flag
Reply With Quote #9

So what? can someone help here?
kent4 is offline
Send a message via ICQ to kent4
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 14:18.


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