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
#2

Hey you can try taking some ideas off this filterscript it has the pickup gun working.
https://sampforum.blast.hk/showthread.php?tid=151633
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)