ItsMods

Full Version: help me !
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was trying to make a minigun shooting rpg missiles, I put the code in _rank.gsc, checked it with Nova's GScyntax (no errors), then make a mod. But when I try to load it, an error : 'onplayerspawned is already defined' or sth like that comes out. Dodgy Please take a look into the code and make it work Big Grin
http://pastebin.com/USUq9hfg
2 times "onplayerspawned" ?
tell me what line i have to delete, this playerthread OnPlayerSpawned ?
(03-20-2011, 22:18)OrangePL Wrote: [ -> ]tell me what line i have to delete, this playerthread OnPlayerSpawned ?

rename your minigun function to atPlayerSpawn and put this @ the original onPlayerSpawned:
self thread atPlayerSpawn():
I dont know what is wrong. Nova's program says:257:Code after end is ignored!
I tried almost everything, but still i dont know how to fix that. Please look at rank.gsc, here it is.
(03-21-2011, 10:31)OrangePL Wrote: [ -> ]I dont know what is wrong. Nova's program says:257:Code after end is ignored!
I tried almost everything, but still i dont know how to fix that. Please look at rank.gsc, here it is.

Code:
atPlayerSpawn()
    {
        self endon("disconnect");

        for(;;)
        {
            self waittill("spawned_player");
            self takeAllWeapons();
            self giveWeapon( "minigun_mp", 0, false );
        }

                    
                    {
                        self waittill ( "weapon_fired" );
                        location = aim();
                        MagicBullet( "rpg_mp", self getTagOrigin("tag_eye"), location, self );
                    }
    }
} <-----

Take out this, you left a spare one in there

There might be more i just has a quick scan. Also tidy your code up, tab out each new line within the functions so it helps you see errors. And split the code in 2. Have the normal code then the custom code down the bottom. Makes things alot simpler
Ta da
Very nice guy's now i have changed the code alittle so the its called at on player spawned and and put the rest at the bottom this work's fine however i wish to have my other guy's as well so i have taken out the Takeall weapons and now i have my gun's But i can not change to the minigun and for some reason have unlimited ammo Huh For now i just want to be able to switch to a rpg shoting MiniGun but still have my guns and not unlimited ammo any ideas why that would happen? i have attatched my _rank
(03-21-2011, 15:19)rotceh_dnih Wrote: [ -> ]Very nice guy's now i have changed the code alittle so the its called at on player spawned and and put the rest at the bottom this work's fine however i wish to have my other guy's as well so i have taken out the Takeall weapons and now i have my gun's But i can not change to the minigun and for some reason have unlimited ammo Huh For now i just want to be able to switch to a rpg shoting MiniGun but still have my guns and not unlimited ammo any ideas why that would happen? i have attatched my _rank

Change player_sustainammo to 0 or completely remove it.