Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what's wrong with this coding?
#1
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;
        }
}
Reply

#2
whats the error?
Reply

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

#4
seta developer "1" in your config_mp.cfg
[Image: lQDUjba.jpg]
Reply

#5
or type /logfile 1 in console
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply

#6
[Image: errorht.png]
Reply

#7
You forgot the Power() function ..
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

Reply

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

#9
(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
YouTube 1:Azumikkel- Modding
YouTube 2:DerpShark- Gaming Entertainment
Website:Jensby.me
Contact: im[at]jensby.me
Reply

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



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help What's Wrong 2 Dominator56 5 3,812 02-19-2013, 21:46
Last Post: Dominator56
  Help What's wrong ? Dominator56 4 3,080 02-17-2013, 12:12
Last Post: Dominator56
  I know I've posted this in a wrong place Ra3shed 2 2,360 02-16-2013, 21:15
Last Post: Arteq
Exclamation No site change after 12 rounds... Bug or wrong settings? ChrisPiHD 1 2,488 09-21-2012, 18:16
Last Post: estebespt
  [Tutorial] Basic GSC Coding: Making your third code Yamato 2 4,727 04-20-2012, 23:04
Last Post: SuperNovaAO
  Something wrong with background Arteq 2 2,440 02-27-2012, 17:01
Last Post: Arteq
Question A very, very annoying thing, what is wrong? I don't see it. xplosiff 1 1,999 12-30-2011, 09:27
Last Post: met94
  Help Coding AdamOwnz 8 32,308 12-23-2011, 17:14
Last Post: d0h!
  lol whats wrong? skata3000 0 1,611 10-02-2011, 22:35
Last Post: skata3000
  Help What's wrong with this? johamort 8 4,464 08-28-2011, 23:14
Last Post: Tomsen1410

Forum Jump:


Users browsing this thread:
3 Guest(s)

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