[PLEASE HELP]Enemy Gangzone Message
#1

Hi,
I've got 2 Gangzone's, let's say gang A and gang B
Now, when someone from gang A enters gang B's gangzone, i wan't the player to receive a message like "You are on enimy groun".
How can I do this?

Thanks (:

Btw; Sorry for my bad English.. I'm Dutch.
Reply
#2

YSI - http://forum.sa-mp.com/index.php?topic=84400.0
Reply
#3

Quote:
Originally Posted by CrαcK
Can you explain how I have to do it with YSI, because i'm not a very good scripter

Thanks (:
Reply
#4

Look through pawno\include\YSI\Visual\YSI_zones.own for callbacks and functions.
Reply
#5

Just make a timer and get the players pos. If he's in an enemy gang zone, then display the message
Search for IsPlayerInZone or something
Reply
#6

Quote:
Originally Posted by dice7
Just make a timer and get the players pos. If he's in an enemy gang zone, then display the message
Search for IsPlayerInZone or something
So, I TRIED to make a script with IsPlayerInZone, but it doesn't compile (Ive got a few errors)...
ERRORS:
Код:
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(748) : error 055: start of function body without function header
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(749) : error 010: invalid function or declaration
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(751) : error 010: invalid function or declaration
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(756) : error 010: invalid function or declaration
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(758) : error 010: invalid function or declaration
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(764) : warning 203: symbol is never used: "Zone"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
CODE (Parts of my GM):
Код:
forward CheckPlayerGangzone(playerid);

new Zone[MAX_PLAYERS];

Under OnGameModeInit:
SetTimer("CheckPlayerGangZone",1000,1);

public CheckPlayerGangZone(playerid);
{
	if (gTeam[playerid]==TEAM_TERROR)
	{
		if (IsPlayerInZone(playerid,armyzone)==1)
		{
	      Gangzone[playerid] = TEAM_ARMY;
		}
	}
	else
	{
		if (IsPlayerInZone(playerid,terrorzone)==1)
		{
	      Gangzone[playerid] = TEAM_TERROR;
		}
	}
}
Help Please ;s
Thanks
Reply
#7

Use SetTimerEx for loop through all players with your timer.
And remove the [size=20px];[/size] after public CheckPlayerGangZone(playerid)
https://sampwiki.blast.hk/wiki/SetTimerEx

Looping example:
pawn Код:
//GameModeInit
SetTimer("CheckPlayerGangZone",1000,1);

forward CheckPlayerGangZone();
public CheckPlayerGangZone()
{
  for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  {
    // if (gTeam[playerid]==TEAM_TERROR) etc ...
  }
}
SetTimerEx example

pawn Код:
//OnPlayerConnect
SetTimerEx("CheckPlayerGangZone",1000,1, "d", playerid);

forward CheckPlayerGangZone(playerid);
public CheckPlayerGangZone(playerid)
{
    // if (gTeam[playerid]==TEAM_TERROR) etc ...
}
Reply
#8

Quote:
Originally Posted by dice7
Use SetTimerEx for loop through all players with your timer.
And remove the [size=20px];[/size] after public CheckPlayerGangZone(playerid)
https://sampwiki.blast.hk/wiki/SetTimerEx

Looping example:
pawn Код:
//GameModeInit
SetTimer("CheckPlayerGangZone",1000,1);

forward CheckPlayerGangZone();
public CheckPlayerGangZone()
{
  for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  {
    // if (gTeam[playerid]==TEAM_TERROR) etc ...
  }
}
SetTimerEx example

pawn Код:
//OnPlayerConnect
SetTimerEx("CheckPlayerGangZone",1000,1, "d", playerid);

forward CheckPlayerGangZone(playerid);
public CheckPlayerGangZone(playerid)
{
    // if (gTeam[playerid]==TEAM_TERROR) etc ...
}
Thanks for your response, but I don't know how to use SetTimerEx
Could you maybe make the timer? Please?
Reply
#9

Quote:
Originally Posted by Nameless303
Quote:
Originally Posted by dice7
Use SetTimerEx for loop through all players with your timer.
And remove the [size=20px];[/size] after public CheckPlayerGangZone(playerid)
https://sampwiki.blast.hk/wiki/SetTimerEx

Looping example:
pawn Код:
//GameModeInit
SetTimer("CheckPlayerGangZone",1000,1);

forward CheckPlayerGangZone();
public CheckPlayerGangZone()
{
  for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  {
    // if (gTeam[playerid]==TEAM_TERROR) etc ...
  }
}
SetTimerEx example

pawn Код:
//OnPlayerConnect
SetTimerEx("CheckPlayerGangZone",1000,1, "d", playerid);

forward CheckPlayerGangZone(playerid);
public CheckPlayerGangZone(playerid)
{
    // if (gTeam[playerid]==TEAM_TERROR) etc ...
}
Thanks for your response, but I don't know how to use SetTimerEx
Could you maybe make the timer? Please?
I've changed the timer thing, but I still get errors;
Код:
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(746) : warning 235: public function lacks forward declaration (symbol "CheckPlayerGangZone")
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(750) : error 017: undefined symbol "IsPlayerInZone"
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(752) : error 017: undefined symbol "Gangzone"
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(752) : warning 215: expression has no effect
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(752) : error 001: expected token: ";", but found "]"
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(752) : error 029: invalid expression, assumed zero
C:\Users\Alex\Desktop\PSWW\gamemodes\GM.pwn(752) : fatal error 107: too many error messages on one line
Please Help ;S
Reply
#10

Show your code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)