Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Didn't show var ?!? - SOLVED
#1
Hi.
I allredy have a new problem Wink
I have some line code, but the var's didn't work...
If i want to write the Var on screen, nothing happens Sad
Here's Code [all in _rank.gsc]
Code:
-REMOVED-
Code:
-REMOVED-
Code:
-REMOVED-
Code:
-REMOVED-
[this was all, i have changed in _rank.gsc]
They should come a massage on spawn with the var: "self.gcmykills"
(it was only for me to controll, if it didnt work...)
But i start the game and nothing happens. No massage...
Why? and how can i debug this ?

*sorry for mutch code Wink hope you can help me...

EDIT: Upload Unready Mod
Sorry for bad English Blush -> *GERMAN*
Reply

#2
Attach the mod as a .rar file
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply

#3
Done with upload.

Please help...
Sorry for bad English Blush -> *GERMAN*
Reply

#4
In the init() function in _rank, 'self' doesn't refer to a player because the function isn't called on a player. So when you write "self.gcmykills = 0;", it doesn't assign the variable to a player and that's why you can't print it out later, because it's undefined.

Try defining the player variables when they connect:

PHP Code:
level waittill"connected"player );
player.gcmykills 0;
player thread onPlayerSpawned();
... 
Reply

#5
(11-04-2011, 22:41)Phl3x_ Wrote: In the init() function in _rank, 'self' doesn't refer to a player because the function isn't called on a player. So when you write "self.gcmykills = 0;", it doesn't assign the variable to a player and that's why you can't print it out later, because it's undefined.

Try defining the player variables when they connect:

PHP Code:
level waittill"connected"player );
player.gcmykills 0;
player thread onPlayerSpawned();
... 

Funny so far, I've always defined my variable in init().
and there never was a problem with it...

I will test it.

EDIT: I didn't want the var for one player, i want it for ALL players...
the self-vars are still not working...


Now, all works.
-> remove Upload
Sorry for bad English Blush -> *GERMAN*
Reply

#6
Just writing 'self.var = 0;' anywhere doesn't assign the variable to every player. I think you're a bit confused. As I said in another thread of yours: inside a function, the variable 'self' just refers to the entity that the function was called on.
Reply

#7
I've use your way with put it into connect...
and it works
Sorry for bad English Blush -> *GERMAN*
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] CS addon for MW2(Sounds,show damage) Fl0w_.JACKDAN 1 4,691 09-29-2013, 19:46
Last Post: Nekochan
  Didn't expect this Arteq 3 2,454 09-23-2013, 01:17
Last Post: Rendflex
  Help [C#] WebClient how to know real url [solved] narkos 21 12,978 09-09-2013, 15:21
Last Post: surtek
Information Help How to edit new derived entry? (Solved) SSonic70 1 2,737 08-20-2013, 15:29
Last Post: Nekochan
  [News] Show your wallpaper. Nekochan 6 4,694 07-10-2013, 19:02
Last Post: House
Rainbow [News] Show your awesome mobile device. Nekochan 34 14,000 05-29-2013, 14:59
Last Post: Arteq
Rainbow [News] Show your awesome face Arteq 2 2,781 05-23-2013, 06:11
Last Post: OrangePL
Rainbow Show your mobile device's wallpaper Nekochan 23 12,000 04-05-2013, 18:12
Last Post: SuperNovaAO
  Show your awesome wallpaper V2 JariZ 81 41,083 04-05-2013, 18:10
Last Post: SuperNovaAO
  [Request] !shop hud to show player with highest points hillbilly 3 3,260 02-21-2013, 16:46
Last Post: hillbilly

Forum Jump:


Users browsing this thread:
1 Guest(s)

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