Safe zones - 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: Safe zones (
/showthread.php?tid=121815)
Safe zones -
MaXSpeeD - 18.01.2010
ok i looked all over for a tutorial for this but couldent find one...
i want to make places like races and stunt zones safe zones so that when some one enters it it gets rid of weapons and wont let rhinos hunters or hydras in
so if some one knows a tutorial for this can you give me a link?
thanks in advance
Re: Safe zones -
Cry_Wolf - 18.01.2010
For Weapons use this functions:
// All credits for Amit_Barami (Amit B).
Top of script:
pawn Код:
new pWeapons[MAX_PLAYERS][13][2];
pawn Код:
stock SavePlayerWeapons(playerid)
{
for(new i=0;i<13;i++)
{
GetPlayerWeaponData(playerid,i,pWeapons[playerid][i][0],pWeapons[playerid][i][1]);
}
return 1;
}
pawn Код:
stock LoadPlayerWeapons(playerid)
{
for(new i=0;i<13;i++) GivePlayerWeapon(playerid,pWeapons[playerid][i][0],pWeapons[playerid][i][1]);
return 1;
}
and for the Hunter/Hydra system, use IsPlayerInArea / PlayerToPoint function in OnPlayerUpdate callback.
Re: Safe zones -
Joe Staff - 18.01.2010
Don't use either of those functions in OnPlayerUpdate. Use IsPlayerInRangeOfPoint in a 500ms timer, assuming there's only a few safe zones AND you're using 'foreach by ******'