Results 1 to 6 of 6

Thread: Pickup Script

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Private
    Join Date
    Mar 2019
    Posts
    16
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Pickup Script

    Hello,

    I'm trying to set up a Pickup script which made by IzNoGod and I'm getting the error

    Code:
    ******* script runtime error *******
    type undefined is not a vector: (file 'maps/mp/gametypes/_pickups.gsc', line 10)
        self.pickpoint=spawn("script_origin",self.origin);
                                                  *
    called from:
    (file 'maps/pam/sd.gsc', line 68)
     thread maps\mp\gametypes\_pickups::pickups();
            *
    called from:
    (file 'maps/mp/gametypes/_callbacksetup.gsc', line 15)
      [[level.callbackStartGameType]]();
              *
    started from:
    (file 'maps/mp/gametypes/_callbacksetup.gsc', line 10)
    CodeCallback_StartGameType()
    *
    ************************************
    Sys_Error: Error during initialization:
    script runtime error
    (see console for details)
    (file 'maps/mp/gametypes/_callbacksetup.gsc', line 10)

    The script:

    PHP Code:
    pickups()
    {
        
    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);
        
    dist=0;
        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("picked up by admin");
                                
    self iprintlnbold("you 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("dropped by admin");
                    
    self iprintlnbold("you dropped ",picked.name);
                    
    picked=undefined;
                }
            }
            
    wait 0.05;
        }

    Any help? thanks
    Last edited by nerdiiii; 29th May 2019 at 21:56.

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

    kung foo man (30th May 2019)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •