SA-MP Forums Archive
GiveAllGun in radius command. - 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: GiveAllGun in radius command. (/showthread.php?tid=631096)



GiveAllGun in radius command. - MyUndiesSmell - 23.03.2017

Hello, I'm trying to find a way to make a giveallgun command. The catch is that the player has to be in the radius set by the admin. I know how to create the giveallgun command just can't figure out how to put if the player is in the radius. Thanks.


Re: GiveAllGun in radius command. - Toroi - 23.03.2017

PHP код:
yourcommand
{
    
check if the issuer is admin, if not, return whatever shit you want;
    
create 3 float variables;
    
save the player position with GetPlayerPos in these variables previously created;
    
yourdesiredplayerloop
    
{
        
check if the player is connected, if not, continue the loop;
        
check if the player is in range with IsPlayerInRangeOfPoint(use the variables here)
        {
            
give the players in the loop the weapon you want if they meet the requirement;
        }
    }
    return 
1;

Thats how it'd look.


Re: GiveAllGun in radius command. - MyUndiesSmell - 23.03.2017

Thank you.