Guten Tag liebes Breadfish,
ich wollte euch fragen wie ich Abfrage, welche Weapon ID der Spieler in der Hand hat und sobalt er stirbt sie dropt.
forward DropPlayerWeapons(playerid);
public DropPlayerWeapons(playerid)
{
new playerweapons[13][2];
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i=0; i<13; i++)
{
GetPlayerWeaponData(playerid, i, playerweapons[i][0], playerweapons[i][1]);
new model = GetWeaponType(playerweapons[i][0]);
new times = floatround(playerweapons[i][1]/10.0001);
new Float:X = x + (random(3) - random(3));
new Float:Y = y + (random(3) - random(3));
if(playerweapons[i][1] != 0 && model != -1)
{
if(times > DropLimit) times = DropLimit;
for(new a=0; a<times; a++)
{
new pickupid = CreatePickup(model, 3, X, Y, z);
SetTimerEx("DeletePickup", DeleteTime*1000, false, "d", pickupid);
}
}
}
return 1;
}