Created
June 24, 2020 22:10
-
-
Save gabrielsantanaa/057f0211e2c4fee38ec96b05dcd778b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include maps\mp\_utility; | |
#include maps\mp\zombies_zm_equipment; | |
#include common_scripts\utility; | |
#include maps\mp\gametypes_zm\_hud_util; | |
#include maps\mp\gametypes_zm\_hud_message; | |
#include maps\mp\zombies\_zm_utility; | |
#include maps\mp\zombies\_zm; | |
init() | |
{ | |
level.start_weapon = "fiveseven_zm"; | |
level.perk_purchase_limit = 9; | |
level thread onPlayerConnect(); | |
level thread drawZombiesCounter(); | |
} | |
onPlayerConnect() | |
{ | |
for(;;) | |
{ | |
level waittill("connected", player); | |
player thread healthPlayer(); | |
player thread killCount(); | |
player thread onPlayerSpawned(); | |
player thread showScore(); | |
} | |
} | |
onPlayerSpawned() | |
{ | |
self endon("disconnect"); | |
level endon("game_ended"); | |
for(;;) | |
{ | |
self waittill("spawned_player", player); | |
healthAdjust(); | |
} | |
} | |
} | |
healthAdjust() | |
{ | |
if(self.health <= 100) | |
{ | |
self iprintln("Maximum health ^2 200"); | |
self.maxhealth = 130; | |
self.health = self.maxhealth; | |
while(self.health < self.maxhealth) | |
{ | |
self.health = self.maxhealth; | |
level.cmPerkJuggHealth = getDvarIntDefault( "cmPerkJuggHealth", 250 ); | |
level.zombie_vars[ "zombie_perk_juggernaut_health" ] = level.cmPerkJuggHealth; | |
} | |
} | |
} | |
healthPlayer() | |
{ | |
self endon("disconnect"); | |
self.healthText = createFontString("Objective" , 1.2); //Fixed | |
self.healthText setPoint("CENTER", "BOTTOM", -100, 20); | |
while(true) | |
{ | |
self.healthText setText( "^2HP: ^7"+ self.health); | |
wait 0.1; | |
} | |
} | |
drawZombiesCounter() | |
{ | |
level.zombiesCounter = createServerFontString("Objective" , 1.3); | |
level.zombiesCounter setPoint("CENTER", "BOTTOM", -160, 20); | |
level thread updateZombiesCounter(); | |
} | |
updateZombiesCounter() | |
{ | |
oldZombiesCount = get_current_zombie_count(); | |
while(true) | |
{ | |
newZombiesCount = get_current_zombie_count(); | |
wait 0.4; | |
if(oldZombiesCount != newZombiesCount) | |
{ | |
level thread updateZombiesCounter(); | |
return; | |
} | |
else | |
{ | |
if(newZombiesCount != 0) | |
level.zombiesCounter.label = &"Zumbis: ^1"; | |
else | |
level.zombiesCounter.label = &"Zumbis: ^5"; | |
level.zombiesCounter setValue(newZombiesCount); | |
} | |
} | |
} | |
killCount() | |
{ | |
i = 0; | |
while( i < level.players.size) | |
{ | |
if(level.players[i] == self) | |
{ | |
self thread killCountSelf(level.players[i]); | |
} | |
i++; | |
wait 0.2; | |
} | |
} | |
killCountSelf(thisPlayer) | |
{ | |
self.kill = createFontString("small" , 1.2); //Fixed | |
self.kill setPoint("CENTER", "BOTTOM", -40, 20); | |
while(true) | |
{ | |
self.kill.label = &"^3Baixas: ^7"; | |
self.kill setValue(thisPlayer.kills); | |
wait 0.4; | |
} | |
} | |
showScore() | |
{ | |
self.scoreShow = createFontString("small" , 1.2); //Fixed | |
self.scoreShow setPoint("CENTER", "BOTTOM", 40, 20); | |
while(true) | |
{ | |
self.scoreShow.label = &"^6Score: ^7"; | |
self.scoreShow setValue(self.score); | |
wait 0.25; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment