17.10.2012, 19:29
Hello, i have this command to drop the player weapons.
I wanna make just to drop ONLY the current weapon he's holding, how i can fix it?
I wanna make just to drop ONLY the current weapon he's holding, how i can fix it?
pawn Код:
CMD:d(playerid, params[])
{
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 = GetWeaponModel(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;
}