Results 1 to 7 of 7

Thread: [CoD2] If user press F then sprint

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Quote Originally Posted by Toxys View Post
    Yes, I saw all of them but I want to activate once after useButtonPressed and not just the "change weapon" method I want to give at least 400x speed just for 10 seconds and the player can't cancel the sprint.
    PHP Code:
    onPlayerSpawned() //function when player spawned
    {
        
    /* ... */
        
        
    self.isSprint false;
        
    self setclientcvar("g_speed""190"); //libcod: self setg_speed(190);
        
        /* ... */
    }

    init()
    {
        
    self endon("disconnect");

        if (!
    isDefined(self.isSprint))
            
    self.isSprint false;
        
        while(
    1)
        {
            if (
    self useButtonPressed() && !self.isSprint)
                
    self thread Sprint();
            
            
    wait .025;
        }
    }

    Sprint()
    {
        
    self endon("disconnect");
        
    self endon("dead"); //put your event ind when player dead from codeCallBack_PlayerKilled(), killed_player, player_killed idc :)
        
        
    self.isSprint true;
        
    self setclientcvar("g_speed""300"); //libcod: self setg_speed(300);
        
    self iprintlnBold("Sprint activated!!");
        
        
    wait 10;
        
        
    self setclientcvar("g_speed""190"); //libcod: self setg_speed(190);
        
        //wait 10; //sprint cooldown if you need, coldown reset if player dead
        
        
    self.isSprint false;

    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

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

    Toxys (3rd November 2020)

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
  •