====================================================1.0 Pegando cordenadas===============================================
Galera abaixo uma imagem de como pegar Cordenadas de uma Gz estao vendo a img abaixo ? O circulo laranja dentro dele aquele quadradinho vamos fazer uma Gz nele é so um exemplo vcs podem fazer onde bem quererem Estao vendo aqueles pontinhos roxos ? é neles que iram dar /save Inicio Gz e /save Final Gz sempre na quina de cada lado
====================================================1.1 Criando as News ===============================================
Topo do GM:
- Código:
new GZMaconha
new donomaconha;
new GuerranoMaconha;
new ProvocoMaconha[MAX_PLAYERS];
new Dominando[MAX_PLAYERS]; // So ponha este se o seu gm n tiver esse codigo o resto ponha tudo
new TempoGuerraMaconha;
forward GuerraMaconha(playerid);
====================================================1.2 Ultilizando as cordenadas Pegas(CRIANDO A GZ)===============================================
Com as cordenadas pegas que nas quais seriam essas:
- Código:
AddPlayerClass(173,-1200.7098,-1070.9456,128.8744,360.0000,0,0,0,0,0,0); //Inicio Gz
AddPlayerClass(173,-1000.9442,-908.1744,129.2058,3.4466,0,0,0,0,0,0); // Final Gz
Vocês ultilizaram para criar a Gz somente a X e Y de cada uma eu vou fazer uma Gz Plantaçao de Maconha naquele local Observem:
Em OnGameModeInit
- Código:
GZMaconha = GangZoneCreate(-1200.7098, -1070.9456, -1000.9442, -908.1744);
Em OnPlayerConnect
- Código:
if(donomaconha == 0)
{
GangZoneShowForPlayer(playerid, GZMaconha, 0xC0C0C0AA);
}
Em OnPlayerDisconnect
- Código:
if(Provocomaconha[playerid] == 1)
{
GangZoneStopFlashForAll(GZMaconha);
GangZoneShowForAll(GZMaconha, 0xFFFFFF96);
GuerranoMaconha = 0;
ProvocoMaconha[playerid] = 0;
donomaconha = 0;
Dominando[playerid] = 0;
KillTimer(TempoGuerraMaconha);
}
====================================================1.3 Comando /dominar===============================================
No cmd /dominar acrescente isso: Mas acrescente do geito que esta ou podera bugar o GM ou dps mude as orgs que podem dominar alterando o PlayerInfo Code abaixo:
- Código:
//Dominio Maconha
if(PlayerInfo[playerid][pMembro] == 34 || PlayerInfo[playerid][pLider] == 34)// PM
{
if(IsPlayerInMaconha(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Você ja está dominando um territorio.");
return true;
}
if(GuerranoMaconha == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Já está tendo uma guerra nesse territorio.");
return true;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e os Los Granels estao dominando Plantaçao de Maconha SF",playername);
SendClientMessageToAll(COR_VAGOS, string);
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as gangues foram avisadas!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar está area .");
GangZoneFlashForAll(GZMaconha,COR_VAGOS);
Dominando[playerid] = 1;
ProvocoMaconha[playerid] = 1;
GuerranoMaconha = 1;
TempoGuerraMaconha = SetTimerEx("GuerraMaconha", 60000, 0, "i", playerid);
return true;
}
if(IsPlayerInMaconha(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Você ja está dominando um territorio.");
return true;
}
if(GuerranoMaconha == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Já está tendo uma guerra nesse territorio.");
return true;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e os Los Granels estao dominando Plantaçao de Maconha SF",playername);
SendClientMessageToAll(COR_VAGOS, string);
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as gangues foram avisadas!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar está area .");
GangZoneFlashForAll(GZMaconha,COR_VAGOS);
Dominando[playerid] = 1;
ProvocoMaconha[playerid] = 1;
GuerranoMaconha = 1;
TempoGuerraMaconha = SetTimerEx("GuerraMaconha", 60000, 0, "i", playerid);
return true;
}
if(IsPlayerInMaconha(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Você ja está dominando um territorio.");
return true;
}
if(GuerranoMaconha == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Já está tendo uma guerra nesse territorio.");
return true;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e os Los Granels estao dominando Plantaçao de Maconha SF",playername);
SendClientMessageToAll(COR_VAGOS, string);
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as gangues foram avisadas!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar está area .");
GangZoneFlashForAll(GZMaconha,COR_VAGOS);
Dominando[playerid] = 1;
ProvocoMaconha[playerid] = 1;
GuerranoMaconha = 1;
TempoGuerraMaconha = SetTimerEx("GuerraMaconha", 60000, 0, "i", playerid);
return true;
}
if(IsPlayerInMaconha(playerid))
{
if(Dominando[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Você ja está dominando um territorio.");
return true;
}
if(GuerranoMaconha == 1)
{
SendClientMessage(playerid, COLOR_GRAD5, "Já está tendo uma guerra nesse territorio.");
return true;
}
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e os Los Granels estao dominando Plantaçao de Maconha SF",playername);
SendClientMessageToAll(COR_VAGOS, string);
SendClientMessage(playerid, COLOR_GRAD3, "Fique esperto, todas as gangues foram avisadas!");
SendClientMessage(playerid, COLOR_GRAD5, "Espere 1 minuto para dominar está area .");
GangZoneFlashForAll(GZMaconha,COR_VAGOS);
Dominando[playerid] = 1;
ProvocoMaconha[playerid] = 1;
GuerranoMaconha = 1;
TempoGuerraMaconha = SetTimerEx("GuerraMaconha", 60000, 0, "i", playerid);
return true;
}
else
{
SendClientMessage(playerid, COLOR_GRAD3, "Você não está em nenhum território!");
}
return true;
}
====================================================1.4 Terminando o Timer===============================================
Final do GameMode
- Código:
//Timer Maconha
public GuerraMaconha(playerid)
{
new string[128];
new playername[MAX_PLAYER_NAME];
if(PlayerInfo[playerid][pMembro] == 34 || PlayerInfo[playerid][pLider] == 34)
{
if(ProvocoMaconha[playerid] == 1)
{
if(IsPlayerInMaconha(playerid))
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e os Los Granels dominaram Plantaçao de Maconha SF",playername);
SendClientMessageToAll(COR_VAGOS, string);
SendClientMessage(playerid, -1, "Você Dominou a GangZone.");
GangZoneStopFlashForAll(GZMaconha);
GangZoneShowForAll(GZMaconha, COR_VAGOS);
Dominando[playerid] = 0;
ProvocoMaconha[playerid] = 0;
GuerranoMaconha = 0;
donomaconha = 1;
KillTimer(TempoGuerraMaconha);
return true;
}
else
{
SendClientMessage(playerid, COR_VAGOS, "Você não está no Plantaçao de Maconha SF");
Dominando[playerid] = 0;
GangZoneStopFlashForAll(GZMaconha);
GangZoneShowForAll(GZMaconha, 0xFFFFFF96);
ProvocoMaconha[playerid] = 0;
GuerranoMaconha = 0;
donomaconha = 0;
KillTimer(TempoGuerraMaconha);
return true;
}
}
return true;
}
if(PlayerInfo[playerid][pMembro] == 34 || PlayerInfo[playerid][pLider] == 34)
{
if(ProvocoMaconha[playerid] == 1)
{
if(IsPlayerInMaconha(playerid))
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e os Los Granels dominaram Plantaçao de Maconha SF",playername);
SendClientMessageToAll(COR_VAGOS, string);
SendClientMessage(playerid, -1, "Você Dominou a GangZone.");
GangZoneStopFlashForAll(GZMaconha);
GangZoneShowForAll(GZMaconha, COR_VAGOS);
Dominando[playerid] = 0;
ProvocoMaconha[playerid] = 0;
GuerranoMaconha = 0;
donomaconha = 1;
KillTimer(TempoGuerraMaconha);
return true;
}
else
{
SendClientMessage(playerid, COR_VAGOS, "Você não está no Plantaçao de Maconha SF");
Dominando[playerid] = 0;
GangZoneStopFlashForAll(GZMaconha);
GangZoneShowForAll(GZMaconha, 0xFFFFFF96);
ProvocoMaconha[playerid] = 0;
GuerranoMaconha = 0;
donomaconha = 0;
KillTimer(TempoGuerraMaconha);
return true;
}
}
return true;
}
if(PlayerInfo[playerid][pMembro] == 34 || PlayerInfo[playerid][pLider] == 34)
{
if(ProvocoMaconha[playerid] == 1)
{
if(IsPlayerInMaconha(playerid))
{
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s e os Los Granels dominaram Plantaçao de Maconha SF",playername);
SendClientMessageToAll(COR_VAGOS, string);
SendClientMessage(playerid, -1, "Você Dominou a GangZone.");
GangZoneStopFlashForAll(GZMaconha);
GangZoneShowForAll(GZMaconha, COR_VAGOS);
Dominando[playerid] = 0;
ProvocoMaconha[playerid] = 0;
GuerranoMaconha = 0;
donomaconha = 1;
KillTimer(TempoGuerraMaconha);
return true;
}
else
{
SendClientMessage(playerid, COR_VAGOS, "Você não está no Plantaçao de Maconha SF");
Dominando[playerid] = 0;
GangZoneStopFlashForAll(GZMaconha);
GangZoneShowForAll(GZMaconha, 0xFFFFFF96);
ProvocoMaconha[playerid] = 0;
GuerranoMaconha = 0;
donomaconha = 0;
KillTimer(TempoGuerraMaconha);
return true;
}
}
return true;
}
return true;
}
====================================================1.5 Definindo IsPlayerInMaconha===============================================
Pegando a cordenada do GZMaconha = ......
Completem isso e coloque no final do GameMode
- Código:
stock IsPlayerInMaconha(playerid){new Float:x,Float:y,Float:z;GetPlayerPos(playerid, x, y, z);if(x >= -1200.6589 && y >= -1070.9642 && x <= -1001.0076 && y <= -908.0914) return true;else return 0;}
CREDITOS DO TUTORIAL: The_MentalistRSF
Ajudei agradeça ^^