Weapon pickup won't dissapear! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Weapon pickup won't dissapear! (
/showthread.php?tid=649572)
Weapon pickup won't dissapear! -
ivndosos - 11.02.2018
I've made a weapon pickup script but for some reason after death the pickups won't dissapear!
Код:
forward DropPlayerWeapons(playerid);
public DropPlayerWeapons(playerid)
{
new pweapons[13][2];
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
for(new i = 0; i < 13; i ++)
{
GetPlayerWeaponData(playerid, i, pweapons[i][0], pweapons[i][1]);
new model = GetWeaponType(pweapons[i][0]);
new times = floatround(pweapons[i][1]/10.0001);
new Float:X = x + (random(3) - random(3));
new Float:Y = y + (random(3) - random(3));
if(pweapons[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("DeleteWeaponPickup", WeaponDissapearTime*10000, false, "d", pickupid);
}
}
}
return 1;
}
forward DeleteWeaponPickup(pickupid);
public DeleteWeaponPickup(pickupid)
{
DestroyPickup(pickupid);
return 1;
}
Re: Weapon pickup won't dissapear! -
Mugala - 11.02.2018
what is WeaponDissapearTime? can u show us a code?
Re: Weapon pickup won't dissapear! -
ivndosos - 11.02.2018
Код:
new WeaponDissapearTime = 10;
Re: Weapon pickup won't dissapear! -
Mugala - 11.02.2018
okay it have to be hidden in 100sec (1m and 40sec) are u sure u're waiting for right/full time?
Re: Weapon pickup won't dissapear! -
ivndosos - 11.02.2018
I want it to disappear after about.. uhm 10 seconds I would say.
Re: Weapon pickup won't dissapear! -
Mugala - 11.02.2018
yeah, than u must remove one 0 from this code
SetTimerEx("DeleteWeaponPickup", WeaponDissapearTime*10000, false, "d", pickupid);
and it must be
SetTimerEx("DeleteWeaponPickup", WeaponDissapearTime*1000, false, "d", pickupid);
try this and wait for a 10sec.
Re: Weapon pickup won't dissapear! -
ivndosos - 11.02.2018
Thanks, I haven't noticed, lol.