Drop Guns error
#9

Of course it's not destroying the object, look, you did

new DropObject[MAX_DROP_ITEMS];

in the command, it should be a global variable ( at the top of your script ) so when you drop the object you do like:

DropObject[i] = CreateObject....

Then you will be able to destroy it

Edit:

In your enum of DropInfo, try to add something like this "DropGunExist". Also add like "DropGunObject"
Then in your (for example) /dropgun, you'll add:

pawn Код:
for(new i = 0; i < sizeof(DropInfo); i++)
{
    if(DropInfo[i][DropGunExist] == 0)
    {
        DropInfo[i][DropGunExist] = 1;
        DropInfo[i][DropGunObject] = CreateObject(...);
        //add all the other PosX,PosY,etc
    }
}

CMD:recojerarma(playerid, params[])
{
    new string[128];
    new playername[MAX_PLAYER_NAME];
    for(new i = 0; i < sizeof(DropInfo); i++)
    {
        if (IsPlayerInRangeOfPoint(playerid, 2.0,DropInfo[i][DropGunPosX],DropInfo[i][DropGunPosY],DropInfo[i][DropGunPosZ]))
        {
            if(GetPlayerVirtualWorld(playerid) == DropInfo[i][DropGunVWorld] && GetPlayerInterior(playerid) == DropInfo[i][DropGunVWorld])
            {
                GetPlayerName(playerid, playername, sizeof(playername));
                DestroyDynamicObject(DropInfo[i][DropGunObject]);
                GiveZaiatWeapon(playerid,DropInfo[i][DropGunAmmount][0],DropInfo[i][DropGunAmmount][1]);
                DropInfo[i][DropGunPosX] = 0.0;
                DropInfo[i][DropGunPosY] = 0.0;
                DropInfo[i][DropGunPosZ] = 0.0;
                DropInfo[i][DropGunAmmount][0] = 0;
                DropInfo[i][DropGunAmmount][1] = 0;
                DropInfo[i][DropGunExist] = 0;
                format(string, sizeof(string), "* %s recoje el arma del suelo.", RPN(playerid));
                SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
                return 1;
            }
        }
    }
    return 1;
}
^^Those are just the basic.
Reply


Messages In This Thread
Drop Guns error - by Rhino - 17.03.2013, 21:59
Re: Drop Guns error - by kamzaf - 17.03.2013, 22:26
Respuesta: Drop Guns error - by Rhino - 17.03.2013, 22:51
Respuesta: Drop Guns error - by Rhino - 17.03.2013, 23:19
Re: Drop Guns error - by kamzaf - 17.03.2013, 23:35
Respuesta: Drop Guns error - by Rhino - 17.03.2013, 23:55
Re: Drop Guns error - by lelemaster - 18.03.2013, 00:09
Respuesta: Drop Guns error - by Rhino - 18.03.2013, 00:21
Re: Drop Guns error - by lelemaster - 18.03.2013, 00:36
Respuesta: Drop Guns error - by Rhino - 18.03.2013, 00:49

Forum Jump:


Users browsing this thread: 3 Guest(s)