19.03.2014, 11:07
Hey guys I have this code:
I want to make it like when i press key_crouch it gives me the weapon not when I enter it, Can anyone help me at this. and also I dont want it like I press crouch then i enter and get the pickup, simply to stand in the pickup and press c. I am unable to put the OnWeaponDropPickup(playerid, pickupid) under onPlayerKeyStateChange because it uses pickupid. Please help
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
OnWeaponDropPickup(playerid, pickupid)
return 1;
}
stock OnWeaponDropPickup(playerid, pickupid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
for(new a=0; a<13; a++)
{
if(WeaponDrop[i][a] == pickupid)
{
WeaponDrop[i][a] = -1;
DestroyPickup(pickupid);
GivePlayerWeapon(playerid, WeaponData[i][a][0], WeaponData[i][a][1]);
WeaponData[i][a][0] = -1;
WeaponData[i][a][1] = -1;
}
}
if(WeaponDrop[i][13] == pickupid)
{
WeaponDrop[i][13] = -1000;
DestroyPickup(pickupid);
GivePlayerMoney(playerid, 1000);
WeaponData[i][13][0] = -1;
WeaponData[i][13][1] = -1;
}
}
return 1;
}