turfs system - 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: turfs system (
/showthread.php?tid=199420)
turfs system -
Face9000 - 15.12.2010
Hi all,in my gm i've the teams and i have the coordinates for the gangzones too.
I need to code a turf system,so other teams can fight for turfs.
Any tutorial or something?
Re: turfs system -
SkizzoTrick - 15.12.2010
You don't need a tutorial
This is very simple,use something like:
pawn Код:
public OnPlayerSpawn(...)
{
SetTimer("areacheck",500,1);
return 1;
}
forward areacheck(playerid);
public areacheck(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,5.0,x,y,z);//xyz are the coordinates for the point from where you can capture the area
{
if(Gteam[playerid] == your team)
{
GangZoneFlashForAll(gangzone,COLOR_RED);
SendClientMessageToAll(COLOR_RED,"Player is taking area (your area name) ");
SetTimer("WonArea1",15000,1);
}
else
{
SendClientMessage(playerid,"You need to be in the team (team name)");
}
}
return 1;
}
This is THE MOST SIMPLEST WAY!
You still need to define WonArea1 cuz i can't script everything here,sorry!
But remember,if you need a complex script don't use this,this is just a model!
Re: turfs system -
Face9000 - 15.12.2010
LOL Thanks but i've 8 teams and it's pretty hard to code all.
Is there any way to put the 8 team names in an array and read it all for each turf coordinate?