Raised This Month: $ Target: $400
 0% 

[HELP] Check this code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 02-24-2017 , 21:15   Re: [HELP] Check this code
Reply With Quote #2

errors fixed :
PHP Code:
/**
 * Nozgaming.eu VIP Management 1.0 (c) Lawnmoverman
 * www.nozgaming.eu | cs.nozgaming.eu
 *
 * Precache vip player models in your sub plugin
 * This plugin should be last in your plugins.ini list
**/

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike> 
#include <fun> 
#include <hamsandwich> 
#include <chatcolor>
#include <dhudmessage>

new UserName[32];
/*new SteamID[34];
new UserID[3];*/
new CsTeams:g_iTeam[33];
/*new bool:HasSite;*/

public plugin_init()
{
    
register_plugin("Nozgaming.eu VIP Management""1.0""Lawnmoverman");
    
register_event("TeamInfo""event_TeamInfo""a");
}

// Tell to all that VIP joined the server
public client_putinserver(id)
{
    if(
get_user_flags(id) & read_flags("s"))
    { 
        
get_user_name(idUserNamecharsmax(UserName));

        
client_print_color(00,"^3[Vip] ^4User^3 %s ^4have joined the server, ^3VIP ^4priveleges granted!"UserName);
    }
}

// Set VIP model to player
public fw_spawn_post(id
{
    if(
get_user_flags(id) & read_flags("s"))
    {
        if (!
is_user_alive(id)) 
            return 
HAM_IGNORED;
        
        new 
CsTeams:team cs_get_user_team(id); 
        
cs_set_user_model(idteam == CS_TEAM_CT "noz_vip_ct" "noz_vip_t"); // Your model names here 
        
        
return HAM_IGNORED;
    }
    return 
PLUGIN_HANDLED;
}

// VIP extras on spawn
public player_spawn(id
{
    if(
get_user_flags(id) & read_flags("s"))
    {
        if (!
is_user_alive(id)) 

        
cs_set_user_money(id, (cs_get_user_money(id) + 500)); // Gives extra $500 on every spawn
        // Gives 2 flashbangs and 1 smokegrenade
        
give_item(id,"weapon_flashbang");
        
give_item(id,"weapon_flashbang");
        
give_item(id,"weapon_smokegrenade");

        
set_user_health(id120); // Sets user health to 120

        
set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,30); // Makes player semi transparent
        
set_task(5.0"renderNormal"id); // Makes player normal after 5 secs

        // Gives defuser if CT
        
if( is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT )
        {
            
cs_set_user_defuse(id1);
        } 
    } 
}

// Makes player rendering normal
public renderNormal(id)
{
    
set_user_rendering(idkRenderNormal);
}

// Events on VIP when changing team, or when joining team for the first time
public event_TeamInfo(id)
{
    if(
get_user_flags(id) & read_flags("s"))
    {    
        static 
sTeam[16];
        static const 
iTeamLen sizeof(sTeam) - 1;
        
read_data(2sTeamiTeamLen);
        
        static 
CsTeams:iTeam;
        switch(
sTeam[0])
        {
            case 
'U'iTeam CS_TEAM_UNASSIGNED;
            case 
'T'iTeam CS_TEAM_T;
            case 
'C'iTeam CS_TEAM_CT;
            case 
'S'iTeam CS_TEAM_SPECTATOR;
        }
        
        static 
idid read_data(1);
        if(
g_iTeam[id] != iTeam)
        {
            
// VIP joined new team
            
get_user_name(idUserNamecharsmax(UserName));

            if(
iTeam == CS_TEAM_T)
            {
                
// This will alert all players that VIP joined Ts
                
client_print_color(00,"^3[Vip] ^4User^3 %s ^4have joined the ^3Terrorists ^4team!"UserName);
            }
            if(
iTeam == CS_TEAM_CT)
            {
                
// This will alert all players that VIP joined CTs
                
client_print_color(00,"^3[Vip] ^4User^3 %s ^4have joined the ^3Counter-Terrorists ^4team!"UserName);
            }
            else
            {
                
// This will alert all players that VIP joined Spectators
                
client_print_color(00,"^3[Vip] ^4User^3 %s ^4have gone to ^3Spectators^4!"UserName);
            }
            
            if(
g_iTeam[id] == CS_TEAM_UNASSIGNED)
            {
            
// VIP joins team for the first time
            
set_task(10.0"alertPlayer"id);
            
set_task(10.0"setupVIP_3rdparty"id);
            }
        }
        
g_iTeam[id] = iTeam;
        return 
PLUGIN_CONTINUE;
    }
    return 
PLUGIN_HANDLED;
}

// This code alerts player that he is VIP, this is called after 10 secs, when player joins team for the first time 
public alertPlayer(id)
{
    
get_user_name(idUserNamecharsmax(UserName));
    
client_print_color(id0,"^3[Vip] ^4Welcome^3 %s ^4, you have ^3VIP ^4access, priveleges granted!"UserName);
    
set_dhudmessage4479255, -1.00.2526.03.00.11.5 );
    
show_dhudmessage(id"[Vip] Special priveleges granted!");
    
client_cmd(id"spk ^"access granted^"");
}

// Third party plugin commands to execute on VIP, when he joins team for the first time
public setupVIP_3rdparty(id)
{
    
server_cmd("amx_speed #%d ON 106"get_user_userid(id));
    
server_cmd("amx_autobhop #%d 1"get_user_userid(id));

yas17sin is offline
Send a message via ICQ to yas17sin
 



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 20:56.


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