SA-MP Forums Archive
[HELP] WeaponDetector - 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: [HELP] WeaponDetector (/showthread.php?tid=309766)



[HELP] WeaponDetector - Kelvin_Cesar - 09.01.2012


PHP код:
forward DetectorArmas(playerid);
public 
DetectorArmas(playerid)
{
    if(
IsPlayerInRangeOfPoint(playerid2.0247.8819,63.5701,1003.6406))
     {
        if(
Armas[playerid] == 0)
         {
               for (new 
013i++) GetPlayerWeaponData(playeridiweapons[i][0][playerid], weapons[i][1][playerid])
            
Armas[playerid] = 1;
            
ResetPlayerWeapons(playerid);
            
SendClientMessage(playerid,0xFF0000AA,"Vocк deixou suas armas no detector de metal");
           }
    }
    if(
IsPlayerInRangeOfPoint(playerid2.0245.8359,63.4817,1003.6406))
    {
        if(
Armas[playerid] == 1)
         {
              for (new 
013i++) GivePlayerWeapon(playeridweapons[i][0][playerid], weapons[i][1][playerid]);
            
SendClientMessage(playerid0xFF0000AA," ** Pegando a arma dos outros nй!");
        }
    }
     return 
1;

The code is not working , when the player passes the coordinates he did not lose the gun ...


Re: [HELP] WeaponDetector - Tanush123 - 09.01.2012

pawn Код:
if(Armas[playerid] == 0)
         {
               for (new i = 0; i < 13; i++) GetPlayerWeaponData(playerid, i, weapons[i][0][playerid], weapons[i][1][playerid])
            ResetPlayerWeapons(playerid);
            SendClientMessage(playerid,0xFF0000AA,"Vocк deixou suas armas no detector de metal");
            Armas[playerid] = 1;
           }