Re: help finalize the plugin
PHP Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike>
#define PLUGIN "Chance" #define VERSION "1.0" #define AUTHOR "Trickz"
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_clcmd( "say /cc","My_Menu"); }
public My_Menu(id) { new i_Menu = menu_create("\rHi, want to try your luck?", "menu_handler")
menu_additem(i_Menu, "\wAll Nades", "1", 0) menu_additem(i_Menu, "\wGravity", "2", 0) menu_additem(i_Menu, "\wSpeed", "3", 0) menu_additem(i_Menu, "\wMoney", "4", 0) menu_additem(i_Menu, "\wSuicide", "5", 0) menu_additem(i_Menu, "\wTry Chance", "6", 0) menu_additem(i_Menu, "\wNext Time", "7", 0)
menu_display(id, i_Menu, 0); }
public menu_handler(id, i_Menu, item) { new data[6], szName[64]; new access, callback; menu_item_getinfo(i_Menu, item, access, data,charsmax(data), szName,charsmax(szName), callback); new key = str_to_num(data); new rand = random_num(0,100) if(random_num(1,2,3,4,5) <= 10) switch(rand) { case 1..10: // 10% { client_print(id,print_chat,"You got all the Nades") give_item( id, "weapon_hegrenade" ); give_item( id, "weapon_flashbang" ); give_item( id, "weapon_smokegrenade" ); } case 11..20: // 10% { client_print(id,print_chat,"Your Speed:270 (def: 240)") set_user_gravity( id, 0.95 ); } case 21..30: // 10% { client_print(id,print_chat,"Your Gravity:760 (def: 800:") set_user_maxspeed (id, 270); } case 31..40: // 10% { client_print(id,print_chat,"You've got 10.000$") cs_set_user_money( id, 10000, 1 ); } case 41..100 // 60% { client_print(id,print_chat,"EpicFail: You die... :(") user_kill ( id, 0 ); }
menu_destroy(i_Menu) return PLUGIN_HANDLED }
Quote:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team
//// copy.sma
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(13 ) : w
arning 217: loose indentation
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(24 ) : w
arning 217: loose indentation
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(26 ) : w
arning 217: loose indentation
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(35 ) : w
arning 217: loose indentation
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(36 ) : w
arning 217: loose indentation
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(40 ) : w
arning 217: loose indentation
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(41 ) : e
rror 088: number of arguments does not match definition
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(47 ) : w
arning 217: loose indentation
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(54 ) : w
arning 217: loose indentation
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(59 ) : w
arning 217: loose indentation
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(59 ) : w
arning 213: tag mismatch
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(64 ) : w
arning 217: loose indentation
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(66 -- 6
7) : error 029: invalid expression, assumed zero
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(69 ) : w
arning 217: loose indentation
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(72 ) : e
rror 002: only a single statement (or expression) can follow each "case"
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(72 -- 7
3) : warning 215: expression has no effect
// E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmodx\scripting\copy.sma(74 ) : w
arning 204: symbol is assigned a value that is never used: "key"
//
// 3 Errors.
// Could not locate output file E:\CS [HOST]\HLDS 5408 [48]\cstrike\addons\amxmo
dx\scripting\compiled\copy.amx (compile failed).
//
// Compilation Time: 0,19 sec
// ----------------------------------------
Press enter to exit ...
|
|