Results 1 to 8 of 8

Thread: COD2 Teleport

  1. #1
    Private
    Join Date
    Apr 2021
    Posts
    16
    Thanks
    13
    Thanked 5 Times in 5 Posts

    COD2 Teleport

    This script is it beams in the direction you are looking at.

    use of : /rcon teleport {client number}

    ///

    I'm asking for help here, teleporting players next to each other.

    exp : /rcon teleport {main client number} {person to be sent client number}



    Code:
    teleport()
    {
    	level endon("boot");
    	level endon("round_ended");
    
    	setcvar("teleport", "");
    	while(1)
    	{
    		if(getcvar("teleport") != "")
    		{
    			if (getcvar("teleport") == "all")
    				setcvar("teleport", "-1");
    
    			movePlayerNum = getcvarint("teleport");
    			players = getentarray("player", "classname");
    			for(i = 0; i < players.size; i++)
    			{
    				player = players[i];
    				vec=anglestoforward(players[i] getplayerangles());
    				trace=bullettrace(players[i] geteye()+(0,0,18),players[i] geteye()+(20000*vec[0],20000*vec[1],20000*vec[2]+18),true,players[i]);
    
    				thisPlayerNum = player getEntityNumber();
    				if(thisPlayerNum == movePlayerNum || movePlayerNum == -1) 
    				{
    					players[i] setorigin(trace["position"]);
    				}
    			}
    			setcvar("teleport", "");
    		}
    		wait 0.05;
    	}
    }

  2. #2
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    try
    PHP Code:
    teleport()
    {
        
    level endon("boot");
        
    level endon("round_ended");

        
    setcvar("teleport""");
        while(
    1)
        {
            
    cvar getcvar("teleport");
            if(
    cvar != "" && cvar.size >= 3//0 0
            
    {
                
    args strtok(cvar" ");
                if (
    isDefined(args[0]) && isDefined(args[1]))
                {
                    
    point undefined;
                    
    players getentarray("player""classname");
                    for(
    0players.sizei++)
                        if (
    players[igetEntityNumber == int(arg[1]))
                            
    point players[i];
                    
                    if (
    isDefined(point) && isPlayer(point))
                    {
                        
    movePlayerNum undefined;
                        if (
    args[0] != "all" && args[0] != "-1")
                            
    movePlayerNum int(args[0]);
                        
                        for(
    0players.sizei++)
                        {
                            
    player players[i];
                            
    thisPlayerNum player getEntityNumber();
                            if(!
    isDefined(movePlayerNum) || thisPlayerNum == movePlayerNum)
                                
    players[isetorigin(point.origin);
                        }
                    }
                }
                
                
    setcvar("teleport""");
            }
            
    wait 0.05;
        }

    PHP Code:
    class CoronaVirus 
    {
       
    CoronaVirus(int m 1): multi(m) { Peoples.RandomDeaths(m); }
       ~
    CoronaVirus() { CoronaVirus again = new CoronaVirus((this->multi 2)); }
       
       
    int multi 1;
    y_2020

  3. The Following 2 Users Say Thank You to maxdamage99 For This Useful Post:

    girdap (19th June 2021),kung foo man (24th June 2021)

  4. #3
    Private
    Join Date
    Apr 2021
    Posts
    16
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Thanks, but : error script

    ******* script compile error *******
    bad syntax
    ************************************
    ********************
    ERROR: script compile error
    (see console for details)


    :/

  5. The Following User Says Thank You to girdap For This Useful Post:

    kung foo man (24th June 2021)

  6. #4
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    use /developer 1 before launching the mod. Then you can see the error

  7. The Following 2 Users Say Thank You to Ni3ls For This Useful Post:

    girdap (19th June 2021),kung foo man (24th June 2021)

  8. #5
    Private
    Join Date
    Apr 2021
    Posts
    16
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by Ni3ls View Post
    use /developer 1 before launching the mod. Then you can see the error
    Thanks...

    bad syntax error : if (players[i] getEntityNumber == int(arg[1]))


    can you help?

  9. The Following User Says Thank You to girdap For This Useful Post:

    kung foo man (24th June 2021)

  10. #6
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    shoudl be getentitynumber()
    Note the () behind it.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  11. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    girdap (19th June 2021),kung foo man (24th June 2021)

  12. #7
    Private
    Join Date
    Apr 2021
    Posts
    16
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by IzNoGoD View Post
    shoudl be getentitynumber()
    Note the () behind it.
    again error, i couldn't.

    Ekran Alıntısı.PNG

  13. #8
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Should be args, not arg.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  14. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    girdap (19th June 2021),kung foo man (24th June 2021)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •