25.03.2017, 12:04
Actually when you enter the pickup now, it picks up the gun.
I want to make the player press an key/make an command if he wants to pick it up.
The problem is that i don't know how to get modelid into OnPlayerKey.
Current code:
How do i make this OnPlayerKey work? :
I need to know how to make modelid work in there.
If i get this to work, i can do it without a pickup, and do it with an object.
I want to make the player press an key/make an command if he wants to pick it up.
The problem is that i don't know how to get modelid into OnPlayerKey.
Current code:
PHP код:
if(modelid == 346)
{
new str[128];
format(str,sizeof(str),"%s(%i) has dropped a 9mm from their inventory.",PlayerName(playerid),playerid);
SendNearbyMessage(playerid,30.0,str,ORANGE);
RemoveItem(playerid,modelid);
ShowInventoryDrop(playerid);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
Dropped9mm=CreateDynamicPickup(346,19,X-2.1, Y, Z,-1);
}
if(pickupid==Dropped9mm)
{
new str[128];
format(str,sizeof(str),"%s(%i) has picked up a 9mm from their surroundings.",PlayerName(playerid),playerid);
SendNearbyMessage(playerid,30.0,str,ORANGE);
AddItem(playerid,346);
}
PHP код:
if(newkeys==KEY_CROUCH)
{
if(modelid == 346)
{
new str[128];
format(str,sizeof(str),"%s(%i) has picked up a 9mm from their surroundings",PlayerName(playerid),playerid);
SendNearbyMessage(playerid,30.0,str,ORANGE);
AddItem(playerid,modelid);
}
}
If i get this to work, i can do it without a pickup, and do it with an object.