Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Prevent something from resetting next S&D round
#1
So let's say I want to do
self.stuff = 1;
on player connect, but when a round switches in Search & Destroy, it will run onPlayerConnect, init, and whatever again.

How do I prevent it from running a variable every round and only the first, without causing an 'uninitialized variable' error?
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply

#2
self.pers["persistent_var"] = "herpderp";
[Image: MaEIQ.png]
Reply

#3
Thank you kindly. And I suppose
Code:
if(!game["roundsplayed"])
self.pers["LVL"] = 1;
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply

#4
(09-06-2011, 19:13)AZUMIKKEL Wrote: Thank you kindly. And I suppose
Code:
if(!game["roundsplayed"])
self.pers["LVL"] = 1;

are you checking for an undefined variable or if it is just false?
BTW: to prevent auto-set back to 1

Code:
if(!game["roundsplayed"] && !isDefined(self.pers["LVL"]))
self.pers["LVL"] = 1;
[Image: b_560_95_1.png]
Reply

#5
(09-06-2011, 20:20)Nukem Wrote:
(09-06-2011, 19:13)AZUMIKKEL Wrote: Thank you kindly. And I suppose
Code:
if(!game["roundsplayed"])
self.pers["LVL"] = 1;

are you checking for an undefined variable or if it is just false?
BTW: to prevent auto-set back to 1

Code:
if(!game["roundsplayed"] && !isDefined(self.pers["LVL"]))
self.pers["LVL"] = 1;

I already told him : - )
[Image: MaEIQ.png]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help [C#] WebClient how to know real url [solved] narkos 21 13,079 09-09-2013, 15:21
Last Post: surtek
Information Help How to edit new derived entry? (Solved) SSonic70 1 2,756 08-20-2013, 15:29
Last Post: Nekochan
  Help Resetting a "wait"? DidUknowiPwn 3 2,917 08-17-2013, 15:37
Last Post: DidUknowiPwn
  Round Ended MuuRzA737 1 2,226 06-12-2013, 21:34
Last Post: Nekochan
  On "round end" and "round start" DjTranceFire 2 2,738 05-10-2013, 16:07
Last Post: Nekochan
  Help [solved]red hitmark mod? founderlj 7 4,805 12-30-2012, 23:06
Last Post: Pozzuh
  !weapon Plugin help pls [solved] Hallla 0 1,988 12-30-2012, 14:04
Last Post: Hallla
  Help !giveammo Plugin doesnt work [solved] Hallla 3 3,581 12-29-2012, 20:53
Last Post: Hallla
  Help OnPlayerConnect [Solved] 99IRock 4 4,155 11-18-2012, 10:07
Last Post: 99IRock
  Give Gun Error [SOLVED] koro35 4 3,928 11-17-2012, 15:15
Last Post: koro35

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.