Results 1 to 6 of 6
  1. #1
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored

    4fun i need yo help

    when i use this code i always get a error with ammo in it
    Code:
    giveRayGun(ammo)
    {
        self takeWeapon( self GetCurrentWeapon() );
    	self giveWeapon( "pp2000_silencer_mp", 1, false );
    	self switchToWeapon("pp2000_silencer_mp");
    	self thread doRaygunSync();
    }
    
    doRaygunSync(ammo)
    {
        self endon("disconnect");
    	self endon("death");
    	self endon("game_ended");
    	
    	//I don't know how to make a custom ammo clip so I will use the good old way.
    	
    	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 = ammo; 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);
    		//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.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);
    		}
    	}
    }
    
    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!!!!!!

  2. #2
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    152
    My Mood
    Amazed
    You dont need his help, I got this same problem, but was easy to correct, just add this:

    Code:
    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);
    }

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

    jimmynguyen3030 (01-09-2011)

  4. #3
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    uninitialized variable ammo wad does tht mean?
    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!!!!!!

  5. #4
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    152
    My Mood
    Amazed
    Quote Originally Posted by jimmynguyen3030 View Post
    uninitialized variable ammo wad does tht mean?
    If you add that to the end, doesnt work???

  6. #5
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,309
    My Mood
    Breezy
    Change:
    self thread doRaygunSync();
    to:
    self thread doRaygunSync(ammo);

    If you didn't see, the function isn't passing the argument over.

    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    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]

  7. #6
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored
    bro u genius thanks