Raised This Month: $ Target: $400
 0% 

Can't compile plugin [HELP]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Versus1994
Senior Member
Join Date: Jan 2013
Old 11-01-2013 , 08:50   Can't compile plugin [HELP]
Reply With Quote #1

Hey, I'm trying to compile this plugin and it doesnt compile, (I have colorchat). Does anyone knows what is the problem?

Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <colorchat>
 
#define VIP_LEVEL ADMIN_LEVEL_H "t"
 
new const PREFIX[] = { "!g[YourTag]!n" };
 
new VipUsed[33];
 
public plugin_init()
{
        register_plugin("VIPMenu", "1.0", "Dom1s.(zDac));
 
       RegisterHam(Ham_Spawn, "player", "OnSpawn");
       
       register_clcmd("say /vipmenu", "cmdVmenu");
}
 
public OnSpawn(id)
{
       VipUsed[id] = false;
       set_user_rendering( id, _, 0, 0, 0, _, 0 );  
}
 
public cmdVmenu(id)
{
       if(!(get_user_flags(id) & VIP_LEVEL))
       {
               client_printc(id, "%s You're not VIP member.", PREFIX);
               return PLUGIN_HANDLED;
       }
       
       if(!VipUsed[id])
       {
               switch(cs_get_user_team(id))
               {
                       case CS_TEAM_CT: VipCTMenu(id);
                       case CS_TEAM_T: VipTMenu(id);
               }
       }
       else if (VipUsed[id])
       {
               client_printc(id, "%s Wait for next Round.", PREFIX);
       }
       return PLUGIN_HANDLED;
}
 
public VipCTMenu(id)
{
       new menu = menu_create("\rV\wIP \rM\wenu:", "VipCTMenu_handler");
 
       menu_additem(menu, "\wScout no bullet", "1", 0);
       menu_additem(menu, "\wHE Grenade", "2", 0);
       menu_additem(menu, "\w+20HP", "3", 0);
       
       menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
       menu_display(id, menu, 0);
}
 
public VipCTMenu_handler(id, menu, item)
{
       if( item == MENU_EXIT )
       {
               menu_destroy(menu);
               return PLUGIN_HANDLED;
       }
 
       switch(item)
       {
               case 0:
               {
                       give_item(id, "weapon_scout");
                       cs_set_user_bpammo(id, CSW_SCOUT, 0);
                       cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_scout", id), 0);
                       ColorChat(id, NORMAL, "^x04[^x03YourTag^x04]^x01 You choosed Scout");
                       VipUsed[id] = true;
               }
               case 1:
               {
                       give_item(id, "weapon_hegrenade");
                       ColorChat(id, NORMAL, "^x04[^x03YourTag^x04]^x01 You choosed HeGrenade");
                       VipUsed[id] = true;
               }
               case 2:
               {
                       set_user_health(id, get_user_health(id) + 20);
                       ColorChat(id, NORMAL, "^x04[^x03YourTag^x04]^x01 You choosed +20 Health");
                       VipUsed[id] = true;
               }
       }
 
       menu_destroy(menu);
       return PLUGIN_HANDLED;
}
 
public VipTMenu(id)
{
       new menu = menu_create("\rV\wIP \rM\wenu:", "VipTMenu_handler");
 
       menu_additem(menu, "\wHE Grenade", "1", 0);
       menu_additem(menu, "\GGlock 2 bullets", "2", 0);
       menu_additem(menu, "\w2 FB", "3", 0);
       menu_additem(menu, "\w+30HP", "4", 0);
       menu_additem(menu, "\wSG Grenade", "5", 0);
       
       menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
       menu_display(id, menu, 0);
}
 
public VipTMenu_handler(id, menu, item)
{
       if( item == MENU_EXIT )
       {
               menu_destroy(menu);
               return PLUGIN_HANDLED;
       }
 
       switch(item)
       {
               case 0:
               {
                       give_item(id, "weapon_hegrenade");
                       ColorChat(id, NORMAL, "^x04[^x03YourTag^x04]^x01 You choosed HeGrenade");
                       VipUsed[id] = true;
               }
               case 1:
               {
                       give_item(id, "weapon_glock18");
                       cs_set_user_bpammo(id, CSW_GLOCK18, 0);
                       cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_glock18", id), 2);
                       ColorChat(id, NORMAL, "^x04[^x03YourTag^x04]^x01 You choosed Glock with 2 bullets");
                       VipUsed[id] = true;
               }              
               case 2:
               {
                       give_item(id, "weapon_flashgrenade");
                       give_item(id, "weapon_flashgrenade");
                       ColorChat(id, NORMAL, "^x04[^x03YourTag^x04]^x01 You choosed 2 Flash grenades");
                       VipUsed[id] = true;                    
               }  
               case 3:
               {
                       set_user_health(id, get_user_health(id) + 30);
                       ColorChat(id, NORMAL, "^x04[^x03YourTag^x04]^x01 You choosed +20 Health");
                       VipUsed[id] = true;
               }
               case 4:
               {
                       give_item(id, "weapon_smokegrenade");
                       ColorChat(id, NORMAL, "^x04[^x03YourTag^x04]^x01 You choosed SmokeGrenade");
                       VipUsed[id] = true;
               }
       }
 
       menu_destroy(menu);
       return PLUGIN_HANDLED;
}
 
stock client_printc(const id, const input[], any:...)
{
       new count = 1, players[32];
       static msg[191];
       vformat(msg, 190, input, 3);
       
       replace_all(msg, 190, "!g", "^x04"); // Green Color
       replace_all(msg, 190, "!n", "^x01"); // Default Color
       replace_all(msg, 190, "!t", "^x03"); // Team Color
       
       if (id) players[0] = id; else get_players(players, count, "ch");
       {
               for (new i = 0; i < count; i++)
               {
                       if (is_user_connected(players[i]))
                       {
                               message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
                               write_byte(players[i]);
                               write_string(msg);
                               message_end();
                       }
               }
       }
}
Versus1994 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-01-2013 , 09:37   Re: Can't compile plugin [HELP]
Reply With Quote #2

What are your errors?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Versus1994
Senior Member
Join Date: Jan 2013
Old 11-01-2013 , 09:47   Re: Can't compile plugin [HELP]
Reply With Quote #3

Versus1994 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-01-2013 , 09:59   Re: Can't compile plugin [HELP]
Reply With Quote #4

You forgot a quote in you register_plugin line
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Versus1994
Senior Member
Join Date: Jan 2013
Old 11-01-2013 , 10:03   Re: Can't compile plugin [HELP]
Reply With Quote #5

I know, I changed that already, but the problem isnt that, maybe:

#define VIP_LEVEL ADMIN_LEVEL_H "t" ?
Versus1994 is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 11-01-2013 , 10:45   Re: Can't compile plugin [HELP]
Reply With Quote #6

Code:
#define VIP_LEVEL ADMIN_LEVEL_H "t"
---------------------->
Code:
#define VIP_LEVEL ADMIN_LEVEL_H
&
Code:
register_plugin("VIPMenu", "1.0", "Dom1s.(zDac));
---------------------->
Code:
register_plugin("VIPMenu", "1.0", "Dom1s.(zDac)");
TheDS1337 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-01-2013 , 10:54   Re: Can't compile plugin [HELP]
Reply With Quote #7

Also, remove the braces when you define PREFIX.
__________________
fysiks is online now
Versus1994
Senior Member
Join Date: Jan 2013
Old 11-01-2013 , 14:10   Re: Can't compile plugin [HELP]
Reply With Quote #8

Thank you all!

Maybe someone could make an edition to this plugin, so that if you chose He grenade from vipmenu and you have he grenade before chosing it in the vipmenu you would get another one ant then have 2?

Is it possible?
Versus1994 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 23:13.


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