make a if statement then.
If player have all perks, then remove or refuse buy or money gain...
Im editing quarantine chaos zombie mod and i added in the menu random perk option. But i have one big problem:
even when the player has all perks nothing can stop him spending more cash.
Please help...thx
make a if statement then.
If player have all perks, then remove or refuse buy or money gain...
Something like:
if((self.perkz[steadyaim]==0||1)&&(self.perkz[sitrep]==0||1))
{
...
}else{
println("You have all perks!");
}
or
if((self.perkz[steadyaim]==0)||(self.perkz[steadyaim]==1)&&(self.perkz[sitrep]==0)||(self.perkz[sitrep]==1))
{
...
}else{
println("You have all perks!");
}
??
Last edited by MuLtiHuN7eR; 08-31-2011 at 03:06 AM.
Last edited by Jorndel; 08-31-2011 at 03:11 AM.
it clears sepicific perk temporary (you can give the perk at any time you want)Code:self unsetPerk("perk");
Last edited by dsds1; 08-31-2011 at 05:44 AM. Reason: wrong defenation
mah mistake, but I've got question and different answer at same time
question:in logical meaning, you did anybody got ALL perks?
answer for topic:hmm, Jorndel is right, you can use if statement but it will take too long, there is many ways to do the same thing but in shorter time
way 1:
make giving perk increases variable integer(name a new one at onPlayerSpawned and in above for(; statement), and if someone got the same perk again, do not increase the variable, put else statement for it, then if variable could'nt increase;the perks in player is full, put the if statement
way 2:Code:if(self.gotperk == the number of all perks) //note:this is an example
similar to way one, but this changes your mod logic
if player got all perk, name a new notify to self
then at increasing cash thread, putCode:self notify("selfgotallperks");
hope helpedCode:self endon("selfgotallperks");
This made some sense but not so good.
1: Explain in easy-clean-text
2: Tell how he is going to use it, and a example of that.
3: Include extra information.
4: What he/she can do to solve the problem or problems that occurs.
I know, how this may sound.
But just to help YOU to improve your Help threads & Answers.
(Well, I don't do this all the time myself, but step 1 is important.)
EDIT:
Well, I though I should feedback you.
Well, as I see this, there is just 1 WAY. not 3....
And, you got some other ways to do this.
1: Make a array list of all the perks.
2: Notify when the player buyd a perk, and what perk it was.
And when notifyed change a value of something. like:
But the easyest is to make a "Base" Array list of all the perks.Code:p1 = 0; self notify("perk1"); p1 = 1;
OR
When the user buy the perk, it will removed/hiden. From the menu.
And then the buy option for the perk he allready got is hiden/removed.
I think this is the easyest way to do it.
If he buy, remove/hide if for that player.
Last edited by Jorndel; 08-31-2011 at 06:28 AM.
thanks Jordnel, anyway(talking to the topic poster) here what you must do in step one:
first, in _rank.gsc find forsecond, like I said, add new integer variableCode:onPlayerSpawned()
step 3:Code:onPlayerSpawned() { self endon("disconnect"); self.gotperk = 0; for(;;) { self waittill("spawned_player"); //other call of threads } }
like Jordnel's replay, put if statements in player got perk
step 4:Code:if(self _hasperk("perk"))
Code:if(self.gotperk == number of all perks)yeaaaaaaaah, now you are talking aboutOriginally Posted by Jordnel
like this topic poster:
put array list like what jordnel said
thenCode:self.gotperk = [];
make new for statement like this
Code:for(i = 0; i < 19; i++) { self.gotperk[i] self waittill("boughtperk"); self iPrintLnBold("perk bought"); }
Last edited by dsds1; 08-31-2011 at 06:38 AM.