Skip to content

Instantly share code, notes, and snippets.

@gabrielsantanaa
Last active June 26, 2020 05:57
Show Gist options
  • Save gabrielsantanaa/3eb13fe445ce6000cca1c6f2612eadde to your computer and use it in GitHub Desktop.
Save gabrielsantanaa/3eb13fe445ce6000cca1c6f2612eadde to your computer and use it in GitHub Desktop.
error when enter in the afterlife
#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();
player thread startRound();
}
}
startRound()
{
for(;;)
{
level waittill( "start_of_round", player);
if(true)
{
doPerks();
break;
}
}
}
onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");
for(;;)
{
self waittill("spawned_player", player);
}
}
healthPlayer()
{
self endon("disconnect");
self.healthText = createFontString("Objective" , 1.2); //Fixed
self.healthText setPoint("CENTER", "BOTTOM", -100, 20);
while(true)
{
if(self.health == 100)
{
self.maxhealth = 130;
}
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;
}
}
doPerks()
{
self clearperks();
self setperk("specialty_additionalprimaryweapon");
self iPrintln("Perma Mule Kick Added :)");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment