SA-MP Forums Archive
Problem set object weapon drop - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem set object weapon drop (/showthread.php?tid=128908)



Problem set object weapon drop - nico005 - 20.02.2010

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.



Re: Problem set object weapon drop - nico005 - 22.02.2010

up


Re: Problem set object weapon drop - rs2fun111 - 22.02.2010

//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