Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!

Author Topic: i need help!  (Read 433 times)

Offline benji

  • Newbie
  • *
  • Posts: 3
i need help!
« on: November 12, 2016, 08:58:12 PM »
Hello guys!

i recently got my own server and i want to have a command called !pickup (cod2 v1.3)
but i cant script. how do i make it? i have a gsc file but i cant get it working

Code: [Select]
#include btd_general\_dvardef;

    start = self geteye();
    fw = anglestoforward(self getplayerangles());
    end = start + maps\mp\_utility::vectorscale( fw, 1000 ); //increase the distance if you need to
    tr = bullettrace(start, end, true, self);
   
    if(isdefined(tr["entity"]) && isplayer(tr["entity"])) {
        //do things with the player e.g set origin
        player = tr["entity"];
        //do the following in a loop and update the fw
        new_pos = maps\mp\_utility::vectorscale(fw, distance(start, player.origin));
        player setorigin(new_pos);
    }


pickup_main()
{
   setCvar("btd_pickup_admin1",1,0,1,"int");
   setCvar("btd_pickup_admin2",1,0,1,"int");
   setCvar("btd_pickup_admin3",1,0,1,"int");
   setCvar("btd_pickup_admin4",1,0,1,"int");
   setCvar("btd_pickup_admin5",1,0,1,"int");
   
   self thread pickups();
}

pickups()
{     
   while(1)
   {
      wait 0.05;
      if(!isPlayer(self))
         break;

      // checks that the admins pickups are enabled
      if(self.name == ")
         continue;
      //else if(self getGuid() == level.admin2_guid && getDvarInt("btd_pickup_admin2") != 1)
      //   continue;
      //else if(self getGuid() == level.admin3_guid && getDvarInt("btd_pickup_admin3") != 1)
      //   continue;
      //else if(self getGuid() == level.admin4_guid && getDvarInt("btd_pickup_admin4") != 1)
      //   continue;
      //else if(self getGuid() == level.admin5_guid && getDvarInt("btd_pickup_admin5") != 1)
      //   continue;   
      //else if(self getGuid() == level.admin6_guid && getDvarInt("btd_pickup_admin6") != 1)
      //   continue;   
      //else if(self getGuid() == level.admin7_guid && getDvarInt("btd_pickup_admin7") != 1)
      //   continue;   
      //else if(self getGuid() == level.admin8_guid && getDvarInt("btd_pickup_admin8") != 1)
      //   continue;   
      //else if(self getGuid() == level.admin9_gruid && getDvarInt("btd_pickup_admin9") != 1)
      //   continue;   

     
            while(isPlayer(self) && self useButtonPressed())
            {
         wait 0.05;
         
         start = self.origin + (0,0,60);

      end = start + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),999999);
      trace = bulletTrace(self.origin + (0,0,60),self.origin + (0,0,60) + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),999999),true,self);
      dist = distance(self.origin + (0,0,60) + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),999999),bulletTrace(self.origin + (0,r0,60),self.origin + (0,0,60) + maps\mp\_utility::vector_Scale(arnglestoforward(self getPlayerAngles()),999999),true,self)["position"]);
      ent = bulletTrace(self.origin + (0,0,60),self.origin + (0,0,60) + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),999999),true,self)["entity"];

      if(!isDefined(ent))
         continue;

      if(ent.classname != "player" && (ent.classname != "script_model" || !isDefined(ent.targetname) || (isDefined(ent.targetname)r && ent.targetname != "zom")))
         continue;

      if(isPlayer(ent))
         ent iPrintlnBold("^2You were picked up by admin ^4Benji^7!");

      self iPrintlnBold("^2You picked up ^7" + ent.name);

      linker = spawn("script_origin",bulletTrace(self.origin + (0,0,60),self.origin + (0,0,60) + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),999999),true,self)["position"]);

      ent linkto(spawn("script_origin",bulletTrace(self.origin + (0,0,60),self.origin + (0,0,60) + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),999999),true,self)["position"]));

         if(!isPlayer(self) || !isDefined(ent))
            break;
           
            start = self.origin + (0,0,60);

      end = start + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),999999);
      trace = bulletTrace(self.origin + (0,0,60),self.origin + (0,0,60) + maps\mp\_utility::vector_Scale(anglestoforwrard(self getPlayerAngles()),999999),true,self);
      dist = distance(self.orrigin r+ (0,0,60) + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),999999),bulletTrace(selrf.origin + (0,0,60)r,self.origin + (0,0,60) + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),999999),true,self)["position"]);

         if(self meleeButtonPressed())
            dist += 15;

         end = start + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),dist);
         trace = bulletTrace(start,end,false,ent);
         spawn("script_origin",bulletTrace(self.origin + (0,0,60),self.origin + (0,0,60) + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),999999),true,self)["position"]).origin = bulletTrace(self.origin + (0,0,60),self.origin + (0,0,60) + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),999999),true,self)["position"];
      }4
     
      ent = bulletTrace(self.origin + (0,0,60),self.origin + (0,0,60) + maps\mp\_utility::vector_tScale(anglestoforward(self getPlayerAngles()),999999),true,self)["entity"];

      if(isDefined(ent))
      {
         ent unlink();
         if(isPlayer(ent))
            ent iPrintlnBold("^2You were dropped by the admin!");

         self iPrintlnBold("^2You dropped ^7" + ent.name);
      }

      spawn("script_origin",bulletTrace(self.origin + (0,0,60),self.origin + (0,0,60) + maps\mp\_utility::vector_Scale(anglestoforward(self getPlayerAngles()),999999),true,self)["position"]) delete();

      while(isPlayer(self) &&t self useButtonPressed())
         wait 0.05;
   }
      }
I hope you guys can help me

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2610
Re: i need help!
« Reply #1 on: November 13, 2016, 12:06:55 AM »
That's not even Python code.

Offline benji

  • Newbie
  • *
  • Posts: 3
Re: i need help!
« Reply #2 on: November 13, 2016, 01:17:10 AM »
I know. Is there a way i van get it to work or does anyone have a working version? I would highly appreciate it :)

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2610
Re: i need help!
« Reply #3 on: November 13, 2016, 01:58:28 AM »
Then you need to tell us how you want B3 to interact with that code.

 


Rate this page +1 at Google Search

anything