From fc41704d152bd3791af344211091e6f6dbb76519 Mon Sep 17 00:00:00 2001 From: Nick // Cahz Date: Mon, 14 Jun 2021 06:17:38 -0700 Subject: [PATCH] Add files via upload --- .../Precompiled/_zm_givepoints.gsc | Bin 0 -> 1762 bytes Zombies Mods/Give Points Command/README.md | 7 ++ .../Source Code/_zm_givepoints.gsc | 73 ++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 Zombies Mods/Give Points Command/Precompiled/_zm_givepoints.gsc create mode 100644 Zombies Mods/Give Points Command/README.md create mode 100644 Zombies Mods/Give Points Command/Source Code/_zm_givepoints.gsc diff --git a/Zombies Mods/Give Points Command/Precompiled/_zm_givepoints.gsc b/Zombies Mods/Give Points Command/Precompiled/_zm_givepoints.gsc new file mode 100644 index 0000000000000000000000000000000000000000..06b32bdacd1644f9a64f51a7e0153d3e8085e357 GIT binary patch literal 1762 zcma)6U1%It7(Msyti}G-L{CHxMS9l-MZSx~ZC^sH}k?YN$I*b|;&`-JNx3 zcI_4kL4wqP21F1%>2Zw=`gg_&cM@)H8)ch$9(thEcI=e!5aiTW+P` zpSMbW!SaJf(e*}2_o9u!ExSPr1+P-^s+M1ORZ7otszqk_b_-p12YHdY zTP^t@2HtBh;C6(31YX&D!>J=(a+~b#`;A3rq2vTnt16Yzw95@OS^$-0)jU$4Ugo(? zDtA48!K*t6oN^h4U9LNJv1KgVzL9@yd@Ov7{A8!NyQm9ZWzlu~H21`1s`83kZTME; zS2l1ssTer|LCI%SJSe zvEFxY;*BxJo;Te$hq(H_-Ru5RRETCa|si z**m*Hf4q&PI4DeUP9(5{zLyf{5zN$vV#mw`MuZ+4#gG6}ayXU}!@B4-kQVc2Gxz~! zOqYj8fl0;_$cmZM!!R{Lr)jFhv`|qX$G9RYPvJE2Nu2tRdilTVGdK-Xm-Cut#Pi9NIFm(sH;bg&gKVQN292h$p2%PenixFV zRJWZpuqJvq^VCxZFq1g~bu)Dbb*BV2MDD;C)|FoN9Sj<4LdSENdbkBJ0&J-mH+fS; zg;CvY<|VK#a(u$HNJA};ld8JAow|L}Jh0bqzuc>f@}l0oFcSk(DTQZEjL5;G;0@3p zYhzlP>@Ini1v$@mHfbzKr8&oc5Z`Gm+?%dm>Z9D8E)FLwIg`+@j(=M@Mg^?TVvBq;!2=NK=An{Y8DWupWzQvq#^j#v~VeXg2 z9`^i(I6}NkObbn1Bi^GuPTh;NEVtO^`8au<^ +- THIS WILL ONLY WORK ON DEDICATED SEVERS - PLUGINS ARE NOT LOADED IN CUSTOM GAMES +- Download @fed's t6-gsc-utils plugin and place the .dll file inside gameserver/t6r/data/plugins https://github.com/fedddddd/t6-gsc-utils \ No newline at end of file diff --git a/Zombies Mods/Give Points Command/Source Code/_zm_givepoints.gsc b/Zombies Mods/Give Points Command/Source Code/_zm_givepoints.gsc new file mode 100644 index 0000000..d4b3e82 --- /dev/null +++ b/Zombies Mods/Give Points Command/Source Code/_zm_givepoints.gsc @@ -0,0 +1,73 @@ +#include maps\mp\_utility; +#include common_scripts\utility; +#include maps\mp\gametypes_zm\_hud_util; +#include maps\mp\gametypes_zm\_hud_message; + +init() +{ + level thread onPlayerConnect(); +} + +onPlayerConnect() +{ + for(;;) + { + level waittill("connected", player); + player thread onPlayerMessage(); + } +} + +onPlayerMessage() +{ + level endon( "game_ended" ); + for (;;) + { + level waittill("say", player, message ); + message_strings = strToK( message, " " ); + for( i = 0; i < level.players.size; i++ ) + { + if( tolower( message_strings[ 0 ] ) == "/give" && isSubStr( tolower( getPlayerName( level.players[ i ] )), message_strings[ 1 ] ) ) + { + value = int( message_strings[ ( message_strings.size - 1 ) ] ); + if( value < 0 ) + value = ( value * -1 ); + player give_points( level.players[ i ], int( value )); + } + } + } +} + +give_points( player, var ) +{ + if( !isDefined( self.giving_points ) ) + { + self.giving_points = true; + if ( player.score == 1000000 ) + self tell( getPlayerName( player ) + " already has ^51000000 ^7points" ); + else if( self.score >= var ) + { + self maps/mp/zombies/_zm_score::minus_to_player_score( var, 1 ); + self tell( "^1Gave ^7" + getPlayerName( player ) + " ^1" + var + " ^7points" ); + player maps/mp/zombies/_zm_score::add_to_player_score( var, 1 ); + player tell( "^2" + getPlayerName( self ) + " ^7gave you ^2" + var + " ^7points" ); + } + else + self tell( "^1You don't have enough points for that" ); + wait 1; + self.giving_points = undefined; + } +} + +getPlayerName( player ) +{ + playerName = getSubStr( player.name, 0, player.name.size ); + for( i = 0; i < playerName.size; i++ ) + { + if( playerName[ i ] == "]" ) + break; + } + if( playerName.size != i ) + playerName = getSubStr( playerName, i + 1, playerName.size ); + + return playerName; +}