Skip to content

Instantly share code, notes, and snippets.

@wangyeee
Forked from Tustin/all_perks.c
Created August 8, 2017 15:02
Show Gist options
  • Save wangyeee/68d0bbcddb1b478e1a5b66dd56aa764c to your computer and use it in GitHub Desktop.
Save wangyeee/68d0bbcddb1b478e1a5b66dd56aa764c to your computer and use it in GitHub Desktop.
#using scripts\codescripts\struct;
#using scripts\shared\callbacks_shared;
#insert scripts\shared\shared.gsh;
#insert scripts\zm\_zm_utility.gsh;
//Perks
#using scripts\zm\_zm_perks;
//include these because not all maps have them
#using scripts\zm\_zm_perk_deadshot;
#using scripts\zm\_zm_perk_widows_wine;
#using scripts\zm\_zm_perk_electric_cherry;
#namespace all_perks;
function __init__() {
callback::on_spawned(&on_player_spawned);
}
function on_player_spawned() {
wait 5;
perkaholic();
self thread revived();
}
function revived() {
self endon("death");
self endon("disconnect");
while (true) {
self waittill("player_revived");
perkaholic();
WAIT_SERVER_FRAME;
}
}
function perkaholic() {
all_perks = GetArrayKeys(level._custom_perks);
foreach (value in all_perks){
self zm_perks::give_perk(value, false);
}
self IPrintLnBold("All perks given.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment