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

Members Online

»
0 Active | 70 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
Page
Previous Page Next Page
subscribe
Author Topic: Flying in MP like spectator
Dutch77
General Member
Since: Oct 7, 2007
Posts: 48
Last: May 5, 2011
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Monday, Dec. 28, 2009 11:08 am
This is my "almost everything". Still uknow function @102845... Maybe I just don't know how to use this thing, because I have same error as hidepart...


1.

hideme
{
self detachall();
}

or

2.

hideme
{
model = spawn("script_model", self.origin );
model linkto(self);
model detachall();
}

still same error :(
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Monday, Dec. 28, 2009 11:10 am
If you get an "unknown function" error message, either enable logfile or use dev mode so that you are told specifically what function isnt recognised.

Looking at what you are trying to do, you cannot link a model to a player without first enabling linkto:

Code:
self enableLinkto();


However, it probably still wont work if you try to link the model to the player. Instead, try linking self to the model:

Code:
self enableLinkto();
self Linkto( model );
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Monday, Dec. 28, 2009 11:15 am
Sevenz writes...
Quote:
hidepart maybe?

so basically hide what is connected to the plane's player tag (might be different than tag_player):

plane hidepart("tag_player");

not sure if that works, you may have to pass the player's model name as second argument to hidepart


hidepart() is not a function in COD2.
Share |
Dutch77
General Member
Since: Oct 7, 2007
Posts: 48
Last: May 5, 2011
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Monday, Dec. 28, 2009 11:47 am
okay, so enabling dev mode was great idea, because problem was somewhere else. Anyway hidepart doesn't work at all and detechall disappears only heads.



self detachall();
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Monday, Dec. 28, 2009 02:01 pm
Well, its not a good idea to detach all models from a player. After about 10 mins or so, the server will crash. The way that United Noobs did it with their vehicle mod back when COD2 was still at its height was to make the plane the player model.
Share |
Dutch77
General Member
Since: Oct 7, 2007
Posts: 48
Last: May 5, 2011
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Monday, Dec. 28, 2009 04:06 pm
so I think i've figured that out by:

self hide();
self setModel("");

works fine :)
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Monday, Dec. 28, 2009 06:16 pm
oh good, my last idea was placing the player tag -1000 units below (so it won't be visible 'cause it would be under the map) ^^
Share |
Dutch77
General Member
Since: Oct 7, 2007
Posts: 48
Last: May 5, 2011
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Wednesday, Dec. 30, 2009 03:15 pm
Thanks for all answers...


Now I have small problem:

I made thirdperson look script but I can't get cvar from client:

It take server value not client
getcvar("cg_thirdPerson")

Uknown function
self getcvar("cg_thirdPerson")

Uknown function
getdvar("cg_thirdPerson")

Uknown function
self getdvar("cg_thirdPerson")

ukno...f.
self getclientcvar( "cg_thirdPerson")


here is what I'm trying to do.


thirdperson() //maps\mp\gametypes\_uber::thirdperson();
{
if(self getclientcvar( "cg_thirdPerson") == "0" )
{
self setclientcvar( "cg_thirdPerson", "1" );
}
else if(self getclientcvar( "cg_thirdPerson") == "1" )
{
self setclientcvar( "cg_thirdPerson", "0" );
}

}


edited on Dec. 30, 2009 10:23 am by Dutch77
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Wednesday, Dec. 30, 2009 03:20 pm
Thats not a small problem, that is a large problem - and one which cannot be solved: there is no way to get a dvar set on a client in COD games.
Share |
Dutch77
General Member
Since: Oct 7, 2007
Posts: 48
Last: May 5, 2011
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Wednesday, Dec. 30, 2009 03:26 pm
Problem is I don't know basics. What is the difference between dvar and cvar?

btw. I dont have problem with set clientcvar but with how to get client cvar
Share |
Restricted Access Topic is Locked
Page
Previous Page Next Page
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

»