ItsMods
what's wrong with this coding? - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: what's wrong with this coding? (/Thread-what-s-wrong-with-this-coding.html)

Pages: 1 2


what's wrong with this coding? - cervantes - 07-03-2011

I found Killindyls code on ammo boxes but when I put it into my _Rank.gsc it gives me an error. What am I missing?
Code:
CreateAmmoBox(pos, angle, team) { block = spawn("script_model", pos, 1 ); block setModel(level.crateModelBoobyTrapped); block Solid(); block.angles = angle; block SetOwner( level ); block thread AmmoBoxThink(team); wait 0.01; }
Code:
AmmoBoxThink(team) { while(1) { for(i = 0; i < level.players.size; i++) { if(team != "all" && level.players[i].team != team){ continue; } if(DistanceSquared(self.origin, level.players[i].origin) <= Power(50, 2)){ level.players[i].hint = "Press ^3[{+activate}] ^7to Refill your ammo"; if(level.players[i] UseButtonPressed()){ level.players[i] DisableWeapons(); level.players[i].weaponlist = level.players[i] GetWeaponsList(); for( idx = 0; idx < level.players[i].weaponlist.size; idx++ ) { weapon = level.players[i].weaponlist[idx]; switch( weapon ) { case "frag_grenade_mp": case "sticky_grenade_mp": case "hatchet_mp": case "flash_grenade_mp": case "concussion_grenade_mp": case "tabun_gas_mp": case "nightingale_mp": case "willy_pete_mp": level.players[i] SetWeaponAmmoStock( weapon, 999 ); break; default: level.players[i] GiveMaxAmmo( weapon ); break; } } level.players[i] playLocalSound( "ammo_crate_use" ); wait 1.5; level.players[i] EnableWeapons(); } } } wait .045; } }



RE: what's wrong with this coding? - koil - 07-03-2011

whats the error?


RE: what's wrong with this coding? - cervantes - 07-03-2011

[Image: errorxj.png]
also is there any way for the console to reference lines maybe? Would make my life a ton easier.


RE: what's wrong with this coding? - OrangePL - 07-03-2011

seta developer "1" in your config_mp.cfg


RE: what's wrong with this coding? - AZUMIKKEL - 07-03-2011

or type /logfile 1 in console


RE: what's wrong with this coding? - cervantes - 07-03-2011

[Image: errorht.png]


RE: what's wrong with this coding? - iAegle - 07-03-2011

You forgot the Power() function ..


RE: what's wrong with this coding? - cervantes - 07-03-2011

all of a sudden i'm getting this error with my game even on my backup mod
[Image: errorcnb.png]


RE: what's wrong with this coding? - AZUMIKKEL - 07-03-2011

(07-03-2011, 16:59)cervantes Wrote: all of a sudden i'm getting this error with my game even on my backup mod
[Image: errorcnb.png]

turn /logfile 0


RE: what's wrong with this coding? - cervantes - 07-03-2011

[Image: errorqq.png]
Houston, we have a problem.