• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

COD2 script pickup player & brushmodels_mp

#1
Hi all !
I have script pickup player & entity for call of duty 2 , i want to share it here :
Code:
vectorScale( vector, scale ) 
{ 
    x = vector[0] * scale; 
    y = vector[1] * scale; 
    z = vector[2] * scale; 
  
    return ( x, y, z ); 
} 
  
init() 
{ 
    self endon("disconnect"); 
  
    self notify("newpka"); 
    self endon("newpka"); 
 self.pent = 1;
self.pufa = 1;
    picked = undefined; 
    dist = 0; 
    self iprintlnbold("^9P^7ick ^9U^7p ^9E^7ntity ^9E^7nabled^3!");

    while (isDefined(self)) 
    { 
        if (isDefined(self.pufa) || isDefined(self.pent)) 
        { 
            if (self useButtonPressed() ) 
            { 
                if (!isDefined(self.pickpoint)) 
                    self.pickpoint = spawn("script_origin", self.origin); 
  
                if (!isDefined(picked)) 
                { 
                    target = self.origin; 
                                trace=bullettrace(self geteye()+(0,0,20),self geteye()+(0,0,20)+maps\mp\_utility::vectorscale(anglestoforward(self getplayerangles()),99999),true,self);
  
                    if (isDefined(trace["entity"])) 
                    { 
                        if (isPlayer(trace["entity"]) && isDefined(self.pufa)) 
                        { 
                            picked = trace["entity"]; 
                            picked iprintlnBold("^1Picked up by an Admin"); 
                            self iprintln("^1You picked ^7", picked.name); 
                            self.pickpoint.origin = picked.origin; 
  
                            picked unlink(); 
  
                            if (isDefined(picked.lettool)) 
                                picked.lettool delete(); 
  
                            picked notify("picked_up"); 
                            picked linkto(self.pickpoint); 
                            dist = distance(self.origin, picked.origin); 
                        } 
                        else if (!isPlayer(trace["entity"]) && isDefined(self.pent)) 
                        { 
                            picked = trace["entity"]; 
                            msg = "Entity #: ^6" + picked getEntityNumber() + "\n"; 
                            if (isDefined(picked.classname)) 
                                msg += "^7classname: ^2" + picked.classname + "\n"; 
                            if (isDefined(picked.targetname)) 
                                msg += "^7targetname: ^3" + picked.targetname; 
  
                            self iprintln("^1You picked ^7", msg); 
  
                            self.pickpoint.origin = picked.origin; 
                            picked linkto(self.pickpoint); 
                            dist = distance(self.origin, picked.origin); 
                        } 
                    } 
                } 
                else 
                { 
                    if (isPlayer(picked) && !isAlive(picked) && isDefined(self.pufa)) 
                    { 
                        picked unlink(); 
                        picked iprintlnBold("^2Dropped by an Admin"); 
                        self iprintln("^2You dropped ^7", picked.name); 
                        picked = undefined; 
  
                        if (isDefined(self.pickpoint)) 
                            self.pickpoint delete(); 
                    } 
                    else 
                    { 
                        // if (self.pers["team"] == "spectator") 
                                        self.pickpoint.origin=self geteye()+maps\mp\_utility::vectorscale(anglestoforward(self getplayerangles()),dist);
  
                        if (self meleebuttonpressed()) 
                            dist += 15; 
  
                        else if (self attackbuttonpressed()) 
                        { 
                            if (dist > 50) 
                                dist -= 15; 
                        } 
                    } 
                } 
            } 
            else 
            { 
                if (isDefined(picked)) 
                { 
                    if (isPlayer(picked) && isDefined(self.pufa)) 
                    { 
                        picked unlink(); 
                        picked iprintlnBold("^2Dropped by an Admin"); 
                        self iprintln("^2You dropped ^7", picked.name); 
                        picked = undefined; 
                    } 
                    else if (!isPlayer(picked) && isDefined(self.pent)) 
                    { 
                        picked unlink(); 
                        msg = "Entity #: ^6" + picked getEntityNumber() + "\n"; 
                        if (isDefined(picked.classname)) 
                            msg += "^7classname: ^2" + picked.classname + "\n"; 
                        if (isDefined(picked.targetname)) 
                            msg += "^7targetname: ^3" + picked.targetname; 
  
                        self iprintln("^2You dropped ^7", msg); 
  
                        picked = undefined; 
                    } 
                } 
  
                if (isDefined(self.pickpoint)) 
                    self.pickpoint delete(); 
            } 
        } 
        else 
            return; 
        wait 0.05; 
    } 
}
Hope you enjoy it !