Veteran Member
Join Date: Mar 2012
Location: Solar System/Earth/Belgi
05-12-2012
, 15:20
hudmessage to long?
#1
hey,
I made a lil infohelp Hudmenu that appears when players enter the server to see what client commands they all can use but i think its to long.
method 1
PHP Code:
public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ); register_clcmd ( "say help" , "func_help" ); register_clcmd ( "say /help" , "func_help" ); } public client_putinserver ( id ) { set_task ( 4.5 , "func_help" , id ); } public func_help ( id ) { set_hudmessage ( 200 , 100 , 0 , 0.67 , 0.21 , 1 , 20.0 , 20.0 , 0.5 , 0.9 , 1 ); show_hudmessage ( id , ".:}O $G {:. Hide'N'Seek Mod Help ^n\ --------------------------------------------^n\ Available Client Commands:^n\ -----------------------------^n\ - help | /help (This menu)^n\ - server | /server (Redirect Menu)^n\ - shop | /shop (HnS shopmenu)^n\ - xp | /xp (XP Upgrade menu)^n\ - /bm15 (Temp. Top 15 fastest players)^n\ - /bindme (Quick bind menu)^n\ - trail <type(1-9)> <color> ^n\ - !me <message> (status message)^n\ ^n\ \RDuring Scrim's Only ^n\ \R------------------------^n\ - /scores^n\ - /points^n\ - /wins^n\ - /rounds^n\ - /team^n\ ^n\ \RAdmins only: (Console cmd's)^n\ \R-------------------------------^n\ - hns_scrim <1|0> (Start/stop a Scrim)^n\ - hns_warmup <1|0> (Start/stop Warm up)^n\ - hns_captains (During scrim's only)^n\ --------------------------------------------" ); }
errors:
Code:
Error: Input line too long (after substitutions) on line 41
Error: Invalid string (possibly non-terminated string) on line 42
Warning: Loose indentation on line 54
Error: Undefined symbol "points" on line 54
Error: Undefined symbol "n" on line 54
Error: Undefined symbol "wins" on line 54
Error: Too many error messages on one line on line 54
Compilation aborted.
6 Errors.
Just an idea but could it work if I work with format? every line in a new format then that format i put in show_hudmessage(id, "%s^n%s^n%s.... , format1, format2, format3)
method 2
PHP Code:
public func_help ( id ) { new title [ 51 ], titleline [ 51 ], titlesub [ 51 ], titlesubline [ 51 ], line1 [ 51 ], line2 [ 51 ], line3 [ 51 ], line4 [ 51 ], line5 [ 51 ], line6 [ 51 ], line7 [ 51 ], line8 [ 51 ], line9 [ 51 ], line10 [ 51 ], line11 [ 51 ], line12 [ 51 ], line13 [ 51 ], line14 [ 51 ], line15 [ 51 ], line16 [ 51 ], line17 [ 51 ], line18 [ 51 ], line19 [ 51 ], line20 [ 51 ], line21 [ 51 ]; format ( title , 50 , ".:}O $G {:. Hide'N'Seek Mod Cmd's Info ^n" ); format ( titleline , 50 , "--------------------------------------------^n" ); format ( titlesub , 50 , "Available Client Commands:^n" ); format ( titlesubline , 50 , "-----------------------------^n" ); format ( line1 , 50 , " - help | /help (This menu)^n" ); format ( line2 , 50 , " - server | /server (Redirect Menu)^n" ); format ( line3 , 50 , " - shop | /shop (HnS shopmenu)^n" ); format ( line4 , 50 , " - xp | /xp (XP Upgrade menu)^n" ); format ( line5 , 50 , " - /bm15 (Temp. Top 15 fastest players)^n" ); format ( line6 , 50 , " - /bindme (Quick bind menu)^n" ); format ( line7 , 50 , " - trail <type(1-9)> <color>^n" ); format ( line8 , 50 , " - !me <message> (status message)^n^n" ); format ( line9 , 50 , "\RDuring Scrim's Only ^n" ); format ( line10 , 50 , "\R------------------------^n" ); format ( line11 , 50 , " - /scores^n" ); format ( line12 , 50 , " - /points^n" ); format ( line13 , 50 , " - /wins^n" ); format ( line14 , 50 , " - /rounds^n" ); format ( line15 , 50 , " - /team^n^n" ); format ( line16 , 50 , "\RAdmins only: (Console cmd's)^n" ); format ( line17 , 50 , "\R-------------------------------^n" ); format ( line18 , 50 , " - hns_scrim <1|0> (Start/stop a Scrim)^n" ); format ( line19 , 50 , " - hns_warmup <1|0> (Start/stop Warm up)^n" ); format ( line20 , 50 , " - hns_captains (During scrim's only)^n" ); format ( line21 , 50 , "--------------------------------------------^n" ); set_hudmessage ( 200 , 100 , 0 , 0.67 , 0.21 , 1 , 20.0 , 20.0 , 0.9 , 0.9 , 1 ); show_hudmessage ( id , "%s %s %s %s %s %s %s %s %s %s %s %s " , title , titleline , titlesub , titlesubline , line1 , line2 , line3 , line4 , line5 , line6 , line7 , line8 ); set_hudmessage ( 200 , 100 , 0 , 0.05 , 0.21 , 1 , 20.0 , 20.0 , 0.9 , 0.9 , 1 ); show_hudmessage ( id , "%s %s %s %s %s %s %s %s %s %s %s %s %s " , line9 , line10 , line11 , line12 , line13 , line14 , line15 , line16 , line17 , line18 , line19 , line20 , line21 ); }
This let me compiler the plugin but it only shows one of the 2 hudmessages, the last one.
tryed to test a bit with the channels but it always gives the same result: only one hudmessage wil be displayed.
And finally after tons of try's and testing I got it working.
Its not 100% efficient but it does the job
method 3
PHP Code:
public func_help ( id ) { new title [ 51 ], titleline [ 51 ], titlesub [ 51 ], titlesubline [ 51 ], line1 [ 51 ], line2 [ 51 ], line3 [ 51 ], line4 [ 51 ], line5 [ 51 ], line6 [ 51 ], line7 [ 51 ], line8 [ 51 ], line9 [ 51 ], line10 [ 51 ], line11 [ 51 ], line12 [ 51 ], line13 [ 51 ], line14 [ 51 ], line15 [ 51 ], line16 [ 51 ], line17 [ 51 ], line18 [ 51 ], line19 [ 51 ], line20 [ 51 ], line21 [ 51 ]; format ( title , 50 , ".:}O $G {:. Hide'N'Seek Mod Cmd's Info ^n" ); format ( titleline , 50 , "--------------------------------------------^n" ); format ( titlesub , 50 , "Available Client Commands:^n" ); format ( titlesubline , 50 , "-----------------------------^n" ); format ( line1 , 50 , " - help (This menu)^n" ); format ( line2 , 50 , " - server (Redirect Menu)^n" ); format ( line3 , 50 , " - shop (HnS shopmenu)^n" ); format ( line4 , 50 , " - xp (XP Upgrade menu)^n" ); format ( line5 , 50 , " - /bm15 ^n" ); format ( line6 , 50 , " - /bindme (Quick bind menu)^n" ); format ( line7 , 50 , " - trail <type(1-9)> <color>^n" ); format ( line8 , 50 , " - !me <message> (status message)^n^n" ); format ( line9 , 50 , "During Scrim's Only ^n" ); format ( line10 , 50 , "------------------------^n" ); format ( line11 , 50 , " - /scores^n" ); format ( line12 , 50 , " - /points^n" ); format ( line13 , 50 , " - /wins^n" ); format ( line14 , 50 , " - /rounds^n" ); format ( line15 , 50 , " - /team^n^n" ); format ( line16 , 50 , "Admins only: (Console cmd's)^n" ); format ( line17 , 50 , "--------------------------------^n" ); format ( line18 , 50 , " - hns_scrim <1|0> (Start/stop a Scrim)^n" ); format ( line19 , 50 , " - hns_warmup <1|0> (Start/stop Warm up)^n" ); format ( line20 , 50 , " - hns_captains (During a scrim onlyà^n" ); format ( line21 , 50 , "--------------------------------------------^n" ); set_hudmessage ( 200 , 100 , 0 , 0.67 , 0.16 , 0 , 20.0 , 20.0 , 0.9 , 0.9 , 1 ); show_hudmessage ( id , "%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s" , titlesub , titlesubline , line1 , line2 , line3 , line4 , line5 , line6 , line7 , line8 , line16 , line17 , line18 , line19 , line20 ); set_hudmessage ( 200 , 100 , 0 , 0.68 , 0.61 , 0 , 20.0 , 20.0 , 0.9 , 0.9 , 4 ); show_hudmessage ( id , "%s %s %s %s %s %s %s" , line9 , line10 , line11 , line12 , line13 , line14 , line15 ); }
Last edited by striker07; 05-12-2012 at 17:29 .