| Author |
Topic: guide through first steps of modding |
| serthy |
General Member Since: Sep 8, 2010 Posts: 482 Last: Jun 28, 2013 [view latest posts] |
|
|
 |
|
Category: CoD2 Scripting Posted: Thursday, May. 26, 2011 08:59 pm |
 |
okay a new problem lol
my problem:
Code:
******* script runtime error *******
undefined is not an array, string, or vector: (file 'maps/mp/gametypes/_mine.gsc', line 38)
self.pers["shopitems"][0].carry++;
on Player connect i did:
Code:
self.pers["shopitem"][0] = spawnstruct();
self.pers["shopitem"][0].name = "mine";
self.pers["shopitem"][0].carry = 0;
self.pers["shopitem"][0].used = 0;
self.pers["shopitem"][0].planted = 0;
SOLVED
look, there was an 's' on where it should not be...
shopitem-shopitemS
big thanks to IzNoGoD and LiLPimP |
|
|
|
| Samuel033 |
General Member Since: Dec 10, 2009 Posts: 484 Last: Dec 25, 2015 [view latest posts] |
|
|
|
|
| serthy |
General Member Since: Sep 8, 2010 Posts: 482 Last: Jun 28, 2013 [view latest posts] |
|
|
 |
|
|
| serthy |
General Member Since: Sep 8, 2010 Posts: 482 Last: Jun 28, 2013 [view latest posts] |
|
|
 |
|
Category: CoD2 Scripting Posted: Saturday, May. 28, 2011 09:20 am |
 |
okay, now (lol) :
how do i call different functions out of an array?
like:
Code: self.pers["shopitem"][0].function = maps\mp\gametypes\_mine::mine_handle();
<snipped>
if( response = self.pers["shopitem"][i].key )
self [[self.pers["shopitem"][i].function]];
what is the right way to do it?
am i allowed to put ''maps\mp\gametypes\_mine'' infront of it?
or call it with self?
SOLVED
example:
level.suicide = maps\mp\gametypes\_suicide::suicide;
no () or (player) or sth like that here
self [[level.suicide]]();
dont forget the () here and the func needs a [[...]] ! |
|
|
|
| serthy |
General Member Since: Sep 8, 2010 Posts: 482 Last: Jun 28, 2013 [view latest posts] |
|
|
 |
|
Category: CoD2 Scripting Posted: Sunday, May. 29, 2011 08:40 pm |
 |
what is the order to unbind a key?
i tried :
Code: unbind_key( key_name )
{
self _execClientCommand( "unbind " + key_name );
}
and it didnt work
i put a bind_key() function before and after the unbind_key function everything works except of unbinding a key
Code: self bind_key( "N" , "say Hello" ); // works
wait 10;
self unbind_key( "N" ); // it still prints 'hello' to me
wait 10;
self bind_key( "N" , "say Hello again" ); //works
|
|
|
|
| serthy |
General Member Since: Sep 8, 2010 Posts: 482 Last: Jun 28, 2013 [view latest posts] |
|
|
 |
|
|
| IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
|
| serthy |
General Member Since: Sep 8, 2010 Posts: 482 Last: Jun 28, 2013 [view latest posts] |
|
|
 |
|
Category: CoD2 Scripting Posted: Friday, Jun. 24, 2011 12:12 pm |
 |
hey thats awesome :) thank you
im looking around the cod7 gsc files and i found some more for me unknown parts :p
Code: target.locking_on &= ~( 1 << clientNum );
(btw is there a way to search in google for signs like §&%$=| etc? ) |
|
|
|
| serthy |
General Member Since: Sep 8, 2010 Posts: 482 Last: Jun 28, 2013 [view latest posts] |
|
|
 |
|
Category: CoD2 Scripting Posted: Monday, Aug. 22, 2011 02:52 pm |
 |
Düdüm ^^
yeah hell its me again ..
my newest problem:
objective_team() does not work ...
i tried:
Code: curObjID = getNextObjID();
objective_add(curObjID, "current", self.origin, "compass_crate_green");
objective_icon(curObjID,"compass_green");
objective_team(curObjID,self.team);
objective_position(curObjID, self.origin);
self.objIdFriendly = curObjID;
if i exclude objective_team with // the crate is shown (for everyone) but everytime i add objective_team(id,team) theres nothing on the compass ._.
i really dont know why xD
i have rewritten my code 3 times so there is noinvalid sign, also the console doesnt show any errors
|
|
|
|
| IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|