for(new i=0;i<MAX_GZS;i++)
{
GangZonas[i] = GangZoneCreate(GangZone[i][GZCoords][0], GangZone[i][GZCoords][1], GangZone[i][GZCoords][2], GangZone[i][GZCoords][3]);
ContagemDominio[i] = 0;
ChecksDominio[i] = CreateDynamicCP(GangZone[i][CheckCoords][0], GangZone[i][CheckCoords][1], GangZone[i][CheckCoords][2], 4, -1, 0, -1, 100.0);
}
public OnPlayerEnterCheckpoint(playerid)
{
if(CP[playerid] == 1)
{
GameTextForPlayer(playerid, "~r~Alvo localizado!", 2500, 3);
DisablePlayerCheckpoint(playerid);
CP[playerid] = 0;
}
if(CP[playerid] == 2)
{
GameTextForPlayer(playerid, "~r~Voce chegou no seu destino!", 2500, 3);
DisablePlayerCheckpoint(playerid);
CP[playerid] = 0;
HidePlayerArrow(playerid);
}
for(new i=0;i<MAX_GZS;i++)
{
if(GetPlayerVisibleDynamicCP(playerid) == ChecksDominio[i])
{
if(Player[playerid][pAdmin] >= 1 || Player[playerid][pFrente] >= 1 || Player[playerid][pBOPE] >= 4 || Player[playerid][pPMRJ] >= 4 || Player[playerid][pCORE] >= 4)
{
if(ContagemDominio[i] != 0) return 1;
if((strcmp(GZDono[i], "CMD", true) == 0) && Player[playerid][pFaccoes] == 1 ||
(strcmp(GZDono[i], "CMD", true) == 0) && Player[playerid][pFaccoes] == 2 ||
(strcmp(GZDono[i], "CMD", true) == 0) && Player[playerid][pFaccoes] == 3 ||
(strcmp(GZDono[i], "LLL", true) == 0) && Player[playerid][pFaccoes] == 4 ||
(strcmp(GZDono[i], "LLL", true) == 0) && Player[playerid][pFaccoes] == 5 ||
(strcmp(GZDono[i], "LLL", true) == 0) && Player[playerid][pFaccoes] == 6 ||
(strcmp(GZDono[i], "TD3", true) == 0) && Player[playerid][pFaccoes] == 7 ||
(strcmp(GZDono[i], "TD3", true) == 0) && Player[playerid][pFaccoes] == 8 ||
(strcmp(GZDono[i], "TD3", true) == 0) && Player[playerid][pFaccoes] == 9 ||
(strcmp(GZDono[i], "MLC", true) == 0) && Player[playerid][pFaccoes] == 10 ||
(strcmp(GZDono[i], "MLC", true) == 0) && Player[playerid][pFaccoes] == 11 ||
(strcmp(GZDono[i], "PM", true) == 0) && Player[playerid][pCORE] >= 1 ||
(strcmp(GZDono[i], "BOPE", true) == 0) && Player[playerid][pBOPE] >= 1 ||
(strcmp(GZDono[i], "PMRJ", true) == 0) && Player[playerid][pPMRJ] >= 1)
return SendClientMessage(playerid, COLOR_RED, ""TAG_ERRO" Estб favela jб й da sua facзгo!");
SetPVarInt(playerid,"GZAtacada",i);
ContagemDominio[i] = SetTimerEx("Contagem",1000,1,"i",playerid);
GangZoneFlashForAll(GangZonas[GetPVarInt(playerid,"GZAtacada")],GetPlayerColor(playerid));
SendFormattedMessageToAll(COR_INFO, "[NOTICIAS] %s estб dominando a favela '%s' da '%s'.", getPName(playerid), GangZone[i][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]);
return 1;
}
else SendClientMessage(playerid, COLOR_RED, ""TAG_ERRO" Vocк nгo tem permissгo para dominar!");
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
for(new i=0;i<MAX_GZS;i++) { GangZoneShowForPlayer(playerid, GangZonas[i], GangZone[i][GZColor]); }
public OnPlayerLeaveCheckpoint(playerid)
{
for(new i=0;i<MAX_GZS; i++)
{
if(GetPVarInt(playerid,"GZAtacada") != -1)
{
SendClientMessage(playerid, COLOR_RED, ""TAG_ERRO" Ataque cancelado!");
KillTimer(ContagemDominio[GetPVarInt(playerid,"GZAtacada")]);
ContagemDominio[GetPVarInt(playerid,"GZAtacada")] = 0;
GangZoneStopFlashForAll(GangZonas[GetPVarInt(playerid,"GZAtacada")]);
SetPVarInt(playerid,"GZAtacada",-1);
SetPVarInt(playerid,"Tempo",0);
return 1;
}
}
return 1;
}
forward Contagem(playerid);
public Contagem(playerid)
{
new string[128];
if(GetPVarInt(playerid,"Tempo") == 30)
{
if(Player[playerid][pFaccoes] == 1 || Player[playerid][pFaccoes] == 2 || Player[playerid][pFaccoes] == 3) {
SendFormattedMessageToAll(COR_INFO, "[GF - NOTICIAS] A facзгo 'CMD' dominou a favela '%s' da '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]);
GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COLOR_RED;
GZDono[GetPVarInt(playerid,"GZAtacada")] = "CMD";
}
else if(Player[playerid][pFaccoes] == 4 || Player[playerid][pFaccoes] == 5 || Player[playerid][pFaccoes] == 6) {
SendFormattedMessageToAll(COR_INFO, "[GF - NOTICIAS] A facзгo 'LLL' dominou a favela '%s' da '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]);
GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COLOR_BLUE;
GZDono[GetPVarInt(playerid,"GZAtacada")] = "LLL";
}
else if(Player[playerid][pFaccoes] == 7 || Player[playerid][pFaccoes] == 8 || Player[playerid][pFaccoes] == 9) {
SendFormattedMessageToAll(COR_INFO, "[GF - NOTICIAS] A facзгo 'TD3' dominou a favela '%s' da '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]);
GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COLOR_YELLOW;
GZDono[GetPVarInt(playerid,"GZAtacada")] = "TD3";
}
else if(Player[playerid][pFaccoes] == 10 || Player[playerid][pFaccoes] == 11) {
SendFormattedMessageToAll(COR_INFO, "[GF - NOTICIAS] A facзгo 'MLC' dominou a favela '%s' da '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]);
GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COLOR_ORANGE;
GZDono[GetPVarInt(playerid,"GZAtacada")] = "MLC";
}
else if(Player[playerid][pCORE] >= 1)
{
SendFormattedMessageToAll(COR_INFO, "[GF - NOTICIAS] A 'CORE' pacificou a favela '%s' da '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]);
GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COR_CORE;
GZDono[GetPVarInt(playerid,"GZAtacada")] = "CORE";
}
else if(Player[playerid][pBOPE] >= 1)
{
SendFormattedMessageToAll(COR_INFO, "[GF - NOTICIAS] A 'BOPE' pacificou a favela '%s' da '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]);
GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COR_BOPE;
GZDono[GetPVarInt(playerid,"GZAtacada")] = "BOPE";
}
else if(Player[playerid][pPMRJ] >= 1)
{
SendFormattedMessageToAll(COR_INFO, "[GF - NOTICIAS] A 'PMRJ' pacificou a favela '%s' da '%s'.", GangZone[GetPVarInt(playerid,"GZAtacada")][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]);
GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor] = COR_PMRJ;
GZDono[GetPVarInt(playerid,"GZAtacada")] = "PMRJ";
}
GivePlayerMoney(playerid, 10000);
GangZoneHideForAll(GangZonas[GetPVarInt(playerid,"GZAtacada")]);
GangZoneShowForAll(GangZonas[GetPVarInt(playerid,"GZAtacada")], GangZone[GetPVarInt(playerid,"GZAtacada")][GZColor]);
KillTimer(ContagemDominio[GetPVarInt(playerid,"GZAtacada")]);
ContagemDominio[GetPVarInt(playerid,"GZAtacada")] = 0;
SetPVarInt(playerid,"GZAtacada",-1);
SetPVarInt(playerid,"Tempo",0);
return 1;
}
else
{
SetPVarInt(playerid,"Tempo",GetPVarInt(playerid,"Tempo")+1);
format(string,sizeof(string),"~w~%i / ~r~30", GetPVarInt(playerid,"Tempo"));
GameTextForPlayer(playerid, string, 2500, 3);
}
return 1;
}
for(new i = 0; i < MAX_GZS; i ++) { GangZonas[i] = GangZoneCreate(GangZone[i][GZCoords][0], GangZone[i][GZCoords][1], GangZone[i][GZCoords][2], GangZone[i][GZCoords][3]); ChecksDominio[i] = CreatePickup(1318, 1, GangZone[i][CheckCoords][0], GangZone[i][CheckCoords][1], GangZone[i][CheckCoords][2], -1); ContagemDominio[i] = 0; }
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys == KEY_SECONDARY_ATTACK) { for(new i = 0; i < MAX_GZS; i ++) { if(IsPlayerInRangeOfPoint(playerid, 1.5, GangZone[i][CheckCoords][0], GangZone[i][CheckCoords][1], GangZone[i][CheckCoords][2])) { if(GetPlayerVisibleDynamicCP(playerid) == ChecksDominio[i]) { if(Player[playerid][pAdmin] >= 1 || Player[playerid][pFrente] >= 1 || Player[playerid][pBOPE] >= 4 || Player[playerid][pPMRJ] >= 4 || Player[playerid][pCORE] >= 4) { if(ContagemDominio[i] != 0) return true; if((strcmp(GZDono[i], "CMD", true) == 0) && Player[playerid][pFaccoes] == 1 || (strcmp(GZDono[i], "CMD", true) == 0) && Player[playerid][pFaccoes] == 2 || (strcmp(GZDono[i], "CMD", true) == 0) && Player[playerid][pFaccoes] == 3 || (strcmp(GZDono[i], "LLL", true) == 0) && Player[playerid][pFaccoes] == 4 || (strcmp(GZDono[i], "LLL", true) == 0) && Player[playerid][pFaccoes] == 5 || (strcmp(GZDono[i], "LLL", true) == 0) && Player[playerid][pFaccoes] == 6 || (strcmp(GZDono[i], "TD3", true) == 0) && Player[playerid][pFaccoes] == 7 || (strcmp(GZDono[i], "TD3", true) == 0) && Player[playerid][pFaccoes] == 8 || (strcmp(GZDono[i], "TD3", true) == 0) && Player[playerid][pFaccoes] == 9 || (strcmp(GZDono[i], "MLC", true) == 0) && Player[playerid][pFaccoes] == 10 || (strcmp(GZDono[i], "MLC", true) == 0) && Player[playerid][pFaccoes] == 11 || (strcmp(GZDono[i], "PM", true) == 0) && Player[playerid][pCORE] >= 1 || (strcmp(GZDono[i], "BOPE", true) == 0) && Player[playerid][pBOPE] >= 1 || (strcmp(GZDono[i], "PMRJ", true) == 0) && Player[playerid][pPMRJ] >= 1) return SendClientMessage(playerid, COLOR_RED, ""TAG_ERRO" Estб favela jб й da sua facзгo!"); SetPVarInt(playerid, "GZAtacada", i); ContagemDominio[i] = SetTimerEx("Contagem", 1000, 1, "i", playerid); GangZoneFlashForAll(GangZonas[GetPVarInt(playerid, "GZAtacada" )], GetPlayerColor(playerid)); SetPlayerCheckpoint(playerid, GangZone[i][CheckCoords][0], GangZone[i][CheckCoords][1], GangZone[i][CheckCoords][2], 4.0); SendFormattedMessageToAll(COR_INFO, "[NOTICIAS] %s estб dominando a favela '%s' da '%s'.", getPName(playerid), GangZone[i][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]); return true; } else SendClientMessage(playerid, COLOR_RED, ""TAG_ERRO" Vocк nгo tem permissгo para dominar!"); } } } } return true; }
public OnPlayerLeaveCheckpoint(playerid) { for(new i = 0; i < MAX_GZS; i ++) { if(GetPVarInt(playerid, "GZAtacada") != -1) { SendClientMessage(playerid, COLOR_RED, ""TAG_ERRO" Ataque cancelado!"); KillTimer(ContagemDominio[GetPVarInt(playerid, "GZAtacada" )]); ContagemDominio[GetPVarInt(playerid, "GZAtacada" )] = 0; GangZoneStopFlashForAll(GangZonas[GetPVarInt(playerid, "GZAtacada" )]); DisablePlayerCheckpoint(playerid); SetPVarInt(playerid, "GZAtacada", -1); SetPVarInt(playerid, "Tempo", 0); return true; } } return true; }
Refiz rapidinho, se der algum tipo de erro me fale, pois nгo copilei...
Код:
for(new i = 0; i < MAX_GZS; i ++) { GangZonas[i] = GangZoneCreate(GangZone[i][GZCoords][0], GangZone[i][GZCoords][1], GangZone[i][GZCoords][2], GangZone[i][GZCoords][3]); ChecksDominio[i] = CreatePickup(1318, 1, GangZone[i][CheckCoords][0], GangZone[i][CheckCoords][1], GangZone[i][CheckCoords][2], -1); ContagemDominio[i] = 0; } Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys == KEY_SECONDARY_ATTACK) { for(new i = 0; i < MAX_GZS; i ++) { if(IsPlayerInRangeOfPoint(playerid, 1.5, GangZone[i][CheckCoords][0], GangZone[i][CheckCoords][1], GangZone[i][CheckCoords][2])) { if(GetPlayerVisibleDynamicCP(playerid) == ChecksDominio[i]) { if(Player[playerid][pAdmin] >= 1 || Player[playerid][pFrente] >= 1 || Player[playerid][pBOPE] >= 4 || Player[playerid][pPMRJ] >= 4 || Player[playerid][pCORE] >= 4) { if(ContagemDominio[i] != 0) return true; if((strcmp(GZDono[i], "CMD", true) == 0) && Player[playerid][pFaccoes] == 1 || (strcmp(GZDono[i], "CMD", true) == 0) && Player[playerid][pFaccoes] == 2 || (strcmp(GZDono[i], "CMD", true) == 0) && Player[playerid][pFaccoes] == 3 || (strcmp(GZDono[i], "LLL", true) == 0) && Player[playerid][pFaccoes] == 4 || (strcmp(GZDono[i], "LLL", true) == 0) && Player[playerid][pFaccoes] == 5 || (strcmp(GZDono[i], "LLL", true) == 0) && Player[playerid][pFaccoes] == 6 || (strcmp(GZDono[i], "TD3", true) == 0) && Player[playerid][pFaccoes] == 7 || (strcmp(GZDono[i], "TD3", true) == 0) && Player[playerid][pFaccoes] == 8 || (strcmp(GZDono[i], "TD3", true) == 0) && Player[playerid][pFaccoes] == 9 || (strcmp(GZDono[i], "MLC", true) == 0) && Player[playerid][pFaccoes] == 10 || (strcmp(GZDono[i], "MLC", true) == 0) && Player[playerid][pFaccoes] == 11 || (strcmp(GZDono[i], "PM", true) == 0) && Player[playerid][pCORE] >= 1 || (strcmp(GZDono[i], "BOPE", true) == 0) && Player[playerid][pBOPE] >= 1 || (strcmp(GZDono[i], "PMRJ", true) == 0) && Player[playerid][pPMRJ] >= 1) return SendClientMessage(playerid, COLOR_RED, ""TAG_ERRO" Estб favela jб й da sua facзгo!"); SetPVarInt(playerid, "GZAtacada", i); ContagemDominio[i] = SetTimerEx("Contagem", 1000, 1, "i", playerid); GangZoneFlashForAll(GangZonas[GetPVarInt(playerid, "GZAtacada" )], GetPlayerColor(playerid)); SetPlayerCheckpoint(playerid, GangZone[i][CheckCoords][0], GangZone[i][CheckCoords][1], GangZone[i][CheckCoords][2], 4.0); SendFormattedMessageToAll(COR_INFO, "[NOTICIAS] %s estб dominando a favela '%s' da '%s'.", getPName(playerid), GangZone[i][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]); return true; } else SendClientMessage(playerid, COLOR_RED, ""TAG_ERRO" Vocк nгo tem permissгo para dominar!"); } } } } return true; } Код:
public OnPlayerLeaveCheckpoint(playerid) { for(new i = 0; i < MAX_GZS; i ++) { if(GetPVarInt(playerid, "GZAtacada") != -1) { SendClientMessage(playerid, COLOR_RED, ""TAG_ERRO" Ataque cancelado!"); KillTimer(ContagemDominio[GetPVarInt(playerid, "GZAtacada" )]); ContagemDominio[GetPVarInt(playerid, "GZAtacada" )] = 0; GangZoneStopFlashForAll(GangZonas[GetPVarInt(playerid, "GZAtacada" )]); DisablePlayerCheckpoint(playerid); SetPVarInt(playerid, "GZAtacada", -1); SetPVarInt(playerid, "Tempo", 0); return true; } } return true; } |
if(newkeys == KEY_SECONDARY_ATTACK)
{
for(new i = 0; i < MAX_GZS; i ++)
{
if(IsPlayerInRangeOfPoint(playerid, 1.5, GangZone[i][CheckCoords][0], GangZone[i][CheckCoords][1], GangZone[i][CheckCoords][2]))
{
if(GetPlayerVisibleDynamicCP(playerid) == ChecksDominio[i])
{
if(Player[playerid][pAdmin] >= 1 || Player[playerid][pFrente] >= 1 || Player[playerid][pBOPE] >= 4 || Player[playerid][pPMRJ] >= 4 || Player[playerid][pCORE] >= 4)
{
if(ContagemDominio[i] != 0) return true;
if((strcmp(GZDono[i], "CMD", true) == 0) && Player[playerid][pFaccoes] == 1 ||
(strcmp(GZDono[i], "CMD", true) == 0) && Player[playerid][pFaccoes] == 2 ||
(strcmp(GZDono[i], "CMD", true) == 0) && Player[playerid][pFaccoes] == 3 ||
(strcmp(GZDono[i], "LLL", true) == 0) && Player[playerid][pFaccoes] == 4 ||
(strcmp(GZDono[i], "LLL", true) == 0) && Player[playerid][pFaccoes] == 5 ||
(strcmp(GZDono[i], "LLL", true) == 0) && Player[playerid][pFaccoes] == 6 ||
(strcmp(GZDono[i], "TD3", true) == 0) && Player[playerid][pFaccoes] == 7 ||
(strcmp(GZDono[i], "TD3", true) == 0) && Player[playerid][pFaccoes] == 8 ||
(strcmp(GZDono[i], "TD3", true) == 0) && Player[playerid][pFaccoes] == 9 ||
(strcmp(GZDono[i], "MLC", true) == 0) && Player[playerid][pFaccoes] == 10 ||
(strcmp(GZDono[i], "MLC", true) == 0) && Player[playerid][pFaccoes] == 11 ||
(strcmp(GZDono[i], "PM", true) == 0) && Player[playerid][pCORE] >= 1 ||
(strcmp(GZDono[i], "BOPE", true) == 0) && Player[playerid][pBOPE] >= 1 ||
(strcmp(GZDono[i], "PMRJ", true) == 0) && Player[playerid][pPMRJ] >= 1)
return SendClientMessage(playerid, COLOR_RED, ""TAG_ERRO" Estб favela jб й da sua facзгo!");
SetPVarInt(playerid, "GZAtacada", i);
ContagemDominio[i] = SetTimerEx("Contagem", 1000, 1, "i", playerid);
GangZoneFlashForAll(GangZonas[GetPVarInt(playerid, "GZAtacada" )], GetPlayerColor(playerid));
SetPlayerCheckpoint(playerid, GangZone[i][CheckCoords][0], GangZone[i][CheckCoords][1], GangZone[i][CheckCoords][2], 4.0);
SendFormattedMessageToAll(COR_INFO, "[NOTICIAS] %s estб dominando a favela '%s' da '%s'.", getPName(playerid), GangZone[i][GZName], GZDono[GetPVarInt(playerid,"GZAtacada")]);
return true;
}
else SendClientMessage(playerid, COLOR_RED, ""TAG_ERRO" Vocк nгo tem permissгo para dominar!");
}
}
}
}
return true;
}
Manda os erros, e manda seu perfil do fb para te ajudar nestes casos
|