Results 1 to 3 of 3

Thread: Pickup Script Error

  1. #1
    Private
    Join Date
    Jul 2016
    Location
    Albania
    Posts
    18
    Thanks
    8
    Thanked 9 Times in 8 Posts

    Pickup Script Error

    Guys i found recently this script from cod4

    PHP Code:
    init()

    {
        while(
    1)
        {
            
    level waittill("player_spawn",player);
              
    player thread _AdminPickup();
        }
    }
    _AdminPickup()
    {
       
    self endon("disconnect");
     
            while(
    1)
            {        
                    while(!
    self secondaryOffHandButtonPressed())
                    {
                            
    wait 0.05;
                    }
                   
                    
    start self getEye();
                    
    end start maps\mp\_utility::vector_scale(anglestoforward(self getPlayerAngles()), 999999);
                    
    trace bulletTrace(startendtrueself);
                    
    dist distance(starttrace["position"]);
     
                    
    ent trace["entity"];
     
                    if(
    isDefined(ent) && ent.classname == "player")
                    {
                            if(
    isPlayer(ent))
                                    
    ent IPrintLn("^1You've been picked up by the admin ^2" self.name "^1!");
     
                            
    self IPrintLn("^1You've picked up ^2" ent.name "^1!");
     
                            
    linker spawn("script_origin"trace["position"]);
                            
    ent linkto(linker);
     
                            while(
    self secondaryOffHandButtonPressed())
                            {
                                    
    wait 0.05;
                            }
     
                            while(!
    self secondaryOffHandButtonPressed() && isDefined(ent))
                            {
                                    
    start self getEye();
                                    
    end start maps\mp\_utility::vector_scale(anglestoforward(self getPlayerAngles()), dist);
                                    
    trace bulletTrace(startendfalseent);
                                    
    dist distance(starttrace["position"]);
     
                                    if(
    self secondaryOffHandButtonPressed() && !self adsButtonPressed())
                                            
    dist -= 15;
                                    else if(
    self secondaryOffHandButtonPressed() && self adsButtonPressed())
                                            
    dist += 15;
     
                                    
    end start maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()), dist);
                                    
    trace bulletTrace(startendfalseent);
                                    
    linker.origin trace["position"];
     
                                    
    wait 0.05;
                            }
         
                            if(
    isDefined(ent))
                            {
                                    
    ent unlink();
                                           
                                    if(
    isPlayer(ent))
                                            
    ent IPrintLn("^1You've been dropped by the admin ^2" self.name "^1!");
     
                                    
    self IPrintLn("^1You've dropped ^2" ent.name "^1!");
                            }
     
                            
    linker delete();
                    }
     
                    while(
    self secondaryOffHandButtonPressed())
                    {
                            
    wait 0.05;
                    }
            }

    But it wont work ive tried to change those
    PHP Code:
    secondaryOffHandButtonPressed() 
    to
    PHP Code:
    useButtonPressed() 
    but still error

    Can anyone help me?

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Hey guys, I found an old car. It didnt want to drive so I swapped a tire. It still doesnt want to drive.

    What is the problem?

    Also, this looks like a cheap copy of a script i wrote a long, long time ago:
    PHP Code:
    pickups() //call this on an admin that needs adminpickup
    {
            
    self endon("disconnect");
            
    self endon("killed_player");
            
    self endon("spawned_player");
            
    self endon("spawned");
            
    picked=undefined;
            if(
    isdefined(self.pickpoint))
            
    self.pickpoint delete();
            
    self.pickpoint=spawn("script_origin",self.origin);
        
    self iprintlnbold("^1Press ^5USE ^1to pick someone up!");
        
    wait 1;
        
    self iprintlnbold("^1Hold ^5MELEE^1 to move him further!");
        
    wait 1;
        
    self iprintlnbold("^1Hold ^5FIRE^1 to move him closer!");
            
            for(;;)
            {
                    if(
    self usebuttonpressed())
                    {
                            if(!
    isdefined(picked))
                            {
                                    
    trace=bullettrace(self geteye()+(0,0,20),self geteye()+(0,0,20)+maps\mp\_utility::vectorscale(anglestoforward(self getplayerangles()),99999),true,self);
                                    if(
    trace["fraction"]!=1)
                                    {
                                            if(
    isdefined(trace["entity"]))
                                            {
                                                    if(
    isplayer(trace["entity"]))
                                                    {
                                                            
    picked=trace["entity"];
                                                            
    picked iprintlnbold("^1picked up by a admin");
                                                            
    self iprintlnbold("^1you picked up ",picked.name);
                                                            
    self.pickpoint.origin=picked.origin;
                                                            
    picked linkto(self.pickpoint);
                                                            
    dist=distance(self.origin,picked.origin);
                                                    }
                                            }
                                    }
                            }
                            else
                            {
                                    if(!
    isplayer(picked)||!isalive(picked))
                                            
    picked=undefined;
                                    else
                                    {
                                            
    self.pickpoint.origin=self geteye()+maps\mp\_utility::vectorscale(anglestoforward(self getplayerangles()),dist);
                                            if(
    self meleebuttonpressed())
                                                    
    dist+=15;
                                            if(
    self attackbuttonpressed())
                                            {
                                                    if(
    dist>50)
                                                            
    dist-=15;
                                            }
                                    }
     
                            }
                    }
                    else if(
    isdefined(picked)||!isplayer(picked)||!isalive(picked))
                    {
                            if(!
    isplayer(picked))
                                    
    picked=undefined;
                            else
                            {
                                    
    picked unlink();
                                    
    picked iprintlnbold("^5dropped by a admin");
                                    
    self iprintlnbold("^5you dropped ",picked.name);
                                    
    picked=undefined;
                            }
                    }
                    
    wait 0.05;
            }

    Last edited by IzNoGoD; 11th September 2016 at 01:15.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. #3
    Private
    Join Date
    Jul 2016
    Location
    Albania
    Posts
    18
    Thanks
    8
    Thanked 9 Times in 8 Posts
    Lol that was from Cod4 Braxi deathrun scripts i didnt keept the credits for myself !
    I just wanted to put it to game !

  4. The Following User Says Thank You to klendi11 For This Useful Post:

    Kevi (16th October 2016)

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
  •