Pickup the gun
#1

i have made a command that drops and picks guns,the dropping thing works,but the pickup,with i do the command it does the rp but it doesnt give me the gun:
pawn Код:
if(strcmp(cmd, "/pickupgun", true) == 0)
    {
        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, sendername, sizeof(sendername));
                    DestroyDynamicObject(DropObject[i]);
                    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;
                    GivePlayerWeapon(playerid,DropInfo[i][DropGunAmmount][0], DropInfo[i][DropGunAmmount][1]);
                    format(string, sizeof(string), "* %s picks up a weapon .", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    return 1;
                }
            }
        }
        return 1;
    }
DropInfo[i][DropGunAmmount][0] means the model
DropInfo[i][DropGunAmmount][1] means the ammo,i defined them both
Reply


Messages In This Thread
Pickup the gun - by iBots - 06.02.2014, 17:49
Re: Pickup the gun - by Crypto20 - 07.02.2014, 04:10

Forum Jump:


Users browsing this thread: 1 Guest(s)