[Release] Flags Teleporter

Topic created · 2 Posts · 208 Views
  • This answer to the question

    It probably makes sense to add hidden teleporters(Scavenger packs), but so be it.
    (video with demo below)

    Instructions for installing the script and setups here (instruction is similar)

    Download

    Source:

    global flagCount = 0;
    
    level.onNotify("prematch_done", fun(args){
    
    	switch(gsc.getDvar("mapname")) 
    	{
    	    case("mp_dome") 
    		{
    			createTeleportFlag([0,0,-350], [500,0,900]);
    			createTeleportFlag([0,125,-350], [500,0,1500]);
    			break;
    		}
    	}
    });
    
    def createTeleportFlag(startOrigin, endOrigin)
    {
    	var flagEnter = gsc.spawn("script_model", startOrigin);
        flagEnter.setModel(getTeamFlagModel("allieschar"));
    	
        var flagExit = gsc.spawn("script_model", endOrigin);
        flagExit.SetModel(getTeamFlagModel("axischar"));
    	
    	// omg...
    	// my teacher would kill me for this, but he doesn’t see it so everything is fine ;)
    	setInterval(fun[startOrigin, endOrigin]() { 
    		for(var entRef = 0; entRef < 18; ++entRef)
    		{
    			try 
    			{
    				var player = gsc.getEntByNum(entRef);
    				
    				if(gsc.isPlayer(player) == 1)
    				{
    					if(gsc.distance(player.getOrigin(), startOrigin) < 75)
    					{
    						player.setOrigin(endOrigin);
    					}
    				}
    			} 
    			catch (e) 
    			{
    
    			}
    
    		}
    	}, 100);
    	
    	var curObjID = 31 - ++flagCount;
    	gsc.objective_add(curObjID, "active");
    	gsc.objective_position(curObjID, startOrigin);
    	gsc.objective_icon(curObjID, "compass_waypoint_bomb");
    }
    
    // _teams.gsc
    def getTeamFlagModel(teamChar)
    {
    	return gsc.tableLookup("mp/factionTable.csv", 0, gsc.getMapCustom(teamChar), 10);
    }
    

    Youtube Video

  • @S3VDITO nice m8 ..

Log in to reply