turfs system
#1

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?
Reply
#2

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!
Reply
#3

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)