Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: COD2 camper script

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

    COD2 camper script

    Cod2 1.3 patch//

    Hello, KillTube

    i am need a camper script on CTF gametype, (camp after death) except for the flag carrier. I should be able to set the duration and activation with the command. (scr_campertime 6, scr_camper 0/1). How can I do it ? Thanks.

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,675
    Thanks
    17
    Thanked 1,012 Times in 636 Posts
    Why not set the activation through the same cvar? scr_campertime 0 has no other purpose than to disable it.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. #3
    Private
    Join Date
    Apr 2021
    Posts
    16
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by IzNoGoD View Post
    Why not set the activation through the same cvar? scr_campertime 0 has no other purpose than to disable it.
    it doesn't matter, this is a solution

  4. #4
    Private
    Join Date
    Apr 2021
    Posts
    16
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Is there anyone who can help? I really need it.

  5. #5
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,675
    Thanks
    17
    Thanked 1,012 Times in 636 Posts
    This forum tends to perform poorly when asked for full scripts for free.

    However, if you try yourself we're pretty good at helping when you hit roadblocks.

    As a sidenote: this script would be pretty boring to write.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. The Following User Says Thank You to IzNoGoD For This Useful Post:

    girdap (12th June 2021)

  7. #6
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    455
    Thanks
    79
    Thanked 120 Times in 99 Posts
    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
    Last edited by maxdamage99; 16th June 2021 at 05:15.
    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

  8. The Following User Says Thank You to maxdamage99 For This Useful Post:

    girdap (15th June 2021)

  9. #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.

  10. #8
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,675
    Thanks
    17
    Thanked 1,012 Times in 636 Posts
    Quote Originally Posted by girdap View Post
    Error script can you help?

    error.PNG

    and did I write in the right place?
    Replace by self.sessionteam
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  11. #9
    Private
    Join Date
    Apr 2021
    Posts
    16
    Thanks
    13
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by IzNoGoD View Post
    Replace by self.sessionteam
    I can't say I understand very well :/

  12. #10
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    455
    Thanks
    79
    Thanked 120 Times in 99 Posts
    Quote Originally Posted by girdap View Post
    I can't say I understand very well :/

    PHP Code:
    self thread scriptfolder/_camper::checkLoop(); 
    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

  13. The Following User Says Thank You to maxdamage99 For This Useful Post:

    girdap (22nd June 2021)

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
  •