SA-MP Forums Archive
help weapon slot - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help weapon slot (/showthread.php?tid=171979)



help weapon slot - xinix000 - 28.08.2010

how can i make script that if player have weapon 1 slot return 1;

thks


Re: help weapon slot - Nonameman - 28.08.2010

Hey!

Here it is:
pawn Код:
stock IsWeaponInSlot(playerid, slot)
{
    new wData[13][2];
    for(new s=0; s<13; s++)
    {
        GetPlayerWeaponData(playerid, s, wData[s][0], wData[s][1]);
    }
    if(wData[slot][0] != 0) return 1;
    return 0;
}



Re: help weapon slot - Sergei - 28.08.2010

@Nonameman, you couldn't complicate it mroe, could you?

pawn Код:
stock IsWeaponInSlot(playerid, slot)
{
    new wdata[2]; GetPlayerWeaponData(playerid,slot,wdata[0],wdata[1]);
    if(wdata[0] > 0) return 1;
    else return 0;
}



Re: help weapon slot - Nonameman - 29.08.2010

Offtopic: I could, but I don't think it's a problem. (I haven't used GetPlayerWeaponData() before)