ItsMods

Full Version: Syntax error :(
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Heres my code! i always get the syntax error and i cant see the problem :(
hope you guys can help me! :)

(IM BER PRO AT CODDING, no seriously im new at modding so please dont make comment like omg youre noob!)

Code:
onPlayerSpawned()
{
    self endon("disconnect");
    for(;;)
    {
        self waittill("spawned_player");
                self takeallweapons();
              if(self.team == "axis")
{
self setperk ("specialty_fastreload");
self giveWeapon ( "knife_ballistic_mp");
self switchToWeapon("knife_ballistic_mp");
self thread JumpersAmmo();
self doClientDvar("jump_height", 39 );
self thread maps\mp\gametypes\_hud_message::hintMessage("^1You are now a Jumper!" );
}
              if(self.team == "allies")
{
self setperk "(specialty_fastreload");
self setperk "(speciality_movefaster");
self giveWeapon ( "m14_grip_silencer_mp");
self switchToWeapon("m14_grip_silencer_mp");
self SetWeaponAmmoStock( "m14_grip_silencer_mp", 69 );
self clearPerks();

self thread maps\mp\gametypes\_hud_message::hintMessage("^1You are now a Hacker!" );


}
// Refills jumpers ammo.
JumpersAmmo()
self giveMaxAmmo("knife_ballistic_mp");
wait 2.0;
self thread JumpersAmmo();
}
Code:
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
self takeallweapons();
if(self.team == "axis")
{
self setperk ("specialty_fastreload");
self giveWeapon ( "knife_ballistic_mp");
self switchToWeapon("knife_ballistic_mp");
self thread JumpersAmmo();
self doClientDvar("jump_height", 39 );
self thread maps\mp\gametypes\_hud_message::hintMessage("^1You are now a Jumper!" );
}
if(self.team == "allies")
{
self setperk "(specialty_fastreload");
self setperk "(speciality_movefaster");
self giveWeapon ( "m14_grip_silencer_mp");
self switchToWeapon("m14_grip_silencer_mp");
self SetWeaponAmmoStock( "m14_grip_silencer_mp", 69 );
self clearPerks();

self thread maps\mp\gametypes\_hud_message::hintMessage("^1You are now a Hacker!" );


}
}
}
// Refills jumpers ammo.
JumpersAmmo()
{
self endon("disconnect");
self endon("death");
for(;;)
{
self giveMaxAmmo("knife_ballistic_mp");
wait 2.0;
}
}
(10-29-2012, 08:07)zxz0O0 Wrote: [ -> ]
Code:
onPlayerSpawned()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
self takeallweapons();
if(self.team == "axis")
{
self setperk ("specialty_fastreload");
self giveWeapon ( "knife_ballistic_mp");
self switchToWeapon("knife_ballistic_mp");
self thread JumpersAmmo();
self doClientDvar("jump_height", 39 );
self thread maps\mp\gametypes\_hud_message::hintMessage("^1You are now a Jumper!" );
}
if(self.team == "allies")
{
self setperk "(specialty_fastreload");
self setperk "(speciality_movefaster");
self giveWeapon ( "m14_grip_silencer_mp");
self switchToWeapon("m14_grip_silencer_mp");
self SetWeaponAmmoStock( "m14_grip_silencer_mp", 69 );
self clearPerks();

self thread maps\mp\gametypes\_hud_message::hintMessage("^1You are now a Hacker!" );


}
}
}
// Refills jumpers ammo.
JumpersAmmo()
{
self endon("disconnect");
self endon("death");
for(;;)
{
self giveMaxAmmo("knife_ballistic_mp");
wait 2.0;
}
}
Still dont work Sad

Heres my full _rank - http://pastebin.com/cuytW5Sb
Still syntax error?
(10-29-2012, 16:14)zxz0O0 Wrote: [ -> ]Still syntax error?

It just gives me this error Sad
Server script compile error bad syntax
Try this!

Code:
onPlayerSpawned()
{
     self endon("disconnect");
    
   for(;;)
   {
    
     self waittill("spawned_player");
    
     self thread goTeams();

   }
}

goTeams()
{
    self endon("disconnect");

     self takeAllWeapons();
     self clearPerks();

    if(self.pers["team"] == "axis")
    {
     self thread jumper();
    }
    if(self.pers["team"] == "allies")
    {
     self thread hacker();
    }
}

jumper()
{
self endon("disconnect");

self setPerk("specialty_fastreload");

self setClientDvar("jump_height", 999);
self setClientDvar("bg_gravity", 200);
self setClientDvar("bg_fallDamageMinHeight", 999);
self setClientDvar("bg_fallDamageMaxHeight", 999);

knife = "knife_ballistic_mp";
self giveWeapon(knife);
self switchToWeapon(knife);

//could use these!
//self setWeaponAmmoStock(knife, value);
//self setWeaponAmmoClip(knife, value);

for(;;)
{
if(knife == "none")
continue;
self giveMaxAmmo(knife);
wait .5;
}

self thread maps\mp\gametypes\_hud_message::hintMessage("^1You are now a Jumper!");

}

hacker()
{
self endon("disconnect");

self setPerk("specialty_fastreload");
self setPerk("speciality_movefaster");

self giveWeapon("m14_grip_extclip_silencer_mp");
self switchToWeapon("m14_grip_extclip_silencer_mp");
self setWeaponAmmoStock("m14_grip_extclip_silencer_mp", 70);

//To set clip size!
//self setWeaponAmmoClip("m14_grip_extclip_silencer_mp", value);

self thread maps\mp\gametypes\_hud_message::hintMessage("^1You are now a Hacker!");

}
Thanks doh! I'll try to help out when I can.
This is my favorite mods 'site' ftw! xD...