Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new WarTime; // Variável onde ficará armazenado o tempo de guerra
- new TimerGuerra; // Serve depois pra interromper o timer criado com o comando /guerra
- new gHour, gMins, gSecs, smalltext[20];
- new Float:GuerraMinX;
- new Float:GuerraMinY;
- new Float:GuerraMaxX;
- new Float:GuerraMaxY;
- new Text:GuerraG[MAX_PLAYERS];
- new TempoGuerra;
- HourMinSecs(number)
- {
- gHour = floatround(number / (60 * 60));
- gMins = floatround((number / 60) - (gHour * 60));
- gSecs = number % 60;
- format(smalltext, 10, "%02d:%02d:%02d", gHour, gMins, gSecs);
- return smalltext;
- }
- forward tGuerra();
- public tGuerra()
- {
- WarTime--;
- if(WarTime == 0)
- {
- SendClientMesasge(playerid, COLOR_GRAD1, " A guerra acabou.");
- WarTime = 0;
- KillTimer(TimerGuerra);// Adicione uma função para acabar a guerra
- }
- return 1;
- }
- if(strcmp(cmd, "/guerra", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pJailed] != 0)
- {
- SendClientMessage(playerid,CINZA," Você não pode criar guerra na cadeia!");
- return true;
- }
- if(TendoGuerra >= 1)
- {
- SendClientMessage(playerid, CINZA, " Já está tendo uma guerra!");
- return true;
- }/*
- new x_EmpregoG2[32];
- x_EmpregoG2 = strtok(cmdtext, idx);
- if(!strlen(x_EmpregoG2))
- {
- SendClientMessage(playerid,COLOR_GRAD1, "/GUERRA [HORAS] (de 1 a 2 Horas, Sendo que 30 é 30 Minutos )");
- return true;
- }
- if(strcmp(x_EmpregoG2,"30",true) == 0)
- {
- TempoGuerra = SetTimerEx("GuerraTerrorista", 30*60*1000, 0, "i", playerid);
- RelogioGuerraG = SetTimer("RelogioGuerra", 30*60*1000, 1);
- }
- else if(strcmp(x_EmpregoG2,"1",true) == 0)
- {
- TempoGuerra = SetTimerEx("GuerraTerrorista", 60*60*1000, 0, "i", playerid);
- RelogioGuerraG = SetTimer("RelogioGuerra", 60*60*1000, 1);
- }
- else if(strcmp(x_EmpregoG2,"2",true) == 0)
- {
- TempoGuerra = SetTimerEx("GuerraTerrorista", 120*60*1000, 0, "i", playerid);
- RelogioGuerraG = SetTimer("RelogioGuerra", 120*60*1000, 1);
- }*/
- new Float:x,Float:y,Float:z;
- if(PlayerInfo[playerid][pMembro] == 3 || PlayerInfo[playerid][pLider] == 3)// EXE
- {
- GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
- format(string, sizeof(string), "%s e o Exército iniciaram uma Guerra. Evitem a área Verde!",playername);
- SendClientMessageToAll(COLOR_EXE, string);
- GetPlayerPos(playerid,x,y,z);
- Territorio[MinX] = x-250;
- Territorio[MinY] = y-250;
- Territorio[MaxX] = x+250;
- Territorio[MaxY] = y+250;
- Territorio[exemortos] = 0;
- Territorio[talmortos] = 0;
- Territorio[almortos] = 0;
- Territorio[GImortos] = 0;
- GuerraMinX = x-250;
- GuerraMinY = y-250;
- GuerraMaxX = x+250;
- GuerraMaxY = y+250;
- GZGuerra = GangZoneCreate(x-250,y-250,x+250,y+250);
- GangZoneShowForAll(GZGuerra,COLORGZ_EXE);
- BPEInfo[playerid][InicioGuerra] = 1;
- TendoGuerra = 1;
- WarTime = 3600;
- TimerGuerra = SetTimer("tGuerra", 1000, true);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement