Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
x3Karma authored Jan 1, 2022
1 parent 7a24b0c commit 2ec3fb6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
26 changes: 24 additions & 2 deletions Karma.Abuse/mod/scripts/vscripts/announce.nut
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
global function AnnounceCommand
global function Announce

struct {
int red = 255
int green = 255
int blue = 0
array<string> colors
} file

void function AnnounceCommand() {
#if SERVER
AddClientCommandCallback("announce", AnnounceCMD);
AddClientCommandCallback("a", AnnounceCMD);
UpdateAnnounceColor()
#endif
}

void function UpdateAnnounceColor()
{
string cvar = GetConVarString( "announce_color" )

file.colors = split( cvar, "," )
foreach ( string admin in file.colors )
StringReplace( admin, " ", "" )

file.red = file.colors[0].tointeger()
file.blue = file.colors[1].tointeger()
file.green = file.colors[2].tointeger()
}

bool function AnnounceCMD(entity player, array < string > args) {
#if SERVER
array<entity> players = GetPlayerArray()
Expand Down Expand Up @@ -69,7 +90,7 @@ bool function AnnounceCMD(entity player, array < string > args) {
return true;
}

string newString = playername + ": ";
string newString

if (args.len() > 1) {
array < string > playersname = args.slice(1);
Expand All @@ -85,9 +106,10 @@ bool function AnnounceCMD(entity player, array < string > args) {

void function Announce(array < entity > player, string text) {
#if SERVER
UpdateAnnounceColor()
foreach(entity localPlayer in player)
{
SendHudMessage( localPlayer, text, -1, 0.4, 255, 255, 0, 0, 0.15, 4, 0.15 )
SendHudMessage( localPlayer, text, -1, 0.4, file.red, file.blue, file.green, 0, 0.15, 4, 0.15 )
}
#endif
}
4 changes: 4 additions & 0 deletions Karma.Abuse/mod/scripts/vscripts/gift.nut
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ bool function Gift(entity player, array<string> args)
{
print("Weapon ID is " + successfulweapons[0])
weaponId = successfulweapons[0]
} else if (successfulweapons.len() == 0)
{
print("Unable to detect weapon. Please try forcegift/fgift instead.")
return true;
}
break;
}
Expand Down

0 comments on commit 2ec3fb6

Please sign in to comment.