SA-MP Forums Archive
Pickup the gun - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Pickup the gun (/showthread.php?tid=493029)



Pickup the gun - iBots - 06.02.2014

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


Re: Pickup the gun - Crypto20 - 07.02.2014

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