SA-MP Forums Archive
Range Point. - 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: Range Point. (/showthread.php?tid=253734)



Range Point. - Alex_Obando - 07.05.2011

I need this:

If the player is in range point give 100 minigun ammo, and if it gets in the snd range point remove the minigun, but it just gives me 100 and sometimes no work, help pls

pawn Код:
public OnPlayerUpdate(playerid)
{

if(IsPlayerInRangeOfPoint(playerid,30,-163.2511,2620.0977,78.8033,28.4597)) {
    if(GetPVarInt(playerid,"mini") == 0) {
        SetPVarInt(playerid,"mini",1);
        GivePlayerWeapon(playerid,38,100000);
    }
}
if(IsPlayerInRangeOfPoint(playerid, 3.0,-165.4904,2619.2251,98.2914,233.3485))
    {
        ResetPlayerWeapons(playerid);
    }
}



Re: Range Point. - Ronaldo_raul™ - 07.05.2011

Код:
 ResetPlayerWeapons(playerid);
I think this is must be the problem...........have you checked the rang of this line ??


Re: Range Point. - [MWR]Blood - 07.05.2011

Just do:
pawn Код:
public OnPlayerUpdate(playerid)
{

if(IsPlayerInRangeOfPoint(playerid,30,-163.2511,2620.0977,78.8033,28.4597)) {
    if(GetPVarInt(playerid,"mini") == 0) {
        SetPVarInt(playerid,"mini",1);
        GivePlayerWeapon(playerid,38,100000);
    }
}
if(IsPlayerInRangeOfPoint(playerid, 3.0,-165.4904,2619.2251,98.2914,233.3485))
    {
        ResetPlayerWeapons(playerid);
        SetPVarInt(playerid,"mini",0);
    }
}
And better reset the weapons further away from the point where you are giving the weapon.