Raised This Month: $ Target: $400
 0% 

Desperatly need help.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-pK
New Member
Join Date: Dec 2008
Old 12-20-2008 , 09:11   Desperatly need help.
Reply With Quote #1

I decided to make a custom plugin for my private server, from 4 others, though different, since none was that complete.
The original plugins you can find on the forum, I don't have time to find and post the links.
What does the plugin do? Shortly, get user flags, change model if vip, owner, or god, and change name on the score table + advertising.

Problem is compiling the .sma.
On the web compiler i got 26 errors, and don't know how to fix em. They are the same: input line too long (after substitutions).

If you know how to play sounds when a vip joins the server please add that to the plugin, and post it (That would be the beta version).
You can change the models if you want, the original ones can be dlded from http://download.extream.ro/cstrike/models/player/

I thank you all anticipated.


Here is the code:

Code:


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


#define PLUGIN  "Multi rang de Admin Plugin" 
#define VERSION "1.0" 
#define AUTHOR  "ParkouR"
#define VIP_ACCESS ADMIN_LEVEL_T

new loc[200];

new vip_cost;
new vip_tag;

new vip_adminname;
new vip_adminemail;
new vip_adminemailadress;

new vip_advertise;

new vip_website_on;
new vip_website;

new SayText;

new temp[200];

new maxplayers;
new admincvar;


public plugin_init() { 
    register_plugin( PLUGIN, VERSION, AUTHOR ); 
    set_task( 2.0, "PK Admin Rank", 0, "", 0, "b" ); 
    
    maxplayers = get_maxplayers() 
    admincvar = register_cvar("amx_showadmins","1");

    register_clcmd("say /vip", "vip_status", -1, "Arata daca esti VIP");
    register_clcmd("say /vipinfo", "show_vip_motd", -1, "Info VIP");
    
    vip_adminname = register_cvar("vip_adminname", "parkour_kz", ADMIN_LEVEL_T);
    vip_adminemailaddress = register_cvar("vip_adminemail", "[email protected]", ADMIN_LEVEL_T);
    vip_cost = register_cvar("vip_cost", "1 Euro credit pe telefon", ADMIN_LEVEL_T);
    vip_tag = register_cvar("vip_tag", "-=[<[VIP]>]=- ", ADMIN_LEVEL_T);
    vip_advertise = register_cvar("vip_advertise", "1", ADMIN_LEVEL_T);
    
    vip_website_on = register_cvar("vip_website_on", "0", ADMIN_LEVEL_T);
    vip_website = register_cvar("vip_website", "http://parkour.forumz.ro", ADMIN_LEVEL_T);
    
    SayText = get_user_msgid("SayText");
    
    RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)  
    
    new temp[200];
    get_configsdir(temp, 199);
    
    formatex(loc, 199, "%s/vipinfo.txt", temp);

        register_event("ResetHUD", "resetModel", "b")
        return PLUGIN_CONTINUE
} 

public plugin_precache() {
        precache_model("models/player/jason/jason.mdl")
    precache_model("models/player/arcpredMD22/arcpredMD22.mdl")

        return PLUGIN_CONTINUE
}

public client_putinserver(id)
{
    set_task(2.0, "client_putinserver", id);
    
    static name[32],new_name[32];
    get_user_name(id,name,31);

    if(get_user_flags(id) == read_flags("abitw")) // VIP
    {
        if(containi(name,"-= [VIP] =-") !=-1)
        return;
        
        formatex(new_name,31,"-= [VIP] =- %s",name);   
        set_user_info(id,"name",new_name);
        set_task(0.5,"slot_color");
        cs_set_user_model(id, "jason");
    }
    
    else if(get_user_flags(id) == read_flags("binouw")) // Hooker
    {
        if(containi(name,"[Epsilon]") !=-1)
        return;
        
        formatex(new_name,31,"[Epsilon] %s",name);      
        set_user_info(id,"name",new_name)
        set_task(0.5,"moderator_color");
    }

    else if(get_user_flags(id) == read_flags("bcijouw")) // Moderator
    {
        if(containi(name,"[Delta]") !=-1)
        return;
        
        formatex(new_name,31,"[Delta] %s",name);      
        set_user_info(id,"name",new_name)
        set_task(0.5,"moderator_color");
    }
    
    else if(get_user_flags(id) == read_flags("bcdefijouw")) // Administrator
    {
        if(containi(name,"[Gamma]") !=-1)
        return;
        
        formatex(new_name,31,"[Gamma] %s",name);   
        set_user_info(id,"name",new_name)
        set_task(0.5,"administrator_color");
    }
    
    else if(get_user_flags(id) == read_flags("bcdefghijkmnopqrstuw")) // God WannaBE
    {
        if(containi(name,"[Beta]") !=-1)
        return;
        
        formatex(new_name,31,"[Beta] %s",name);      
        set_user_info(id,"name",new_name)
        set_task(0.5,"semi_god_color");
    }
    else if(get_user_flags(id) == read_flags("abcdefghijkmnopqrsuw")) // God
    {
        if(containi(name,"[Alpha]") !=-1)
        return;
        
        formatex(new_name,31,"[Alpha] %s",name);      
        set_user_info(id,"name",new_name)
        set_task(0.5,"god_color");
    }
    else if(get_user_flags(id) == read_flags("abcdefghijlmnopqrsuyw")) // Owner
    {
        if(containi(name,"[Omega]") !=-1)
        return;
        
        formatex(new_name,31,"[Omega] %s",name);   
        set_user_info(id,"name",new_name)
        set_task(0.5,"owner_color");
        cs_set_user_model(id, "arcpredMD22");

    }
}

public fwHamPlayerSpawnPost(id) 
{
    advertise_vip(id);
    
    if(get_user_flags(id) & VIP_ACCESS)
    {
        cs_set_user_scoreattrib(id, 4);
    }    
    return PLUGIN_HANDLED;
}

public client_disconnect(id)
{
    remove_task(id)
}


public vip_status(id)
{
    static Adminname[33];
    static Adminemail[33];
    static gTag[33];
    
    get_pcvar_string(vip_adminname, Adminname, 32);
    get_pcvar_string(vip_adminemail, Adminemail, 32);
    get_pcvar_string(vip_tag, gTag, 32);
    
    if(get_user_flags(id) & VIP_ACCESS)
    {
        print(id, "Esti un VIP. Multumim pentru donatie");
    }
    else
    {
        print(id, "Nu esti inca VIP. Contacteaza ^x03^"%s^"^x01 pe YM sau la email ^x03^"%s^"^x01 daca vrei sa cumperi acces VIP", Adminname, Adminemail)
    }
}

public show_vip_motd(id)
{
    show_motd(id, loc, "Info VIP!"); 
}

public taskShowInfo(id)
{
    advertise_vip(id);
    
    return PLUGIN_CONTINUE;
}

public advertise_vip(id)
{
    if(get_pcvar_num(vip_advertise) == 1)
    {
        static Adminname[33];
        static Adminemail[33];
        static Website[33];
        static VipCost[33];
        
        get_pcvar_string(vip_adminname, Adminname, 32);
        get_pcvar_string(vip_adminemail, Adminemail, 32);
        get_pcvar_string(vip_website, Website, 32)
        get_pcvar_string(vip_cost, VipCost, 32);
        
        print(id, "Vrei sa fii un VIP? Costa ^"^x03%s^x01^" si ai cateva beneficii!", VipCost);
        print(id, "Pentru detalii contacteaza ^"^x03%s^x01^" say da un mail la ^"^x03%s^x01^"", Adminname, Adminemail);
        

        if(get_pcvar_num(vip_website_on) == 1)
        {
            print(id, "Poti gasi mai multe informatii pe forum: ^"^x03%s^x01^"", Website)
        }
    }
    return 1;
}

public adminsonline() { 
    
    new id, count 
    
    for(id = 1 ; id <= maxplayers ; id++) 
        if(is_user_connected(id)) 
        if(get_user_flags(id) & ADMIN_KICK) 
        count++
    
    if(get_pcvar_num(admincvar) ==1)
    {
        
        if (count>0)
        {
            
            if (count==1) {
                set_hudmessage(250, 0, 0, 0.15, 0.00, 0, 6.0, 3700.0 ); 
                show_hudmessage(0, "Concurs cu premii in bani http://parkour.forumz.ro, la sectiunea Concurs",count );
            }
            else {
                set_hudmessage(250, 0, 0, 0.15, 0.00, 0, 6.0, 3700.0 ); 
                show_hudmessage(0, "Pentru admine, plangeri si conspiratii intrati pe forum http://parkour.forumz.ro",count );
            }
        }
        else
        {
            set_hudmessage(0, 212, 255, 0.15, 0.00, 0, 6.0, 3700.0 ); 
            show_hudmessage(0, "Pentru admine, unban si inscriere concurs contact owner la Y!M: parkour_kz",count );        
        }
    }
    
}





stock cs_set_user_scoreattrib(id, attrib = 0)
{
    message_begin(2, get_user_msgid("ScoreAttrib"), {0,0,0}, 0)
    write_byte(id)
    write_byte(attrib)
    message_end()
}

stock print(index, const fmt[], any:...)
{
    static gTag[33];
    get_pcvar_string(vip_tag, gTag, 32);
    
    new message[192];
    vformat(message, 191, fmt, 3);
    
    new finalmsg[192];
    formatex(finalmsg, 191, "^x04%s ^x01%s", gTag, message);
    message_begin(MSG_ONE, SayText, _, index);
    write_byte(index);
    write_string(finalmsg);
    message_end();
}


public resetModel(id, level, cid) {
        if (get_user_flags(id) & ADMIN_KICK) {
                new CsTeams:userTeam = cs_get_user_team(id)
                if (userTeam == CS_TEAM_T) {
                        cs_set_user_model(id, "admin_te")
                }
                else if(userTeam == CS_TEAM_CT) {
                        cs_set_user_model(id, "admin_ct")
                }
                else {
                        cs_reset_user_model(id)
                }
        }

        return PLUGIN_CONTINUE
}



public slot_color(id) client_cmd(id,"con_color 204 204 204") // gray
public moderator_color(id) client_cmd(id,"con_color 0 0 255") // blue
public administrator_color(id) client_cmd(id,"con_color 255 255 0") // yellow
public semi_god_color(id) client_cmd(id,"con_color 0 153 0") // green
public god_color(id) client_cmd(id,"con_color 102 0 0") // dark red   
public owner_color(id) client_cmd(id,"con_color 255 0 0") // red
Attached Files
File Type: sma Get Plugin or Get Source (pk_adminrank.sma - 457 views - 8.1 KB)
-pK is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 12-20-2008 , 09:54   Re: Desperatly need help.
Reply With Quote #2

Actually the code shows these errors:
Code:
/home/groups/amxmodx/tmp3/textZHeDn3.sma(44) : error 017: undefined symbol "ADMIN_LEVEL_T"
/home/groups/amxmodx/tmp3/textZHeDn3.sma(45) : error 017: undefined symbol "vip_adminemailaddress"
/home/groups/amxmodx/tmp3/textZHeDn3.sma(45) : error 017: undefined symbol "ADMIN_LEVEL_T"
/home/groups/amxmodx/tmp3/textZHeDn3.sma(45) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/textZHeDn3.sma(45) : fatal error 107: too many error messages on one line
I think they are pretty easy to fix, just watch ADMIN_LEVEL_T ye, you use it and it's not defined, then just fix it... -/-
SnoW is offline
Send a message via MSN to SnoW
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 09:11.


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