Junior Member
Join Date: Jan 2014
Location: Portugal
|
08-09-2015
, 00:33
Help me please
|
#1
|
Hi guys , can help me with this plugin , can not compile the plugin error of me , someone who understands this to help me
PHP Code:
#include < amxmodx > #include < cstrike > #include < fun >
#define VERSION "0.1"
public plugin_init( ) { register_plugin( "Shop Menu 2", VERSION, "azipei" )
register_clcmd( "say /shop","surfmenu" ); } public surfmenu( id ) { new menu = menu_create( "\r[ PFA ] \ySurf Shop.", "menu_handler" ); menu_additem( menu, "\wAK47 \y( \r$5000 \y)", "1", 0 ); menu_additem( menu, "\wM4A1 \y( \r$5000 \y)", "2", 0 ); menu_additem( menu, "\wDEAGLE \y( \r$3000 \y)", "3", 0 ); menu_additem( menu, "\wM3 \y( \r$3500 \y)", "4", 0 ); menu_additem( menu, "\wAWP \y( \r$7500 \y)", "5", 0 ); menu_additem( menu, "\wHE GRENADE \y( \r$1500 \y)", "6", 0 );
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL ); menu_display( id, menu, 0 ); } public menu_handler( id, menu, item ) { if( item == MENU_EXIT ) { menu_destroy( menu ); return PLUGIN_HANDLED; }
new data[ 6 ], szName[ 64 ]; new access, callback; menu_item_getinfo( menu, item, access, data,charsmax( data ), szName,charsmax( szName ), callback );
new key = str_to_num( data ); new money = cs_get_user_money( id ) new ak47 = 5000 new m4a1 = 5000 new deagle = 3000 new awp = 7500 new he = 1500 switch( key ) { case 1: { if( money < ak47 ) { ChatColor(id, "^4[ ^3pFa. INFO ^4] ^1- Nao tens Dinheiro Suficiente para comprar AK47." ) } else { cs_set_user_money( id, money - ak47 ) give_item( id,"weapon_ak47" ) cs_set_user_bpammo( id, CSW_AK47, 90 ) } } case 2: { if( money < m4a1 ) { ChatColor(id, "^4[ ^3pFa. INFO ^4] ^1- Nao tens Dinheiro Suficiente para comprar M4A1." ) } else { cs_set_user_money( id, money - m4a1 ) give_item( id,"weapon_m4a1" ) cs_set_user_bpammo( id, CSW_M4A1, 90 ) } } case 3: { if( money < deagle ) { ChatColor(id, "^4[ ^3pFa. INFO ^4] ^1- Nao tens Dinheiro Suficiente para comprar Deagle." ) } else { cs_set_user_money( id, money - deagle ) give_item( id,"weapon_deagle" ) cs_set_user_bpammo( id, CSW_DEAGLE, 35 ) } } case 4: { if( money < m3 ) { ChatColor(id, "^4[ ^3pFa. INFO ^4] ^1- Nao tens Dinheiro Suficiente para comprar M3." ) } else { cs_set_user_money( id, money - m3 ) give_item( id,"weapon_m3" ) cs_set_user_bpammo( id, CSW_M3, 32 ) } } case 5: { if( money < awp ) { ChatColor(id, "^4[ ^3pFa. INFO ^4] ^1- Nao tens Dinheiro Suficiente para comprar AWP." ) } else { cs_set_user_money( id, money - awp ) give_item( id,"weapon_awp" ) cs_set_user_bpammo( id, CSW_AWP, 30 ) } } case 6: { if( money < he ) { ChatColor(id, "^4[ ^3pFa. INFO ^4] ^1- Nao tens Dinheiro Suficiente para comprar HE GRENADE." ) } else { cs_set_user_money( id, money - he ) give_item( id,"weapon_hegrenade" ) } } } menu_destroy( menu ); return PLUGIN_HANDLED; } public client_authorized(id) { set_task(30.0, "PrintText" ,id) } public PrintText(id) { ChatColor(id, "^4[ Portugal Fuzileiros ] ^1- Escreve ^3/shop ^1para comprares armas.") } stock ChatColor(const id, const input[], any:...) { new count = 1, players[32] static msg[191] vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // verde replace_all(msg, 190, "!y", "^1") // Default replace_all(msg, 190, "!team", "^3") // Team replace_all(msg, 190, "!team2", "^0") // Team2
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(); } } } }
Last edited by Leonardo451; 08-09-2015 at 00:37.
|
|