Answered Perks crashing my game?!!?

Status
Not open for further replies.

ProlixUK

Known Member
Messages
100
Reaction score
48
Points
128
so every time I use a perk it crashes my game!!
this is the code:
doPerks(a)
{
self maps/mp/zombies/_zm_perks::give_perk(a,1);
self iPrintln("Perk: "+self.Menu.System["MenuTexte"][self.Menu.System["MenuRoot"]][self.Menu.System["MenuCurser"]]+" ^2Given");
}

then in the menu structure

self addMenuOption("Sub14", "Toggle Juggernaut", ::doPerks, "specialty_armorvest");

I do get the perk just before my game crashes

please help me!! this is really pissing me off
 
Last edited:

Hamza H

Trial Moderator
Messages
93
Reaction score
92
Points
18
I recommend asking one of the coders online you can make them get a notification by doing @"Name" ill forward this to Liam or cabcon:smile:
@CabCon @Liam
 

Procyon

BANNED
Messages
325
Reaction score
119
Points
43
I recommend asking one of the coders online you can make them get a notification by doing @"Name" ill forward this to Liam or cabcon:grinning:
@CabCon @Liam
Because they're the only ones here that knows anything...

so every time I use a perk it crashes my game!!
this is the code:
doPerks(a)
{
self maps/mp/zombies/_zm_perks::give_perk(a,1);
self iPrintln("Perk: "+self.Menu.System["MenuTexte"][self.Menu.System["MenuRoot"]][self.Menu.System["MenuCurser"]]+" ^2Given");
}

then in the menu structure

self addMenuOption("Sub14", "Toggle Juggernaut", ::doPerks, "specialty_armorvest");

I do get the perk just before my game crashes

please help me!! this is really pissing me off

What are you trying to do here? Printing what your cursor hovers over? You should use a second argument instead if that is what you're trying to do.

Or it might be the fact that you are trying to call a multiplayer perk through the zombies perk system.
 
Last edited:

Procyon

BANNED
Messages
325
Reaction score
119
Points
43
First of all I never said that they know everything so stop trying to be a smart kid I said them two because they are the ones that I have asked questions and they can help.
Don't get pissy over a respons.
 

Hamza H

Trial Moderator
Messages
93
Reaction score
92
Points
18
Removed my responses to the kid because I ignored him<3 back to the point hope someone helps you.
-Hamza
 

Procyon

BANNED
Messages
325
Reaction score
119
Points
43
Removed my responses to the kid because I ignored him<3 back to the point hope someone helps you.
-Hamza
And here's one of the reasons you shouldn't just hand it out to anyone that asks.
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,745
Reaction score
2,830
Points
1,053
This is my perk function, feel free to use it:
Code:
//----------------------------------------
//Give/Take Perk
//----------------------------------------

Toggle_PlayerPerk(perk) //not used now
{
    if (!(self hasperk(perk) || self maps/mp/zombies/_zm_perks::has_perk_paused(perk)))
    {
        self doGivePerk(perk);
        self iprintln("Perk [" + perk + "] ^2Gived");
    }
    else
    {
        self notify(perk + "_stop");
        self iprintln("Perk [" + perk + "] ^1Removed");
    }
}

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");
    }
}
 
Last edited:

Hamza H

Trial Moderator
Messages
93
Reaction score
92
Points
18
This is my perk function, feel free to use it:
Code:
//----------------------------------------
//Give/Take Perk
//----------------------------------------

Toggle_PlayerPerk(perk) //not used now
{
    if (!(self hasperk(perk) || self maps/mp/zombies/_zm_perks::has_perk_paused(perk)))
    {
        if(getCurrent()== "main_perks")
            self doGivePerk(perk);
        else
            self maps/mp/zombies/_zm_perks::give_perk(perk);
        self iprintln("Perk [" + perk + "] ^2Gived");
    }
    else
    {
        self notify(perk + "_stop");
        self iprintln("Perk [" + perk + "] ^1Removed");
    }
}

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");
    }
}
Just when I was about to tag you with this thread on your profile you answered it haha:grinning:
 

ProlixUK

Known Member
Messages
100
Reaction score
48
Points
128
YEP ,Cab I used your code and everything works perfectly! thanks man
 
Status
Not open for further replies.
Top