Why is this not destroying the object?
#1

Title says all, it doesn't destroy the weapon's object. I don't understand why, I'm using incognitos streamer etc
pawn Code:
CMD:pickupgun(playerid, params[])
{
    new string[128];
    for(new i=1;i < MAX_DROP_ITEMS;i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0,DropGunX[i],DropGunY[i],DropGunZ[i]))
        {
            if(GetPlayerVirtualWorld(playerid) == DropGunVW[i] && GetPlayerInterior(playerid) == DropGunInterior[i])
            {
                GivePlayerWeapon(playerid,DropGunID[i],DropGunAmmo[i]);
                DropGunX[i] = 0.0;
                DropGunY[i] = 0.0;
                DropGunZ[i] = 0.0;
                DropGunID[i] = 0;
                DropGunAmmo[i] = 0;
                DestroyDynamicObject(DropObject[i]);
                format(string, sizeof(string), "* %s has picked up a weapon.", GetNameEx(playerid));
                ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
            }
        }
    }
    return 1;
}
Reply
#2

Try with this
pawn Code:
CMD:pickupgun(playerid, params[])
{
    new string[128];
    for(new i=1;i < MAX_DROP_ITEMS;i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0,DropGunX[i],DropGunY[i],DropGunZ[i]))
        {
            if(GetPlayerVirtualWorld(playerid) == DropGunVW[i] && GetPlayerInterior(playerid) == DropGunInterior[i])
            {
                GivePlayerWeapon(playerid,DropGunID[i],DropGunAmmo[i]);
                DropGunX[i] = 0.0;
                DropGunY[i] = 0.0;
                DropGunZ[i] = 0.0;
                DropGunID[i] = 0;
                DropGunAmmo[i] = 0;
                DestroyObject(DropObject[i]);
                format(string, sizeof(string), "* %s has picked up a weapon.", GetNameEx(playerid));
                ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
            }
        }
    }
    return 1;
}
Not tested
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)