AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Dhud in Ultimate Bans :D (https://forums.alliedmods.net/showthread.php?t=299763)

xExperienced 07-25-2017 04:33

Dhud in Ultimate Bans :D
 
I want to use Dhud in Ultimate bans with colorchat.
Whenever someone get banned it should show colorchat as well as dhud message.

Will my code work? ? Please guide me in improving the code.

Here's the original code :

Code:

get_user_authid(Target[i],AuthID1,charsmax(AuthID1));
                        get_user_ip(Target[i],IP1,charsmax(IP1),1);
                        get_user_name(Target[i],Name1,charsmax(Name1));
                        formatex(func_buffer,charsmax(func_buffer),"^x03 %s^x04 BANNED^x03 %s%s^x04 ^nBy Admin : ^x03 %s.^x01 ^n[ ^x04Reason - ^"%s^" ^x01]",Name1,is_permanent?"Permanently":"for ",STR_Duration,id?Name2:"RCON/Server",ARG_Reason);
                        set_task(handle_delay,"ChatPrint",80085,func_buffer,charsmax(func_buffer));

For Dhud support I edited it as like this :

Code:

get_user_authid(Target[i],AuthID1,charsmax(AuthID1));
                        get_user_ip(Target[i],IP1,charsmax(IP1),1);
                        get_user_name(Target[i],Name1,charsmax(Name1));
                        formatex(func_buffer,charsmax(func_buffer),"^x03 %s^x04 BANNED^x03 %s%s^x04 ^nBy Admin : ^x03 %s.^x01 ^n[ ^x04Reason - ^"%s^" ^x01]",Name1,is_permanent?"Permanently":"for ",STR_Duration,id?Name2:"RCON/Server",ARG_Reason);
                        set_task(handle_delay,"ChatPrint",80085,func_buffer,charsmax(func_buffer));
                        set_dhudmessage(255, 255, 212, 0.03, 0.23, 0, 6.0, 12.0)
                        show_dhudmessage(id, "%s has been Banned.^nDuration : %s%s ^nBy Admin : %s ^nReason : %s"),Name1,is_permanent?"Permanently":"for ",STR_Duration,id?Name2:"RCON/Server",ARG_Reason);



All times are GMT -4. The time now is 23:10.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.