SA-MP Forums Archive
Question! [REP everyday] :D - 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)
+--- Thread: Question! [REP everyday] :D (/showthread.php?tid=585527)



Question! [REP everyday] :D - MichaelJones - 14.08.2015

Yo guys , I never scripted dayz or hunger games mode before
So I wanted to ask a question
How to make a weapon object on the ground and when you press LALT you pick it up and put it into the inventory?

NOTE: not a pickup , I mean an weapon object dropped on the ground.


Re: Question! [REP everyday] :D - MichaelJones - 14.08.2015

Whoever tells me , Get a rep everyday , everyday a free rep from me :P


Re: Question! [REP everyday] :D - iTakelot - 14.08.2015

Good depends on your system, from a look at this: Link

I hope this helps


Re: Question! [REP everyday] :D - MichaelJones - 14.08.2015

No english version please? It didn't help because I can't understant , Anyone else?


Re: Question! [REP everyday] :D - MichaelJones - 14.08.2015

Anyone


Re: Question! [REP everyday] :D - iTakelot - 14.08.2015

I have not found an equal in inglish script, I recommend that translates filterscript I went through for you ..


Re: Question! [REP everyday] :D - MichaelJones - 14.08.2015

Well what this filterscript can do?


Re: Question! [REP everyday] :D - jlalt - 14.08.2015

hmmmmm
PHP код:
#include <a_samp>
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
new minigun;
public 
OnFilterScriptInit()
{
minigun Create the object of minigun here D:
return 
1;
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
   if(
PRESSED(KEY_WALK)) {
      new 
Float:X,Float:Y,Float:Z;
      
GetObjectPos(minigunXYZ);
      if(
IsPlayerInRangeOfPoint(playerid1XYZ))
      
GivePlayerWeapon(playerid381000);
      
SendClientMessage(playerid, -1"Enjoy the Minigun :P");
      return 
1;
      }
   return 
1;

for destroy object after player pick it up and it will be back after 10 seconds:
PHP код:
#include <a_samp>
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
new minigun[MAX_PLAYERS];
public 
OnFilterScriptInit()
{
return 
1;
}
public 
OnPlayerConnect(playerid)
{
minigun[playerid] = CreatePlayerObject(playeridobjectidXYZ000);
return 
1;
}
    
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
   if(
PRESSED(KEY_WALK)) {
      new 
Float:X,Float:Y,Float:Z;
      
GetObjectPos(minigun[playerid], XYZ);
      if(
IsPlayerInRangeOfPoint(playerid1XYZ))
      
GivePlayerWeapon(playerid381000);
      
SendClientMessage(playerid, -1"Enjoy the Minigun :P");
      
DestroyPlayerObject(playeridminigun[playerid]);
      
SetTimerEx("backupminigun"100000"d"playerid);
      return 
1;
      }
   return 
1;
}
forward backupminigun(playerid);
public 
backupminigun(playerid)
{
minigun[playerid] = CreatePlayerObject(playeridobjectidXYZ000);
return 
1;

i have seen some weapons object id but i don't know if there are one for minigun D:




Re: Question! [REP everyday] :D - MichaelJones - 14.08.2015

Ty , very thanks


Re: Question! [REP everyday] :D - jlalt - 14.08.2015

Quote:
Originally Posted by MichaelJones
Посмотреть сообщение
Ty , very thanks
Don't forget to +rep every day d: