Results 1 to 14 of 14
  1. #1
    BMGP's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    20
    Reputation
    10
    Thanks
    0

    [Solved]"Unknown function" error at RayGun script

    Hi!
    Just wanted to include a RayGun script into my mod.
    But when i try to play with mod i get the unknown function error.

    This is what I have when u should get the gun:
    Code:
    self thread RayGun();
    And this somewhere else in the same gsc file:
    Code:
    RayGun()
    {
            //self takeWeapon( self GetCurrentWeapon() );
    	self giveWeapon( "pp2000_silencer_mp", 1, false );
    	self switchToWeapon("pp2000_silencer_mp");
    	self thread doRaygunSync();
    	textz = spawnstruct();
    	textz.text = game["clientmsg"]["FIRE_LAST_HUMAN"];
    	wait 0.1;
    	self iPrintLnBold(textz.text);
    	
    }
    
    doRaygunSync()
    {
        self endon("disconnect");
    	self endon("death");
    	self endon("game_ended");
    	
    	self.textRayGunVal = spawnstruct();
    	self.textRayGunVal = self createFontString( "default", 2.0 );
    	self.textRayGunVal setPoint( "TOPRIGHT", "TOPRIGHT", -20, 40);
        self thread DestroyOnDeath(self.textRayGunVal);
    	texta = spawnstruct();
    	texta.text = game["clientmsg"]["TO_FAR_POINT_RAYGUN"];
    	for(self.ammoclipray = 360; self.ammoclipray > -1; self.ammoclipray--)
    	{
    		self waittill("weapon_fired");
    		iWeap = self GetCurrentWeapon();
    		if(iWeap == "pp2000_silencer_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);
    				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]);
    				//self.playingfxatm = playfx(level.spawnGlow["enemy"], startB);
    				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 iPrintLnBold(texta.text);
    			}
    		}
    		if(self.ammoclipray == 0)
    		{
    			self.textRayGunVal.color = (1,0,0);
    		}
    	}
    }
    
    GetCursorPos()
    {
            return BulletTrace( self getTagOrigin("tag_eye"), vector_Scal(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
    }
    vector_scal(vec, scale)
    {
            return (vec[0] * scale, vec[1] * scale, vec[2] * scale);
    }
    
    DestroyOnDeath( hudElem )
    {
    	self waittill ( "death" );
    	hudElem destroy();
    }
    
    removeRayGunShotEffect(DObj)
    {
        wait 0.3;
    	DObj delete();
    }
    Console says "Error: unknown function: Error: @ 170630"

    Also tried other version(s) - doesnt work too.

    Anyone is able to help me?
    Last edited by BMGP; 01-17-2011 at 07:49 AM.

  2. #2
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    shouldnt it be
    Code:
    		self thread RayGun(ammo);
    Code:
    RayGun(ammo)
    {
            //self takeWeapon( self GetCurrentWeapon() );
    	self giveWeapon( "pp2000_silencer_mp", 1, false );
    	self switchToWeapon("pp2000_silencer_mp");
    	self thread doRaygunSync(ammo);
    	textz = spawnstruct();
    	textz.text = game["clientmsg"]["FIRE_LAST_HUMAN"];
    	wait 0.1;
    	self iPrintLnBold(textz.text);
    	
    }
    
    doRaygunSync(ammo)
    {
        self endon("disconnect");
    	self endon("death");
    	self endon("game_ended");
    	
    	self.textRayGunVal = spawnstruct();
    	self.textRayGunVal = self createFontString( "default", 2.0 );
    	self.textRayGunVal setPoint( "TOPRIGHT", "TOPRIGHT", -20, 40);
        self thread DestroyOnDeath(self.textRayGunVal);
    	texta = spawnstruct();
    	texta.text = game["clientmsg"]["TO_FAR_POINT_RAYGUN"];
    	for(self.ammoclipray = 360; self.ammoclipray > -1; self.ammoclipray--)
    	{
    		self waittill("weapon_fired");
    		iWeap = self GetCurrentWeapon();
    		if(iWeap == "pp2000_silencer_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);
    				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]);
    				//self.playingfxatm = playfx(level.spawnGlow["enemy"], startB);
    				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 iPrintLnBold(texta.text);
    			}
    		}
    		if(self.ammoclipray == 0)
    		{
    			self.textRayGunVal.color = (1,0,0);
    		}
    	}
    }
    
    GetCursorPos()
    {
            return BulletTrace( self getTagOrigin("tag_eye"), vector_Scal(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
    }
    vector_scal(vec, scale)
    {
            return (vec[0] * scale, vec[1] * scale, vec[2] * scale);
    }
    
    DestroyOnDeath( hudElem )
    {
    	self waittill ( "death" );
    	hudElem destroy();
    }
    
    removeRayGunShotEffect(DObj)
    {
        wait 0.3;
    	DObj delete();
    }
    If I Helped You, Plz Thanks.
    It Would Help Alot

    What Do You Do For A Living?
    I Mostly Own Noobs With The AK-47 With Silencer
    What's That?
    (Turns To Friend)
    HAHAHA Noob!!!!!!
    [img]https://www.danasof*****m/sig/asd248737.jpg[/img]

  3. #3
    BMGP's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    20
    Reputation
    10
    Thanks
    0
    Tried this already and i get this error:

    Error: uninitialised variable 'ammo'

    U got that too right?(Just saw your post about Raygun :P )

    Hmm... but why do i get it?

    Btw. I didnt put it in rank.gsc ... but that cant be the issue, right?(Im a noob @ modding )

  4. #4
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    nope its not the gsc fault ask 4fun
    If I Helped You, Plz Thanks.
    It Would Help Alot

    What Do You Do For A Living?
    I Mostly Own Noobs With The AK-47 With Silencer
    What's That?
    (Turns To Friend)
    HAHAHA Noob!!!!!!
    [img]https://www.danasof*****m/sig/asd248737.jpg[/img]

  5. #5
    BMGP's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    20
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by jimmynguyen3030 View Post
    nope its not the gsc fault ask 4fun
    could u send me the code where/how u used it?

  6. #6
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    wat do u mean it dont work fo meh
    If I Helped You, Plz Thanks.
    It Would Help Alot

    What Do You Do For A Living?
    I Mostly Own Noobs With The AK-47 With Silencer
    What's That?
    (Turns To Friend)
    HAHAHA Noob!!!!!!
    [img]https://www.danasof*****m/sig/asd248737.jpg[/img]

  7. #7
    BMGP's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    20
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by jimmynguyen3030 View Post
    wat do u mean it dont work fo meh
    lol for u it doesnt work too? thought it was working for ya... ^^

  8. #8
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    lol no, no working
    If I Helped You, Plz Thanks.
    It Would Help Alot

    What Do You Do For A Living?
    I Mostly Own Noobs With The AK-47 With Silencer
    What's That?
    (Turns To Friend)
    HAHAHA Noob!!!!!!
    [img]https://www.danasof*****m/sig/asd248737.jpg[/img]

  9. #9
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    You guys never seen the
    Code:
    textz = spawnstruct();
    	textz.text = game["clientmsg"]["FIRE_LAST_HUMAN"];
    ones?
    idk..

  10. #10
    BMGP's Avatar
    Join Date
    May 2010
    Gender
    male
    Posts
    20
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by Arasonic View Post
    You guys never seen the
    Code:
    textz = spawnstruct();
    	textz.text = game["clientmsg"]["FIRE_LAST_HUMAN"];
    ones?
    idk..
    what should i see here? ^^

  11. #11
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    154
    My Mood
    Amazed
    Try this one, I only changed the model of the gun(PP2000 to TMP) and the FX(flare to red light, more realistic), for the rest works and is the same.

    Code:
    giveRayGun()
    {
        self takeWeapon( self GetCurrentWeapon() );
    	self giveWeapon( "tmp_eotech_silencer_mp", 8, false );
    	self switchToWeapon("tmp_eotech_silencer_mp");
    	self thread doRaygunSync();
    	wait 1;
    	self maps\mp\perks\_perks::givePerk("specialty_marathon");
    	self maps\mp\perks\_perks::givePerk("specialty_longersprint");
    	self maps\mp\perks\_perks::givePerk("specialty_lightweight");
    	wait 0.1;
    }
    
    doRaygunSync()
    {
        self endon("disconnect");
    	self endon("death");
    	
    	self.textRayGunVal = spawnstruct();
    	self.textRayGunVal = self createFontString( "default", 2.0 );
    	self.textRayGunVal setPoint( "TOPRIGHT", "TOPRIGHT", -20, 40);
    	for(self.ammoclipray = 120; self.ammoclipray > -1; self.ammoclipray--)
    	{
    		self waittill("weapon_fired");
    		iWeap = self GetCurrentWeapon();
    		if(iWeap == "tmp_eotech_silencer_mp")
    		{
    		startB = GetCursorPos();
    		RadiusDamage( startB, 101, 520, 507, self );
    		startA = self getTagOrigin("tag_weapon_left");
    		xD = distance(startA, startB);
    		//We will have to do a limit of range, or else error 'no free dobjs'
    		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]);
    		self.playingfxatm = playfx(level._effect[ "ac130_light_red_blink" ], startB);
    		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]);
    		}
    		}
    		}
    	}
    }
    
    removeRayGunShotEffect(DObj)
    {
        wait 0.3;
    	DObj delete();
    }
    
    GetCursorPos()
    {
            return BulletTrace( self getTagOrigin("tag_eye"), vector_Scal(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
    }
    vector_scal(vec, scale)
    {
            return (vec[0] * scale, vec[1] * scale, vec[2] * scale);
    }

  12. The Following User Says Thank You to Yamato For This Useful Post:

    jimmynguyen3030 (01-17-2011)

  13. #12
    YuDi21's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    mp_complex
    Posts
    141
    Reputation
    12
    Thanks
    35
    My Mood
    Angelic
    pointe = roundUp(xD/13);
    to
    pointe = maps\mp\gametypes\_rank::roundUp(xD/13);

  14. The Following User Says Thank You to YuDi21 For This Useful Post:

    BMGP (01-18-2011)

  15. #13
    JamesA1994's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Location
    The dark side
    Posts
    1,703
    Reputation
    271
    Thanks
    529
    My Mood
    Psychedelic
    Is this solved yet?
    CoD Minion: Jan 13th 2011 to April 11 2011
    MMORPG Minion Since: March 28th 2011 to April 11 2011

    Don't be afraid to rep, you aren't loosing anything!
    Don't forget your P&Q's. Press the thanks button if someone has helped.
    jamesa1994@hotmail.com

  16. #14
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,668
    My Mood
    Breezy
    oh yes,
    /marked as solved
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

Tags for this Thread