Question! [REP everyday] :D
#1

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.
Reply
#2

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

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

I hope this helps
Reply
#4

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

Anyone
Reply
#6

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

Well what this filterscript can do?
Reply
#8

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:

Reply
#9

Ty , very thanks
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)