|
Junior Member
|

06-12-2014
, 17:46
Re: Help with VIP Menu
|
#3
|
Quote:
Originally Posted by Flick3rR
Your brackets in plugin_init are wrong. Take a look. Also, there are lot's of missing symbols and syntax characters in the code. And you have some undefined natives, dafuq?!
PHP Code:
set_user_longjump_force(id, 550)
set_user_longjump_height(id, 255)
set_user_longjump_cooldown(id, 5.0)
And you have many redundant new symbols. Holy mess at all. Here is the code, didn't touch the functions, only cleared from the redundant code and fixed the errors. Also, removed these unknown natives.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fun>
#include <hamsandwich>
#define ADMIN_JBVIP ADMIN_RESERVATION
new HasSpeed[33];
new bool:VipUsed[33]
new const PREFIX[] = { "!g[!nHell-Gaming!g]!n" };
public plugin_init(){
register_plugin("JailBreak_VIP", "2.0", "TheHacker1998");
RegisterHam(Ham_Spawn, "player", "FwdHamSpawn_Post", 1);
register_event("HLTV", "NewRound", "a", "1=0", "2=0");
register_event("CurWeapon", "HookCurWeapon", "be", "1=1");
//Advertise
set_task(30.0, "Task_Advertise", 0, _, _, "b")
//Add Cfg File for cvars(no need to add on amxx.cfg)
new configsDir[64];
get_localinfo("amxx_configsdir", configsDir, charsmax(configsDir))
server_cmd("exec %s/JailBreak_VIP.cfg", configsDir)
//Add lang file for messages
register_dictionary("JailBreak_VIP.txt")
//CLMDS
register_clcmd("say vmenu", "cmdVmenu");
register_clcmd("say /vmenu", "cmdVmenu");
register_clcmd("say_team vmenu", "cmdVmenu");
register_clcmd("say_team /vmenu", "cmdVmenu");
}
public cmdVmenu(id)
{
if(is_user_alive(id) && get_user_flags(id) & ADMIN_JBVIP && !VipUsed[id] )
{
VipMenu(id)
}
else if(VipUsed[id])
{
client_printc(id, "%s !g[!nHell-Gaming!g]!nVIP Menu is already used this Round!g! !nTry next Round!g!", PREFIX);
}
else
{
client_printc(id, "%s !g[!nHell-Gaming!g]!nOnly !gVIPs !ncan use the !gVIP Menu!", PREFIX);
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED
}
public VipMenu(id){
new menu = menu_create("\yJailBreak VIP Menu:^n\rby TheHacker1998", "VipMenu_handler");
menu_additem(menu, "\w225 HP and Armor", "1", 0);
menu_additem(menu, "\wLongjump - (550)", "2", 0);
menu_additem(menu, "\wGravity - (550)", "3", 0);
menu_additem(menu, "\wSpeed -(400)", "4", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
public VipMenu_handler(id, menu, item){
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:{
set_user_health(id, 225);
set_user_armor(id, 225);
VipUsed[id] = true
client_printc(id, "%s !g[!nHell-Gaming!g]!nYou Taked !g225 Health !nand !g225 Armor!n!", PREFIX);
}
case 2:{
/*set_user_longjump_force(id, 550)
set_user_longjump_height(id, 255)
set_user_longjump_cooldown(id, 5.0)*/
VipUsed[id] = true;
client_printc(id, "%s !g[!nHell-Gaming!g]!nYou Taked !gLongjump!n!", PREFIX);
}
case 3:{
set_user_gravity(id, 0.7);
client_printc(id, "%s !g[!nHell-Gaming!g]!nYou Taked !gGravity!n!", PREFIX);
}
case 4:{
VipUsed[id] = true;
HasSpeed[id] = true;
set_user_maxspeed(id, 400.0);
client_printc(id, "%s !g[!nHell-Gaming!g]!nYou Taked !gSpeed!n!", PREFIX);
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public HookCurWeapon(id){
if(HasSpeed[id]){
set_user_maxspeed(id, 400.0);
}
}
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, "!n", "^x01");
replace_all(msg, 190, "!g", "^x04");
replace_all(msg, 190, "!t", "^x03");
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();
}
}
}
}
|
Yes,im sorry this is my First plugin.
|
|