[Ajuda] comando /guerra
#1

o local do /guerra so aparece pra quem estava on no servidor quem loga apуs o /guerra nгo consegue ver a area. n consigo resolver isso ajuda pls.
Reply
#2

Faзa uma variбvel booleana e quando comeзar a guerra altere ela para verdadeiro, quando acabar, altere para falso. Quando um jogador se conectar se esta variбvel for verdadeira, vocк chama a funзгo que mostra a guerra para o jogador, simples e fбcil.
Reply
#3

Quote:
Originally Posted by Lуs
Посмотреть сообщение
Faзa uma variбvel booleana e quando comeзar a guerra altere ela para verdadeiro, quando acabar, altere para falso. Quando um jogador se conectar se esta variбvel for verdadeira, vocк chama a funзгo que mostra a guerra para o jogador, simples e fбcil.
vlw pela ajuda... bom eu fiz o que vocк falo coloquei para que os player que logava no servidor ver a area coloquei aqui public OnPlayerConnect mais mesmo assim nгo funfo eu criava a gangzona saia do servidor voltava e n conseguia mais ver.. mais a guerra continuava. aguardando outra resposta
Reply
#4

Posta o /guerra e o esquema da booleana que vocк criou.
Reply
#5

new EntrouGuerra[MAX_SLOTS] = 0;
new guerra;
new pGuerra = 0;

if(strcmp(cmd,"/guerra", true) == 0)
{
if(pGuerra == 1)
{
SendClientMessage(playerid, COLOR_GREY, "Jб estб tendo uma guerra, aguarde ela terminar.");
return 1;
}
if(PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pMembro] == 3)
{
EntrouGuerra[playerid] = 0;
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
guerra = GangZoneCreate(X-150,Y-150,X+150,Y+150);
GangZoneShowForAll(guerra,TEAM_GREEN_COLOR);
tempoguerra = SetTimer("guerrat",12000000,0);
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "%s e o nosso Exйrcito acabaram de iniciar uma Guerra, nгo se aproximem da Бrea marcada a Verde!", pName);
SendClientMessageToAll(GetPlayerColor(playerid), string);
pGuerra = 1;
GuerraX = X-150; GuerraY = Y-150; GuerraZ = X+150; GuerraA = Y+150;
SetPlayerMapIcon(playerid, 39,Float:X,Float:Y,Float:Z, 44, 0);
}
if(PlayerInfo[playerid][pLider] == 6 || PlayerInfo[playerid][pMembro] == 6)
{
EntrouGuerra[playerid] = 0;
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
guerra = GangZoneCreate(X-150,Y-150,X+150,Y+150);
GangZoneShowForAll(guerra,COLOR_ALCAIDA);
tempoguerra = SetTimer("guerrat",12000000,0);
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "%s e a ASFARC acabaram de iniciar uma Guerra, nгo se aproximem da Бrea marcada a Preto!", pName);
SendClientMessageToAll(GetPlayerColor(playerid), string);
pGuerra = 1;
GuerraX = X-100; GuerraY = Y-150; GuerraZ = X+150; GuerraA = Y+150;
SetPlayerMapIcon(playerid, 39,Float:X,Float:Y,Float:Z, 44, 0);
}
if(PlayerInfo[playerid][pLider] == 20 || PlayerInfo[playerid][pMembro] == 20)
{
EntrouGuerra[playerid] = 0;
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
guerra = GangZoneCreate(X-150,Y-150,X+150,Y+150);
GangZoneShowForAll(guerra,COLOR_LIGHTBLUE);
tempoguerra = SetTimer("guerrat",12000000,0);
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "%s e os Guerrilheiros Israelitas acabaram de iniciar uma Guerra, nгo se aproximem da Бrea marcada a Azul!", pName);
SendClientMessageToAll(GetPlayerColor(playerid), string);
pGuerra = 1;
GuerraX = X-100; GuerraY = Y-150; GuerraZ = X+150; GuerraA = Y+150;
SetPlayerMapIcon(playerid, 39,Float:X,Float:Y,Float:Z, 44, 0);
}
return 1;
}

forward guerrat();
public guerrat()
{
pGuerra = 0;
GangZoneDestroy(guerra);
KillTimer(tempoguerra);
SendClientMessageToAll(AZULCLARO, "A guerra chegou ao fim,e a бrea jб poderб ser habitada novamente!");
GangZoneHideForAll(guerra);
return 1;
}
Reply
#6

no topo do gm:
PHP код:
new guerra;
new 
pGuerra
no OnPlayerConnect:
PHP код:
if(pGuerra == 3GangZoneShowForPlayer(playeridguerraTEAM_GREEN_COLOR);
else if(
pGuerra == 6GangZoneShowForPlayer(playeridguerraCOLOR_ALCAIDA);
else if(
pGuerra == 20GangZoneShowForPlayer(playeridguerraCOLOR_LIGHTBLUE); 
Comando:
PHP код:
if(strcmp(cmd,"/guerra"true) == 0)
{
    if(
pGuerra 0)
    {
        
SendClientMessage(playeridCOLOR_GREY"Jб estб tendo uma guerra, aguarde ela terminar.");
        return 
1;
    }
    if(
PlayerInfo[playerid][pLider] == || PlayerInfo[playerid][pMembro] == 3)
    {
        
pGuerra 3;
        new 
Float:X,Float:Y,Float:Z;
        
GetPlayerPos(playeridX,Y,Z);
        
guerra GangZoneCreate(X-150,Y-150,X+150,Y+150);
        
GangZoneShowForAll(guerra,TEAM_GREEN_COLOR);
        
tempoguerra SetTimer("guerrat",12000000,0);
        new 
pName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridpNamesizeof(pName));
        
format(stringsizeof(string), "%s e o nosso Exйrcito acabaram de iniciar uma Guerra, nгo se aproximem da Бrea marcada a Verde!"pName);
        
SendClientMessageToAll(GetPlayerColor(playerid), string);
        
GuerraX X-150GuerraY Y-150GuerraZ X+150GuerraA Y+150;
        
SetPlayerMapIcon(playerid39,Float:X,Float:Y,Float:Z440);
    }
    if(
PlayerInfo[playerid][pLider] == || PlayerInfo[playerid][pMembro] == 6)
    {
        
pGuerra 6;
        new 
Float:X,Float:Y,Float:Z;
        
GetPlayerPos(playeridX,Y,Z);
        
guerra GangZoneCreate(X-150,Y-150,X+150,Y+150);
        
GangZoneShowForAll(guerra,COLOR_ALCAIDA);
        
tempoguerra SetTimer("guerrat",12000000,0);
        new 
pName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridpNamesizeof(pName));
        
format(stringsizeof(string), "%s e a ASFARC acabaram de iniciar uma Guerra, nгo se aproximem da Бrea marcada a Preto!"pName);
        
SendClientMessageToAll(GetPlayerColor(playerid), string);
        
GuerraX X-100GuerraY Y-150GuerraZ X+150GuerraA Y+150;
        
SetPlayerMapIcon(playerid39,Float:X,Float:Y,Float:Z440);
    }
    if(
PlayerInfo[playerid][pLider] == 20 || PlayerInfo[playerid][pMembro] == 20)
    {
        
pGuerra 20;
        new 
Float:X,Float:Y,Float:Z;
        
GetPlayerPos(playeridX,Y,Z);
        
guerra GangZoneCreate(X-150,Y-150,X+150,Y+150);
        
GangZoneShowForAll(guerra,COLOR_LIGHTBLUE);
        
tempoguerra SetTimer("guerrat",12000000,0);
        new 
pName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridpNamesizeof(pName));
        
format(stringsizeof(string), "%s e os Guerrilheiros Israelitas acabaram de iniciar uma Guerra, nгo se aproximem da Бrea marcada a Azul!"pName);
        
SendClientMessageToAll(GetPlayerColor(playerid), string);
        
GuerraX X-100GuerraY Y-150GuerraZ X+150GuerraA Y+150;
        
SetPlayerMapIcon(playerid39,Float:X,Float:Y,Float:Z440);
    }
    return 
1;

A funзгo normal:
PHP код:
forward guerrat();
public 
guerrat()
{
    
pGuerra 0;
    
GangZoneDestroy(guerra);
    
KillTimer(tempoguerra);
    
SendClientMessageToAll(AZULCLARO"A guerra chegou ao fim,e a бrea jб poderб ser habitada novamente!");
    
GangZoneHideForAll(guerra);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)