weapon pickups not destroying?
#1

PHP код:
function create_player_drops(playerid)
{
    new 
FloatxFloatyFloatzp_weaponp_ammogetspace;
    
// Health
    
GetPlayerPos(playeridxyz);
    
pickup_Health CreatePickup(12403xy+1z, -1); // 1240 health pickup
        
    
for (new 012i++){
    
         
// weapon pickups
        
getspace++;
        
GetPlayerWeaponData(playeridip_weaponp_ammo);
        
pickup_Weapon CreatePickup(WeaponObject(p_weapon), 3x+getspaceyz, -1);}
        
    
SetTimerEx("DestroyPlayerDrops"10000false"i"playerid);
        
    return 
1;

and

PHP код:
forward DestroyPlayerDrops(playerid);
public 
DestroyPlayerDrops(playerid)
{
    
DestroyPickup(pickup_Health);
    
DestroyPickup(pickup_Weapon);
    return 
1;

Reply
#2

Have you tested if DestroyPlayerDrops gets executed at all?
Try to add a debug msg.
Reply
#3

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Have you tested if DestroyPlayerDrops gets executed at all?
Try to add a debug msg.
It works, the health pickup is destroying but not the weapons, and people already told that i'm overwriting the iteration but i got no clue how to make it disappear at this point.
Reply
#4

Show WeaponObject.
Reply
#5

Now you are deleting only the very last weapon

PHP код:
function create_player_drops(playerid)
{
    new 
FloatxFloatyFloatzp_weaponp_ammogetspace;
    
// Health
    
GetPlayerPos(playeridxyz);
    
pickup_Health CreatePickup(12403xy+1z, -1); // 1240 health pickup
        
    
for (new 012i++){
    
         
// weapon pickups
        
GetPlayerWeaponData(playeridip_weaponp_ammo);
        if(
p_weapon 0)
        {
              
pickup_Weapon[getspace] = CreatePickup(WeaponObject(p_weapon), 3x+getspaceyz, -1);
              
getspace++;
        }
    }
        
    
SetTimerEx("DestroyPlayerDrops"10000false"i"playerid);
        
    return 
1;

do the same with deletion part
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)