[DUV]Sistema de GANG dominavel
#4

Quote:
Originally Posted by [BR
Michael ]
Code:
#include <a_samp>

#define gang_exemplo 0
#define gang_outro 1
#define COR_RED			0x0000CDFF
forward funcaogz(playerid);
forward dominou(playerid);
new gang[MAX_PLAYERS];
new GZ;


public OnGameModeInit()
{
  GZ = GangZoneCreate(2045,079, -1148,917, 2284,658, -967,3207);
 return 1;
}

public OnPlayerConnect(playerid)
{
 GangZoneShowForPlayer(playerid, GZ, 0x00000096);
 return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/Dominar", cmdtext, true, 10) == 0)
	{
  	SetTimerEx("funcaogz", 1000, 0,"e",playerid);

 	 return 1;
}

public funcaogz(playerid)
{
 if(IsPlayerInArea(playerid,2045,079, -1148,917, 2284,658, -967,3207))
 {
 	 if(gang[playerid] == gang_exemplo)
 	{
	format(string,sizeof(string),"(Aviso) %s e a a gang exemplo estгo dominando o GZ taltal",name);
	SendClientMessageToAll(COR_RED,string);
	GangZoneFlashForAll(GZ,GetPlayerColor(playerid));
	SetTimerEx("dominou", 30000, 0,"e",playerid);
 	}

 	 if(gang[playerid] == gang_outro)
 	{
	format(string,sizeof(string),"(Aviso) %s e a a gang outro estгo dominando o GZ taltal",name);
	SendClientMessageToAll(COR_RED,string);
	GangZoneFlashForAll(GZ,GetPlayerColor(playerid));
	SetTimerEx("dominou", 30000, 0,"e",playerid);
 	}
 }
 return 1;
}

public dominou(playerid)
{
 	 if(gang[playerid] == gang_exemplo)
 	{
	format(string,sizeof(string),"(Aviso) %s e a a gang exemplo dominaram a GZ taltal",name);
	SendClientMessageToAll(COR_RED,string);
 	GangZoneStopFlashForAll(GZ);
 	GangZoneHideForAll(GZ);
 	GangZoneShowForAll(GZ,GetPlayerColor(playerid));

 	}

 	 if(gang[playerid] == gang_outro)
 	{
	format(string,sizeof(string),"(Aviso) %s e a a gang outro dominaram o GZ taltal",name);
	SendClientMessageToAll(COR_RED,string);
	GangZoneStopFlashForAll(GZ);
    GangZoneHideForAll(GZ);
 	GangZoneShowForAll(GZ,GetPlayerColor(playerid));

 	}
 return 1;
}

 stock strtok(const string[], &index,seperator=' ')
{
	new length = strlen(string);
	new offset = index;
	new result[255];
	while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}

	result[index - offset] = EOS;
	if ((index < length) && (string[index] == seperator))
	{
		index++;
	}
	return result;
}


stock IsPlayerInArea(playerid, Float:xmin, Float:ymin, Float:xmax, Float:ymax)
{
  new Float:x, Float:y, Float:z;
  GetPlayerPos(playerid, x, y, z);
  if(x >= xmin && y >= ymin && xmax <= xmax && y <= ymax) return true;
  return false;
}
Feito por [NNF]Hell
Tentei implementar a um servidor e ficou cheio de erros.
Reply


Messages In This Thread
[DUV]Sistema de GANG dominavel - by sergio_killer - 10.11.2009, 17:36
Re: [DUV]Sistema de GANG dominavel - by IceCold[BR] - 11.11.2009, 14:14
Re: [DUV]Sistema de GANG dominavel - by [BR]Michael - 12.11.2009, 18:19
Re: [DUV]Sistema de GANG dominavel - by JustinSton - 14.11.2009, 17:49
Re: [DUV]Sistema de GANG dominavel - by sergio_killer - 14.11.2009, 19:39
Re: [DUV]Sistema de GANG dominavel - by [BR]Michael - 14.11.2009, 20:34
Re: [DUV]Sistema de GANG dominavel - by DJ_Glauco - 15.11.2009, 11:41
Re: [DUV]Sistema de GANG dominavel - by sergio_killer - 15.11.2009, 12:04
Re: [DUV]Sistema de GANG dominavel - by JustinSton - 15.11.2009, 14:02
Re: [DUV]Sistema de GANG dominavel - by John_Race - 15.11.2009, 15:09

Forum Jump:


Users browsing this thread: 1 Guest(s)