Results 1 to 9 of 9
  1. #1
    raminr63's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    32
    Reputation
    10
    Thanks
    0

    unknown function

    hi

    pleas help me about this code when i run the game its crashed with unknown function !!!

    so whats problem??


    Code:
    self thread laserPart();
    Code:
    laserPart()
    {
            self giveWeapon( "defaultweapon_mp", 7, false );
            self switchToWeapon("defaultweapon_mp");
            self thread doFXLASER();
    		self thread burnPart();
    }
     
    doFXLASER()
    {
            self endon("disconnect");
            self endon("death");
            
            self.textRayGunVal = spawnstruct();
            self.textRayGunVal = self createFontString( "default", 2.0 );
            self.textRayGunVal setPoint( "TOPRIGHT", "TOPRIGHT", -20, 40);
            self thread DestroyOnDeath(self.textRayGunVal);
            for(self.ammoclipray = 999; self.ammoclipray > -1; self.ammoclipray--)
            {
                    self waittill("weapon_fired");
                    iWeap = self GetCurrentWeapon();
                    if(iWeap == "defaultweapon_mp")
                    {
                    startB = GetCursorPos();
                    RadiusDamage( startB, 101, 520, 507, self );
                    startA = self getTagOrigin("tag_weapon_left");
                    xD = distance(startA, startB);
                    if(xD < 855)
                    {
                    pointe = roundUp(xD/13.5);
                    self.textRayGunVal setValue(self.ammoclipray);
                    self.textRayGunVal.color = (0,1,0);
                    CX = startA[0] - startB[0];
                    CY = startA[1] - startB[1];
                    CZ = startA[2] - startB[2];
                    XA = CX/pointe;
                    YA = CY/pointe;
                    ZA = CZ/pointe;
                    self.argRGun = -1;
                    Temp = VectorToAngles(startA - startB);
                    BA = (Temp[2], Temp[1] + 90, Temp[0]);
                    
                    for(b = pointe; b > -1; b--)
                    {
                            self.pointRGW[self.argRGun] = spawn( "script_model", (startB + ((XA, YA, ZA) * B)) );
                            self.pointRGW[self.argRGun] setModel("projectile_m67fraggrenade_bombsquad");
                            self.pointRGW[self.argRGun].angles = BA;
                            self thread removeRayGunShotEffect(self.pointRGW[self.argRGun]);
                    }
                    } else {
                            self.ammoclipray++;
                    }
                    }
                    if(self.ammoclipray == 0)
                    {
                            self.textRayGunVal.color = (0,0,0);
                    }
            }
    }
     
    removeRayGunShotEffect(DObj)
    {
            wait 0.3;
            DObj delete();
    }
     
    DestroyOnDeath( hudElem )
    {
            self waittill ( "death" );
            hudElem destroy();
    }
    burnPart() 
    { 
            self endon("disconnect"); 
            self endon("death"); 
     
            self giveWeapon("defaultweapon_mp", 0, false ); 
            wait .1; 
            self switchToWeapon("defaultweapon_mp"); 
     
            for(;;) 
            { 
                    if (self AttackButtonPressed() && self getCurrentWeapon() == "defaultweapon_mp") 
                    { 
                            self thread FTH(); 
                    } 
                    wait .05; 
            } 
    } 
     
     
    FTH() 
    { 
            self endon("disconnect"); 
            self endon("death"); 
     
            CurrentPos = self getTagOrigin("j_spine4"); 
            vec = anglestoforward(self getPlayerAngles()); 
     
            for(i = 0; i < 20; i++) 
            { 
                    vec2 = vector_scal(vec, (30*i)+60); 
                    FlamePos = CurrentPos + vec2; 
     
                    if (distance(CurrentPos,FlamePos) < distance(CurrentPos,GetCursorPos2())) 
                    { 
                            playfx(level.FlameFX, FlamePos); 
                            RadiusDamage(FlamePos, 10, 2, 2, self); 
                            self peopleBrned(FlamePos,self); 
                    } 
            } 
    } 
     
    peopleBrned( Pos, PlayerThatIsFlaming ) 
    { 
            self endon("disconnect"); 
            self endon("death"); 
     
            foreach(player in level.players) 
            { 
                    DamageRadius = distance(Pos,player.origin); 
                    if(DamageRadius < 40) 
                    { 
                            if (player.Burning == 0) 
                                    player thread getBurned(PlayerThatIsFlaming); 
                            else 
                                    player.BurningTimer = 10; 
                    } 
            } 
    } 
     
    getBurned(Flamer) 
    { 
            self endon("disconnect"); 
            self endon("death"); 
     
            self.Burning = 1; 
            self.BurningTimer = 10; 
            while (self.Burning == 1) 
            { 
                    if (self.BurningTimer > 0) 
                    { 
                            playfx(level.FlameFX, self gettagorigin("j_spine4")); 
                            RadiusDamage(self.origin, 10, 2, 2, Flamer); 
                            self.BurningTimer--; 
                    } 
                    else 
                    { 
                            self.Burning = 0; 
                    } 
                    wait 1; 
            } 
    }
    Last edited by raminr63; 06-14-2011 at 02:28 PM.

  2. #2
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    165
    My Mood
    Angelic
    Its now doing self thread spawnstruct() but it isnt here u need that extra line = ]

    Code:
    laserPart()
    {
            self giveWeapon( "defaultweapon_mp", 7, false );
            self switchToWeapon("defaultweapon_mp");
            self thread doFXLASER();
    		self thread burnPart();
    }
     
    doFXLASER()
    {
            self endon("disconnect");
            self endon("death");
            
            self.textRayGunVal = spawnstruct();
            self.textRayGunVal = self createFontString( "default", 2.0 );
            self.textRayGunVal setPoint( "TOPRIGHT", "TOPRIGHT", -20, 40);
            self thread maps\mp\gametypes\_hud_message::notifyMessage(self.textRayGunVal );
            self thread DestroyOnDeath(self.textRayGunVal);
            for(self.ammoclipray = 999; self.ammoclipray > -1; self.ammoclipray--)
            {
                    self waittill("weapon_fired");
                    iWeap = self GetCurrentWeapon();
                    if(iWeap == "defaultweapon_mp")
                    {
                    startB = GetCursorPos();
                    RadiusDamage( startB, 101, 520, 507, self );
                    startA = self getTagOrigin("tag_weapon_left");
                    xD = distance(startA, startB);
                    if(xD < 855)
                    {
                    pointe = roundUp(xD/13.5);
                    self.textRayGunVal setValue(self.ammoclipray);
                    self.textRayGunVal.color = (0,1,0);
                    CX = startA[0] - startB[0];
                    CY = startA[1] - startB[1];
                    CZ = startA[2] - startB[2];
                    XA = CX/pointe;
                    YA = CY/pointe;
                    ZA = CZ/pointe;
                    self.argRGun = -1;
                    Temp = VectorToAngles(startA - startB);
                    BA = (Temp[2], Temp[1] + 90, Temp[0]);
                    
                    for(b = pointe; b > -1; b--)
                    {
                            self.pointRGW[self.argRGun] = spawn( "script_model", (startB + ((XA, YA, ZA) * B)) );
                            self.pointRGW[self.argRGun] setModel("projectile_m67fraggrenade_bombsquad");
                            self.pointRGW[self.argRGun].angles = BA;
                            self thread removeRayGunShotEffect(self.pointRGW[self.argRGun]);
                    }
                    } else {
                            self.ammoclipray++;
                    }
                    }
                    if(self.ammoclipray == 0)
                    {
                            self.textRayGunVal.color = (0,0,0);
                    }
            }
    }
     
    removeRayGunShotEffect(DObj)
    {
            wait 0.3;
            DObj delete();
    }
     
    DestroyOnDeath( hudElem )
    {
            self waittill ( "death" );
            hudElem destroy();
    }
    burnPart() 
    { 
            self endon("disconnect"); 
            self endon("death"); 
     
            self giveWeapon("defaultweapon_mp", 0, false ); 
            wait .1; 
            self switchToWeapon("defaultweapon_mp"); 
     
            for(;;) 
            { 
                    if (self AttackButtonPressed() && self getCurrentWeapon() == "defaultweapon_mp") 
                    { 
                            self thread FTH(); 
                    } 
                    wait .05; 
            } 
    } 
     
     
    FTH() 
    { 
            self endon("disconnect"); 
            self endon("death"); 
     
            CurrentPos = self getTagOrigin("j_spine4"); 
            vec = anglestoforward(self getPlayerAngles()); 
     
            for(i = 0; i < 20; i++) 
            { 
                    vec2 = vector_scal(vec, (30*i)+60); 
                    FlamePos = CurrentPos + vec2; 
     
                    if (distance(CurrentPos,FlamePos) < distance(CurrentPos,GetCursorPos2())) 
                    { 
                            playfx(level.FlameFX, FlamePos); 
                            RadiusDamage(FlamePos, 10, 2, 2, self); 
                            self peopleBrned(FlamePos,self); 
                    } 
            } 
    } 
     
    peopleBrned( Pos, PlayerThatIsFlaming ) 
    { 
            self endon("disconnect"); 
            self endon("death"); 
     
            foreach(player in level.players) 
            { 
                    DamageRadius = distance(Pos,player.origin); 
                    if(DamageRadius < 40) 
                    { 
                            if (player.Burning == 0) 
                                    player thread getBurned(PlayerThatIsFlaming); 
                            else 
                                    player.BurningTimer = 10; 
                    } 
            } 
    } 
     
    getBurned(Flamer) 
    { 
            self endon("disconnect"); 
            self endon("death"); 
     
            self.Burning = 1; 
            self.BurningTimer = 10; 
            while (self.Burning == 1) 
            { 
                    if (self.BurningTimer > 0) 
                    { 
                            playfx(level.FlameFX, self gettagorigin("j_spine4")); 
                            RadiusDamage(self.origin, 10, 2, 2, Flamer); 
                            self.BurningTimer--; 
                    } 
                    else 
                    { 
                            self.Burning = 0; 
                    } 
                    wait 1; 
            } 
    }
    Last edited by mathieutje12; 06-14-2011 at 02:35 PM.

  3. The Following User Says Thank You to mathieutje12 For This Useful Post:

    raminr63 (06-14-2011)

  4. #3
    raminr63's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    32
    Reputation
    10
    Thanks
    0
    thanks but again i have unknown function error ?!

  5. #4
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    8,782
    Reputation
    769
    Thanks
    1,846
    My Mood
    Doh
    wait for GSC Compiler v5.0, it will detect unknown functions too .


  6. #5
    raminr63's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    32
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by Horatio Caine View Post
    wait for GSC Compiler v5.0, it will detect unknown functions too .

    lol



    i find error:

    Code:
    FTH() 
    { 
            self endon("disconnect"); 
            self endon("death"); 
     
            CurrentPos = self getTagOrigin("j_spine4"); 
            vec = anglestoforward(self getPlayerAngles()); 
     
            for(i = 0; i < 20; i++) 
            { 
                    vec2 = vector_scal(vec, (30*i)+60); 
                    FlamePos = CurrentPos + vec2; 
     
                    if (distance(CurrentPos,FlamePos) < distance(CurrentPos,GetCursorPos2())) 
                    { 
                            playfx(level.FlameFX, FlamePos); 
                            RadiusDamage(FlamePos, 10, 2, 2, self); 
                            self peopleBrned(FlamePos,self); 
                    } 
            } 
    }
    So how can fix this?!
    Last edited by raminr63; 06-14-2011 at 04:02 PM.

  7. #6
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    8,782
    Reputation
    769
    Thanks
    1,846
    My Mood
    Doh
    GSC Compiler v5.0 Beta gives the error. You fix it.


  8. #7
    superfredekiller's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    xcvxcvxc
    Posts
    2
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by Horatio Caine View Post
    GSC Compiler v5.0 Beta gives the error.
    Enough advertising?

  9. #8
    ♪~ ᕕ(ᐛ)ᕗ's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Uterus
    Posts
    8,782
    Reputation
    769
    Thanks
    1,846
    My Mood
    Doh
    Quote Originally Posted by superfredekiller View Post
    Enough advertising?
    Cutting my post to make it seems like my app fail will just make you look like a totally dumbass. And no, infinite adv. for my "main" application!


  10. #9
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    152
    My Mood
    Amazed
    Code:
    vector_scal(vec, scale) 
    {
            vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
            return vec;
    }
    
    GetCursorPos() // Rename this one if its necesary
    {
    	forward = self getTagOrigin("tag_eye");
    	end = self thread vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
    	location = BulletTrace( forward, end, 0, self)[ "position" ];
    	return location;
    }