Answered There is no emblem for the perks I give other players

jcal147

Veteran
Messages
63
Reaction score
12
Points
793
givePlayerPerk(perk)
{
player = level.players[self.Menu.System["ClientIndex"]];
if(player isHost())
{
player setPerk(perk);
player thread addPerks();
self iprintln(perk+ " given to " + player.name);
}
else
{
player setPerk(perk);
player thread addPerks();
self iprintln(perk+ " given to " + player.name);
}
}


addPerks(a)
{
self maps/mp/zombies/_zm_perks::give_perk(a);
self iPrintln("Perk: "+self.Menu.System["MenuTexte"][self.Menu.System["MenuRoot"]][self.Menu.System["MenuCurser"]]+" ^2Gived");
}
 
Last edited:

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
givePlayerPerk(perk)
{
player = level.players[self.Menu.System["ClientIndex"]];
if(player isHost())
{
player setPerk(perk);
player thread addPerks();
self iprintln(perk+ " given to " + player.name);
}
else
{
player setPerk(perk);
player thread addPerks();
self iprintln(perk+ " given to " + player.name);
}
}


addPerks(a)
{
self maps/mp/zombies/_zm_perks::give_perk(a);
self iPrintln("Perk: "+self.Menu.System["MenuTexte"][self.Menu.System["MenuRoot"]][self.Menu.System["MenuCurser"]]+" ^2Gived");
}
But do they get the 'power' of a perk?
 

jcal147

Veteran
Messages
63
Reaction score
12
Points
793
they get jugg, speed cola, double tap that is all even if i give them all of the perks(examples vultures aid, electric cherry, ect...)
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
5,093
Reaction score
2,881
Points
1,103
they get jugg, speed cola, double tap that is all even if i give them all of the perks(examples vultures aid, electric cherry, ect...)
Ok wait I will code a function for you which should work correct:
Code:
givePlayerPerk(perk)
{
    player = level.players[self.Menu.System["ClientIndex"]];
    if (!(player hasperk(perk) || (player maps/mp/zombies/_zm_perks::has_perk_paused(perk))))
    {
        player thread doGivePerk(perk);
        self iprintln(perk+ " given to ^2" + player.name);
    }
    else
    {
        self iprintln("The Player ^2"+player.name+"^7 already have this perk!");
        player notify(perk + "_stop");
        self iprintln("Go took the perk from the player!");
    }
}

doGivePerk(perk)
{
    self endon("disconnect");
    self endon("death");
    level endon("game_ended");
    self endon("perk_abort_drinking");
    if (!(self hasperk(perk) || (self maps/mp/zombies/_zm_perks::has_perk_paused(perk))))
    {
        gun = self maps/mp/zombies/_zm_perks::perk_give_bottle_begin(perk);
        evt = self waittill_any_return("fake_death", "death", "player_downed", "weapon_change_complete");
        if (evt == "weapon_change_complete")
            self thread maps/mp/zombies/_zm_perks::wait_give_perk(perk, 1);
        self maps/mp/zombies/_zm_perks::perk_give_bottle_end(gun, perk);
        if (self maps/mp/zombies/_zm_laststand::player_is_in_laststand() || isDefined(self.intermission) && self.intermission)
            return;
        self notify("burp");
    }
}
This will also take the perk if the player have it already! Enjoy!
 

jcal147

Veteran
Messages
63
Reaction score
12
Points
793
thank you so much, it was one of the last things I needed to complete my menu :smile:
 
Top