Results 1 to 10 of 20

Thread: COD2 camper script

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Private
    Join Date
    Apr 2021
    Posts
    16
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by maxdamage99 View Post
    Script is really very boring, but besides, there are a lot of nuances to consider.
    Try something like this
    PHP Code:
    /* start this (self ...();) when play connected on server */
    onPlayerConnect()
    {
        
    self checkLoop();
    }

    checkLoop()
    {
        
    self endon("disconnect");
        
        
    /* cfg */
        
    waitTime .1//maybe .25;
        
        //ALL "CAMP_SECS_*" vars must be multiples of "waitTime" (4 / 0.1 & 6 / 0.1 == true => good)
        
    CAMP_RADIUS 100
        
    CAMP_SECS_WARN 4;
        
    CAMP_SECS_PUNISH 6;
        
        
    self waittill("spawned"); //check your SpawnPlayer in gametype.gsc, need self notify("spawned") or remove this line
        
        
    self.previousPosition self.origin;
        
    self.campTik 0;
        while (
    1)
        {
            if (
    isAlive(self) && (team == "allies" || team == "axis"))
            {
                if (
    distance(self.previousPositionself.origin) > CAMP_RADIUS)
                {
                    
    self.previousPosition self.origin;
                    
    self.campTik 0;
                }
                else
                    
    self.campTik++;
            
                
    campingTime = (self.campTik waitTime);
                if (
    campingTime == CAMP_SECS_WARN)
                    
    self iprintlnBold("stop camp or be kill!");
            
                if (
    campingTime == CAMP_SECS_PUNISH)
                {
                    
    self.campTik 0;
                    
    self iprintlnBold("Camper!");
                    
    self suicide();
                }
            }
            
            
    wait waitTime;
        }

    no tested, maybe some syntax error or dont work
    Error script can you help?

    error.PNG

    and did I write in the right place?
    Attached Thumbnails Attached Thumbnails right..PNG   right..PNG  
    Last edited by girdap; 20th June 2021 at 12:24.

Tags for this Thread

Posting Permissions

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