Problem set object weapon drop
#1

Hi boys,

If i drop a gun, I create a object and no a AddStaticPickup. it's doing( more realist).

My problem, i dont know how with a command to take the weapon.

2 solutions: add a AddStaticPickup but invisible, if OnPlayerPickUpPickup, I destroy AddStaticPickup and object.
or create a function between the payerid and the object static but i dont kown how to make that.

Thanks if you have solutions.

bye.
Reply
#2

up
Reply
#3

//gamemode top

new gun;

// onplayercommand
Код:
  
  if(strcmp(cmdtext, "/drop", true) == 0)
  {
  new Float:X;
  new Float:Y;
  new Float:Z;
  GetPlayerPos(playerid,X,Y,Z);
  gun = CreateObject(gunid, x, y, z, 0, 0, 96);
  GivePlayerWeapon(playerid, 29, -amount); // smg
  }
  return 1;
  }
Код:
  if(strcmp(cmdtext, "/take", true) == 0)
  {
  new Float:X;
  new Float:Y;
  new Float:Z;
  GetObjectPos(gun, x, y, z);
  DestroyObject(gun);
  GivePlayerWeapon(playerid, 29, +amount); // smg
  }
  return 1;
  }
its all i know not tested
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)