| Author |
Topic: [scriptsdump] admin pickup |
| IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Monday, Jul. 4, 2011 07:12 am |
 |
Hey all
I decided to dump a lot of my scripts.
Here is the admin-pickup script:
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;
}
}
Have fun
Questions can be either asked in this thread, or directly through xfire: imbackagainiba |
 |
|
|
| SanchoMLD |
General Member Since: Jul 18, 2012 Posts: 22 Last: Jul 27, 2012 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Thursday, Jul. 19, 2012 12:52 am |
 |
Quote: ******* script compile error *******
uninitialised variable 'dist'
************************************ |
 |
|
|
| IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
|
| SanchoMLD |
General Member Since: Jul 18, 2012 Posts: 22 Last: Jul 27, 2012 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Thursday, Jul. 19, 2012 03:06 am |
 |
Code: ("script_origin",self.origin);
dist=0;
self iprintlnbold("^1Press ^5USE ^1to pick someone up!");
?
|
 |
|
|
| IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Thursday, Jul. 19, 2012 03:08 am |
 |
IzNoGoD writes...Quote:
Just init the dist var by setting it to zero after/before one of the initial iprintlnbolds.
Initial=First
Just put dist=0; below the function declaration... |
 |
|
|
| SanchoMLD |
General Member Since: Jul 18, 2012 Posts: 22 Last: Jul 27, 2012 [view latest posts] |
|
|
|
|
| liltc64 |
General Member Since: Feb 12, 2007 Posts: 906 Last: Oct 22, 2012 [view latest posts] |
|
|
 |
|
|
| SanchoMLD |
General Member Since: Jul 18, 2012 Posts: 22 Last: Jul 27, 2012 [view latest posts] |
|
|
|
Category: CoD2 Scripting Posted: Thursday, Jul. 19, 2012 06:15 am |
 |
Quote: if you dont understand how to use the script you leave it alone for more experienced people
Great help, thx guru! |
 |
|
|
| IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|
|
| liltc64 |
General Member Since: Feb 12, 2007 Posts: 906 Last: Oct 22, 2012 [view latest posts] |
|
|
 |
|
Category: CoD2 Scripting Posted: Thursday, Jul. 19, 2012 08:04 am |
 |
SanchoMLD writes...Quote: Quote: if you dont understand how to use the script you leave it alone for more experienced people
Great help, thx guru!
no problem ![[wave]](images/BBCode/smilies/wave.gif) |
 |
|
|
Comments: 0
LoadoutGun Crafting to the Max.
edited on Sep. 25, 2012 06:57 pm by Morp...
|
|