Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
08-19-2014
, 05:55
Two wrong plugins: not giving anything and not doing anything
#1
Hey. So I got two wrong plugins. One of them was supposed to give a deagle. The other one was supposed to restart the server at /restart and set the server to knife-only on /lame. Well... I checked the code a thousand times and I still find it perfectly ok. So... what on Earth's wrong?
Here's the warmup one:
Spoiler
PHP Code:
#include <amxmodx> #include <amxmisc> #pragma semicolon 1 #define ACCESS ADMIN_KICK new PLUG [] = "Ecila warmup" ; new VERS [] = "1.0" ; new AUTH [] = "EpicKiller" ; new bool : WarmUp ; public plugin_init () { register_plugin ( PLUG , VERS , AUTH ); register_event ( "CurWeapon" , "cmdCurWeapon" , "be" , "1=1" , "2!29" ); register_logevent ( "warmup_end" , 2 , "1=Round_End" ); register_clcmd ( "say /start" , "cmdStart" ); register_clcmd ( "say_team /start" , "cmdStart" ); register_clcmd ( "say /lame" , "cmdLame" ); register_clcmd ( "say_team /lame" , "cmdLame" ); } public cmdStart ( id ) { if( get_user_flags ( id ) & ACCESS ) { server_cmd ( "sv_restart 1" ); color_print ( 0 , ".v[ECL] .xAcum incepe jocul! .eGood luck and have fun!" ); } else color_print ( id , ".v[ECL] .xNu ai acces la aceasta comanda!" ); return PLUGIN_HANDLED ; } public cmdCurWeapon ( id ) { if( WarmUp ) engclient_cmd ( id , "weapon_knife" ); } public cmdLame ( id ) { if( get_user_flags ( id ) & ACCESS ) { WarmUp = true ; color_print ( 0 , ".v[ECL] .xRunda de incalzire, lame only! .eGet ready!" ); } else color_print ( id , ".v[ECL] .xNu ai acces la aceasta comanda!" ); return PLUGIN_CONTINUE ; } public warmup_end () { WarmUp = false ; } stock color_print (const id , const input [], any :...) { new count = 1 , players [ 32 ]; static msg [ 191 ]; vformat ( msg , 190 , input , 3 ); replace_all ( msg , 190 , ".v" , "^4" ); /* verde */ replace_all ( msg , 190 , ".g" , "^1" ); /* galben */ replace_all ( msg , 190 , ".e" , "^3" ); /* ct=albastru | t=rosu */ replace_all ( msg , 190 , ".x" , "^0" ); /* normal-echipa */ 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 (); } } } }
And here's the deagle one:
Spoiler
PHP Code:
#include <amxmodx> #include <cstrike> #include <fun> #pragma semicolon 1 new PLUG [] = "Deagle giveaway" ; new VERS [] = "2.0" ; new AUTH [] = "EpicKiller" ; new tag ; new ammo ; public plugin_init () { register_plugin ( PLUG , VERS , AUTH ); register_clcmd ( "say /dgl" , "cmdDeagle" ); register_clcmd ( "say_team /dgl" , "cmdDeagle" ); tag = register_cvar ( "deagle_required_tag" , "# Ecila" ); ammo = register_cvar ( "deagle_ammo" , "35" ); } public cmdDeagle ( id ) { new name [ 32 ]; get_user_name ( id , name , charsmax ( name )); new req_tag [ 12 ]; get_pcvar_string ( tag , req_tag , charsmax ( req_tag )); if( contain ( name , req_tag ) != - 1 ) { new ammo_num = get_pcvar_num ( ammo ); give_item ( id , "weapon_deagle" ); cs_set_user_bpammo ( id , CSW_DEAGLE , ammo_num ); } return PLUGIN_HANDLED ; }
These are both compilable, but not doing their job.
Please help!
__________________
~ Swiftly and with style ~
Last edited by EpicKiller; 08-19-2014 at 07:32 .