Need help with the addon.gsc

Chat area specifically for CoDJumper

Moderator: Core Staff

Post Reply
DeltaSpades
CJ Wannabe
CJ Wannabe
Posts: 44
Joined: January 10th, 2013, 7:07 pm

Need help with the addon.gsc

Post by DeltaSpades » February 4th, 2013, 8:49 pm

I've been trying to add a script to the addon.gsc file
But when i add a script to the file my server stops working

please help

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Need help with the addon.gsc

Post by Drofder2004 » February 4th, 2013, 9:38 pm

What script?
Run your server with "+developer 1" (or "set developer 1") and post any errors.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

DeltaSpades
CJ Wannabe
CJ Wannabe
Posts: 44
Joined: January 10th, 2013, 7:07 pm

Re: Need help with the addon.gsc

Post by DeltaSpades » February 4th, 2013, 9:55 pm

Drofder2004 wrote:What script?
Run your server with "+developer 1" (or "set developer 1") and post any errors.
The script is

Code: Select all

 
_AdminPickup()
{
        self endon("disconnect");
 
        while(1)
        {                       
                while(!self secondaryoffhandButtonPressed())
                {
                        wait 0.05;
                }
                
                start = getPlayerEyePosition();
                end = start + vector_scale(anglestoforward(self getPlayerAngles()), 999999);
                trace = bulletTrace(start, end, true, self);
                dist = distance(start, trace["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 = getPlayerEyePosition();
                                end = start + vector_scale(anglestoforward(self getPlayerAngles()), dist);
                                trace = bulletTrace(start, end, false, ent);
                                dist = distance(start, trace["position"]);
 
                                if(self fragButtonPressed() && !self adsButtonPressed())
                                        dist -= 15;
                                else if(self fragButtonPressed() && self adsButtonPressed())
                                        dist += 15;
 
                                end = start + vector_Scale(anglestoforward(self getPlayerAngles()), dist);
                                trace = bulletTrace(start, end, false, ent);
                                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;
                }
        }
}
Last edited by Anonymous on February 4th, 2013, 10:01 pm, edited 1 time in total.
Reason: added code=cod box

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Need help with the addon.gsc

Post by Drofder2004 » February 5th, 2013, 3:58 am

And the error?
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

DeltaSpades
CJ Wannabe
CJ Wannabe
Posts: 44
Joined: January 10th, 2013, 7:07 pm

Re: Need help with the addon.gsc

Post by DeltaSpades » February 5th, 2013, 10:40 am

Drofder2004 wrote:And the error?
I don't know what to error is
when i run the script in LAN dedicated it works fine
but when i run it on my real server the server just stops working...

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Need help with the addon.gsc

Post by Drofder2004 » February 5th, 2013, 2:49 pm

Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

DeltaSpades
CJ Wannabe
CJ Wannabe
Posts: 44
Joined: January 10th, 2013, 7:07 pm

Re: Need help with the addon.gsc

Post by DeltaSpades » February 5th, 2013, 2:50 pm

linux server?[/quote]

no i don't think so

DeltaSpades
CJ Wannabe
CJ Wannabe
Posts: 44
Joined: January 10th, 2013, 7:07 pm

Re: Need help with the addon.gsc

Post by DeltaSpades » February 5th, 2013, 3:41 pm

Drofder2004 wrote:viewtopic.php?f=29&t=15171

See this thread.
Thanks it works now because of that thread :D

But is there a way to make it so that only the Admin can use the Admin pick up because right now everyone can use it

Post Reply