Weapon pickup won't dissapear!
#1

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;
}
Reply
#2

what is WeaponDissapearTime? can u show us a code?
Reply
#3

Код:
new WeaponDissapearTime = 10;
Reply
#4

okay it have to be hidden in 100sec (1m and 40sec) are u sure u're waiting for right/full time?
Reply
#5

I want it to disappear after about.. uhm 10 seconds I would say.
Reply
#6

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.
Reply
#7

Thanks, I haven't noticed, lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)