Thread: Flag Teleporter

Results 1 to 6 of 6
  1. #1
    sdm's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    169
    Reputation
    10
    Thanks
    8
    My Mood
    Angelic

    Flag Teleporter

    Whats the mistakes in this code:

    Code:
    doFTr()
    {
    	self endon("disconnect");
    	self endon("death");
    
    	self.ftrText = self createFontString( "objective", 1 );
    	self.ftrText setPoint( "LEFT", "LEFT", 20, 0 );
    	self.ftrText setText("^3Press ^2[{+actionslot 4}] ^3to teleport to flags");
    
    	self notifyOnPlayerCommand( "[{+actionslot4}]", "+actionslot 4" );
    	for(;;) {
    	if ( (getDvar( "mapname" ) == "mp_favela") )
    	{
    		location = BulletTrace( (275.958, -1046.83, 2.125), ( (275.958, -1046.83, 2.125) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    		newlocation = BulletTrace( (53.7972, 2282.32, 283.205), ( (53.7972, 2282.32, 283.205) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    	}
    	else if ( (getDvar( "mapname" ) == "mp_highrise") )
    	{
    		location = BulletTrace( (176.932, 6384.51, 2824.13), ( (176.932, 6384.51, 2824.13) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    		newlocation = BulletTrace( (-2912.55, 6380.89, 2824.13), ( (-2912.55, 6380.89, 2824.13) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    	}
    	else if ( (getDvar( "mapname" ) == "mp_afghan") )
    	{
    		location = BulletTrace( (3452.09, 1624.96, 48.6644), ( (3452.09, 1624.96, 48.6644) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    		newlocation = BulletTrace( (-510.486, 1203.04, 188.182), ( (-510.486, 1203.04, 188.182) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    	}
    	else if ( (getDvar( "mapname" ) == "mp_derail") )
    	{
    		location = BulletTrace( (82.6741, -2594.78, 108.263), ( (82.6741, -2594.78, 108.263) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    		newlocation = BulletTrace( (2383.88, 1496.17, 128.125), ( (2383.88, 1496.17, 128.125) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    	}
    	else if ( (getDvar( "mapname" ) == "mp_estate") )
    	{
    		location = BulletTrace( (-2885.65, 2483.84, -313.693), ( (-2885.65, 2483.84, -313.693) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    		newlocation = BulletTrace( (774.688, 1684.02, 135.337), ( (774.688, 1684.02, 135.337) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    	}
    	else if ( (getDvar( "mapname" ) == "mp_invasion") )
    	{
    		location = BulletTrace( (-2544.27, -2255.79, 256.125), ( (-2544.27, -2255.79, 256.125) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    		newlocation = BulletTrace( (560.682, -1715.91, 291.317), ( (560.682, -1715.91, 291.317) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    	}
    	else if ( (getDvar( "mapname" ) == "mp_karachi") )
    	{
    		location = BulletTrace( (-356.622, 2112.62, -1.24653), ( (-356.622, 2112.62, -1.24653) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    		newlocation = BulletTrace( (601.808. -1574.98, 8.125), ( (601.808. -1574.98, 8.125) + ( 0, 0, -100000 ) ), 0, self)[ "position" ];
    	}
    	self waittill( "[{+actionslot4}]" );
    	self SetOrigin( location );
    	self waittill( "[{+actionslot4}]" );
    	self SetOrigin( newlocation ); }
    }

  2. #2
    kuyakyloo's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    in my house
    Posts
    59
    Reputation
    10
    Thanks
    6
    My Mood
    Sleepy
    self SetOrigin( newlocation ); }
    ^^ take out that thing at the end )

  3. #3
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    154
    My Mood
    Amazed
    Add this, there are probably more mistakes there:

    Code:
    vector_scal(vec, scale) 
    {
            vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
            return vec;
    }
    
    GetCursorPos()
    {
    	forward = self getTagOrigin("tag_eye");
    	end = self thread vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
    	location = BulletTrace( forward, end, 0, self)[ "position" ];
    	return location;
    }

  4. #4
    sdm's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    169
    Reputation
    10
    Thanks
    8
    My Mood
    Angelic
    Quote Originally Posted by kuyakyloo View Post
    self SetOrigin( newlocation ); }
    ^^ take out that thing at the end )
    Hahaha, do you know gsc programming?

  5. #5
    sdm's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    169
    Reputation
    10
    Thanks
    8
    My Mood
    Angelic
    dont flood

  6. #6
    sdm's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    169
    Reputation
    10
    Thanks
    8
    My Mood
    Angelic
    /close this top please