Taking Over Zones
#1

So i have made a simple zone

Код:
new Grove_Base;
Код:
public OnGameModeInit()
{
    Grove_Base = GangZoneCreate(2216.207, -1729.235, 2623.11, -1456.841);
}
Код:
public OnPlayerSpawn(playerid)
{
    GangZoneShowForPlayer(playerid, Grove_Base, 0x80FF8096);
    GangZoneShowForPlayer(playerid, Vagos_Base, 0xF9F20096);
	return 1;
}
How do i make it so a certain coloured person has to be in the area for 60 seconds so they have captured it.
Reply
#2

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/gz"true) == 0)
    {
        new 
Float:Pos[3];
        
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
        if(
Pos[0] > 2216.207 && Pos[0] < 2623.11 && Pos[1] > 2216.207 && Pos[1] < -1456.841)    
        {
            
SendClientMessage(playerid0xFFFF00FF,"Wait 60 seconds here for dominate.");
            
SetTimerEx("Check"600000false"i"playerid);
        }
        return 
1;
    }
    return 
0;
}

forward Check(playerid);

public 
Check(playerid)
{
    new 
Float:Pos[3];
    
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
    if(
Pos[0] > 2216.207 && Pos[0] < 2623.11 && Pos[1] > 2216.207 && Pos[1] < -1456.841)    
    {
        
SendClientMessage(playerid0xFFFF00FF,"GangZone dominated.");
        
// FUNCTIONS ..
    
}
    else { 
SendClientMessage(playerid0xFFFF00FF,"You aren't in the the gangzone"); }
    return 
1;

https://sampwiki.blast.hk/wiki/Areacheck
Reply
#3

doesnt work when i do /gz it gives no such message when im inside the area.
Reply
#4

Use IsPlayerInRangeOfPoint
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)