Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 81 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Struct is not an entity... - Please help me somebody...
Moczulak
General Member
Since: Mar 30, 2009
Posts: 77
Last: Apr 8, 2013
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Oct. 6, 2012 09:07 am
Hey i am make script:

Code:
init()
{
	while(1)
	{
		self thread noIsOnGround();
		wait .05;
	}
}

noIsOnGround()
{
	for(;;)
	{
		players = getentarray("player", "classname");
		for(x=0; x<players.size; x++)
		{
			player = players[x];
			
			if (!self isOnGround() && player isOnGround())
			{
				self iprintlnbold("You are no is on Ground");
				iprintlnbold("Player are is on Ground");
			}
		}
		wait .05;
	}
}


And i have that error:

Struct is not an entity.
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Oct. 6, 2012 09:13 am
ask yourself:
what is self here:
Code:
init()
{
	while(1)
	{
		self thread noIsOnGround();
		wait .05;
	}
}


what is self here:
Code:
			if (!self isOnGround() && player isOnGround())
			{
				self iprintlnbold("You are no is on Ground");
				iprintlnbold("Player are is on Ground");
			}


answer: in this case self is level is struct
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Oct. 6, 2012 09:44 am
Infinite loop inside infinite loop (both have waits, thats a positive) will be ok for the first half second your mod is run. After that, lagg is imminent and will increase probably exponentially. (all those iprintlnbolds... pff)
Share |
Moczulak
General Member
Since: Mar 30, 2009
Posts: 77
Last: Apr 8, 2013
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Oct. 6, 2012 11:40 am
Self = I am
Player = Other players

How repair my script ?
How to make "self" and "player" in a script?
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Oct. 6, 2012 01:40 pm
Read http://modsonline.com/Forums-top-134675.html

And quit thinking that self is you!
World does not revolve around you!
Share |
Moczulak
General Member
Since: Mar 30, 2009
Posts: 77
Last: Apr 8, 2013
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Oct. 6, 2012 11:10 pm
Thank You :) But A bit of culture...
Not everyone can write professionally scripts...
And especially if we have to learn very little time, yet are more important things in life.
A little understanding, I try to write scripts myself but sometimes I do not know the rules that should be followed in creating scripts.

If you think that I am writing on this forum someone wrote for me scripts you're wrong...
Just from time to time I need someone to explain something to me only.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»