[FilterScript] Sistema de Incкndio
#1

Sistema de Incкndio

Desenvolvido por Shadoww5
Descriзгo:

Notei que aqui no fуrum hб poucos topicos relacionados а isto. Dentre os mais procurados (dois), um estб com o link invбlido e o outro й do rjj.

Todavia, eu quis criar um sistema alternativo ao dele (que й muito bom, diga-se de passagem) e aprimorar meus conhecimentos em pawn.

Este filterscript envolve nгo sу a questгo do incкndio, mas tambйm os bombeiros, algo realmente interessante para os servidores RPG/RP. O incкndio ocorre randomicamente, de acordo com os locais definidos por quem baixar este FS.
  • Caso vocк esteja logado na RCON й possivel /ativar e /desativar o FS pelo proprio jogo sem precisar descarregб-lo;
  • Para apagar o fogo й preciso entrar em /servico. Quando vocк entra, sua skin fica salva e quando vocк sai do serviзo ele й setada novamente;
  • Para localizar a HQ basta digitar /hq e entгo um icone serб criado no mapa;
  • O FS jб vem com 3 carros (emplacados) e uma HQ (HeadQuarter - sede), onde й possivel pegar colete (70 %), eagle (no maximo 250 muniзхes) e exintor (no maximo 750), e 10 locais de incкndios pre-definidos;
  • Para ser um bombeiro basta digitar /bm. Para fazer o contrario: /bmsair. Ao apagar um incкndio o jogador ganha 500 dуlares;
  • Ao entrar em serviзo, vocк passa a receber chamados para apgar fogo e, caso haja um #define TEXT3D no FS (jб tem, a nгo ser que vocк o retire), um texto й criado sobre a sua cabeзa;
  • Os carros de bombeiro e a HQ sу sгo acessiveis para os proprios bombeiros;
  • Se o incкndio nгo for apagado por ninguйm, ele й destruido automaticamente. O tempo para isto ocorrer й definido pela #define APAGAR. Й de vital importвncia para o FS que este define seja maior que a #define TEMPO (que serve para definir o tempo entre um incкndio e outro) e que 9;
  • O salvamento/carregamento й feito automaticamente no arquivo Bombeiros.txt (na pasta Scriptfiles | nгo precisa criб-lo, pois ele й criado automaticamente, caso nгo exista) quando o jogador desconectar/conectar ou quando o FS for descarregado/carregado;
  • No local exato do incкndio hб um pouco de lag, pois hб 7 objetos no local e arredores;
  • Quando o FS й carregado, й normal que ocorra um leve erro no checkpoint e no local do fogo, o que pode causar uma confusгo, mas depois do primeiro fica tudo certo.
Qualquer duvida ou erro no FS (deve haver alguns, admito) peзo que me comuniquem.

Screenshot:

/imageshack/img854/4...2218560536.jpg
/imageshack/img17/180...2218583508.jpg
/imageshack/img845/6...2218591738.jpg
/imageshack/img200/8...2219022266.jpg
/imageshack/img821/1...2219025514.jpg
/imageshack/img824/6...2219160885.jpg
/imageshack/img14/212...2219203567.jpg
/imageshack/img845/5...2219272765.jpg

Download: Codigo:

PHP код:
/*! FILTERSCRIPT DE INCENDIO DESENVOLVIDO POR SHADOWW5 !
  ! FILTERSCRIPT DE INCENDIO DESENVOLVIDO POR SHADOWW5 !
           Contato: http://*******/iT6xEw
           Contato: http://*******/iT6xEw
    NAO RETIRE OS CREDITOS !! NAO RETIRE OS CREDITOS !!
    NAO RETIRE OS CREDITOS !! NAO RETIRE OS CREDITOS !!*/
#include <a_samp>
#include <Dini>
#define FILTERSCRIPT
#define HOLDING(%0) \
    
((newkeys & (%0)) == (%0))
#define RELEASED(%0) \
    
(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
#define PRESSED(%0) \
    
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define ICON 42
#define ENTRAR 942
#define SAIR 943
#define AJUDA 944
#define BRANCO 0xFFFFFFFF
#define CINZA 0xD6D6D6FF
#define VERMELHO 0xFF0000FF
#define AMARELO 0xF7E200FF
#define LARANJA 0xE89200FF
#define TEXT3D //CASO QUEIRA QUE NA CABEЗA DO BOMBEIRO TENHA DIZENDO QUE ELE Й BOMBEIRO DEIXE ESTE #define, CASO NГO, RETIRE-O
#define TEMPO 35 //TROQUE PELO TEMPO ENTRE UM INCENDIO E OUTRO (EM SEGUNDOS !)
#define APAGAR 30 //TROQUE PELO TEMPO QUE OS BOMBEIROS TКM PARA APAGAR O INCENDIO (EM SEGUNDOS !)
// OBS: "APAGAR" DEVE SER MAIOR QUE 9 E MENOR QUE "TEMPO"
// OBS: "APAGAR" DEVE SER MAIOR QUE 9 E MENOR QUE "TEMPO"
new Float:Fogo[][3] = {
{
1916.9470, -1400.9082, 13.5703}, //TROQUE PELAS COORDENADAS QUE O FOGO PODE ESTAR
{2330.6628, -1805.5270, 13.5469},  //TROQUE PELAS COORDENADAS QUE O FOGO PODE ESTAR
{2382.5210, -1131.2479, 30.2030},
{
2164.3052, -1004.4780, 62.7962},
{
1282.3912, -817.9395, 84.1406},
{
811.7228, -1098.1653, 25.9063},
{
649.1138, -1705.1345, 14.5158},
{
153.8757, -1941.5243, 3.7734},
{
132.7246, -1516.6755, 10.4878},
{
262.1424, -1171.0951, 79.4105}
};
new 
Cores[] = {
0xE02A2AFF,
0x3CE02AFF,
0xED8E12FF,
0xED12BAFF,
0x4912EDFF,
0x12EDAFFF
};
new 
Timer;
new 
Tick;
new 
Text3D:Saida;
new 
bool:F;
new 
bool:Chegou[MAX_PLAYERS];
new 
bool:Servico[MAX_PLAYERS];
new 
bool:Bombeiro[MAX_PLAYERS];
new 
Apagando[MAX_PLAYERS];
new 
Float:LugarFogo[3];
new 
pickups[5];
new 
Carros[3];
new 
Fire[7];
#if defined TEXT3D
new Text3D:texto[MAX_PLAYERS];
#endif
forward Msgs();
forward Apagar();
forward Check(playerid);
forward Fogoo();
public 
OnPlayerConnect(playerid)
{
    
Apagando[playerid] = 0;
    
Servico[playerid] = false;
    
Chegou[playerid] = false;
    
Carregar(playerid);
    return 
1;
}
public 
OnPlayerDisconnect(playerid, reason)
{
    
Salvar(playerid);
    return 
1;
}
public 
OnFilterScriptInit()
{
    
SetTimer("Msgs",420000, true);
    
SetTimer("Fogoo", 1000, true);
    
F = false;
    new 
fire = random(sizeof(Fogo));
    
LugarFogo[0] = Fogo[fire][0];
    
LugarFogo[1] = Fogo[fire][1];
    
LugarFogo[2] = Fogo[fire][2];
    
Saida = Create3DTextLabel("Saнda HQ Bombeiros", AMARELO, 2324.4641, -1148.8071, 1050.7101, 25, 0, 1);
    
pickups[0] = CreatePickup(1318, 1, 999999.9, 999999.9, 999999.9, -1);
    
pickups[1] = CreatePickup(1318, 1, 1732.9530, -1452.6234, 13.5513, -1);
    
pickups[2] = CreatePickup(366, 1, 2338.0422, -1139.8947, 1054.3047, -1);
    
pickups[3] = CreatePickup(1242, 1, 2311.0833, -1139.8, 1054.3047, -1);
    
pickups[4] = CreatePickup(348, 1, 2311.0740, -1137.7225, 1054.3047, -1);
    
Carros[0] = CreateVehicle(407, 1753.2189, -1457.0864, 13.7812, 333.1102, 3, 3, 90); // CARRO DOS BOMBEIROS
    
Carros[1] = CreateVehicle(407, 1748.2573, -1456.2477, 13.7720, 329.7277, 3, 3, 90); // CARRO DOS BOMBEIROS
    
Carros[2] = CreateVehicle(407, 1743.6870, -1455.5563, 13.7655, 328.4289, 3, 3, 90); // CARRO DOS BOMBEIROS
    
SetVehicleNumberPlate(Carros[0], "{FF0000}[BM] {071775}VTR 1");
    
SetVehicleNumberPlate(Carros[1], "{FF0000}[BM] {071775}VTR 2");
    
SetVehicleNumberPlate(Carros[2], "{FF0000}[BM] {071775}VTR 3");
    for(new 
i = 0; i < MAX_PLAYERS; i ++) { OnPlayerConnect(i); }
    if(!
fexist("Bombeiros.txt")) return dini_Create("Bombeiros.txt");
    print(
"---------------------------------------");
    print(
"Sistema de Incendio criado por Shadoww5");
    print(
"       CARREGADO COM SUCESSO !");
    print(
"     Contato: http://*******/iT6xEw");
    print(
"---------------------------------------");
    return 
1;
}
public 
OnFilterScriptExit()
{
    for(new 
c = 0; c < sizeof(Carros); c ++) { DestroyVehicle(Carros[c]); DestroyVehicle(Carros[c]); }
    for(new 
f = 0; f < sizeof(Fire); f ++) { DestroyObject(Fire[f]); DestroyObject(Fire[f]); }
    for(new 
p = 0; p < sizeof(pickups); p ++) {    DestroyPickup(pickups[p]); }
    for(new 
i = 0; i < MAX_PLAYERS; i ++)
    {
        if(
Servico[i] == true) return DisablePlayerCheckpoint(i);
        
OnPlayerDisconnect(i, 1);
    }
    
Delete3DTextLabel(Saida);
    print(
"---------------------------------------");
    print(
"Sistema de Incendio criado por Shadoww5");
    print(
"      DESCARREGADO COM SUCESSO !");
    print(
"    Contato: http://*******/iT6xEw");
    print(
"---------------------------------------");
    return 
1;
}
public 
OnPlayerCommandText(playerid, cmdtext[])
{
    new 
cmd[256], idx;
    
cmd = strtok(cmdtext, idx);
    if(
strcmp(cmd, "/bm", true) == 0)
    {
        if(
Bombeiro[playerid] == true) return SendClientMessage(playerid, VERMELHO, "Vocк jб й bombeiro.");
        
ShowPlayerDialog(playerid, ENTRAR, DIALOG_STYLE_MSGBOX, "Confirmaзгo:", "Vocк tem certeza que quer ser bombeiro ?", "Sim", "Nгo");
        return 
1;
    }
    if(
strcmp(cmd, "/bmsair", true) == 0)
    {
        if(
Bombeiro[playerid] == false) return SendClientMessage(playerid, VERMELHO, "Vocк nгo й bombeiro.");
        
ShowPlayerDialog(playerid, SAIR, DIALOG_STYLE_MSGBOX, "Confirmaзгo:", "Vocк tem certeza que nгo quer mais ser bombeiro ?", "Sim", "Nгo");
        return 
1;
    }
    if(
strcmp(cmd, "/hq", true) == 0)
    {
        
SendClientMessage(playerid, LARANJA, "Siga a marca de uma sirene vermelha no mapa e lб vocк encontrarб a HQ Bombeiros.");
        
SetPlayerMapIcon(playerid, ICON, 1731.51, -1449.32, 13.12, 20, 0xFFFFFFFF, MAPICON_GLOBAL);
        return 
1;
    }
    if(
strcmp(cmd, "/servico", true) == 0 || strcmp(cmd, "/serviзo", true) == 0)
    {
        if(
Bombeiro[playerid] == false) return SendClientMessage(playerid, VERMELHO, "Vocк nгo й bombeiro.");
        if(
Servico[playerid] == false)
        {
            
Servico[playerid] = true;
            
SendClientMessage(playerid, AMARELO, "Vocк entrou em serviзo.");
            
SetPVarInt(playerid, "Skin", GetPlayerSkin(playerid));
            new 
skin[3] = { 277, 278, 279 };
            
SetPlayerSkin(playerid, skin[random(sizeof(skin))]);
            
#if defined TEXT3D
            
Delete3DTextLabel(texto[playerid]);
            
texto[playerid] = Create3DTextLabel("» Bombeiro: EM SERVIЗO «",0xFF2600FF,10.0,40.0,10.0,20.0,0);
               
Attach3DTextLabelToPlayer(texto[playerid], playerid, 0.0, 0.0, 0.4);
               
#endif
        
}
        else
        {
            
Servico[playerid] = false;
            
SendClientMessage(playerid, AMARELO, "Vocк saiu do serviзo.");
            
SetPlayerSkin(playerid, GetPVarInt(playerid, "Skin"));
            
DisablePlayerCheckpoint(playerid);
            
#if defined TEXT3D
            
Delete3DTextLabel(texto[playerid]);
            
#endif
        
}
        return 
1;
    }
    if(
strcmp(cmd, "/chat", true) == 0 || strcmp(cmd, "/c", true) == 0)
    {
        if(
Bombeiro[playerid] == false) return SendClientMessage(playerid, VERMELHO, "Vocк nгo й bombeiro.");
        new 
string[256], n[24];
        new 
length = strlen(cmdtext);
        while ((
idx < length) && (cmdtext[idx] <= ' '))
        {
            
idx++;
        }
        new 
offset = idx;
        new 
result[64];
        while ((
idx < length) && ((idx - offset) < (sizeof(result) - 1)))
        {
            
result[idx - offset] = cmdtext[idx];
            
idx++;
        }
        
result[idx - offset] = EOS;
        if(!
strlen(result)) return SendClientMessage(playerid, -1, "USO: /chat [TEXTO]");
        
GetPlayerName(playerid, n, sizeof(n));
        for(new 
i = 0; i < MAX_PLAYERS; i ++)
        {
            if(
Bombeiro[i] == true)
            {
                
format(string, sizeof(string), "{FF0000}[CHAT BOMBEIRO]{FFFFFF} %s: %s", n, result);
                
SendClientMessage(i, -1, string);
            }
        }
        return 
1;
    }
    if(
strcmp(cmd, "/removergps", true) == 0)
    {
        
DisablePlayerCheckpoint(playerid);
        
SendClientMessage(playerid, LARANJA, "Todos os checkpoints foram removidos do seu mapa !");
        return 
1;
    }
    if(
strcmp(cmd, "/bombeiros", true) == 0)
    {
        new 
nome[24], string[128], found = 0;
        for(new 
i = 0; i < MAX_PLAYERS; i ++)
        {
            if(
Bombeiro[i] == true)
            {
                
GetPlayerName(i, nome, sizeof(nome));
                
SendClientMessage(playerid, BRANCO, "======{E89200}[ BOMBEIROS ONLINE ]{FFFFFF}======");
                if(
Servico[i] == true) { format(string, sizeof(string), "  » %s (%d){FFFF00} [EM SERVIЗO]", nome, i); }
                else { 
format(string, sizeof(string), "  » %s (%d){1AA006} [JOGANDO]", nome, i); }
                
SendClientMessage(playerid, BRANCO, string);
                
found++;
            }
            if(
found == 0) return SendClientMessage(playerid, LARANJA, "Nenhum bombeiro ONLINE no momento.");
        }
        return 
1;
    }
    if(
strcmp(cmd, "/desativar", true) == 0)
    {
        if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo estб logado na RCON.");
        for(new 
f = 0; f < sizeof(Fire); f ++)
        {
            
DestroyObject(Fire[f]);
            
DestroyObject(Fire[f]);
        }
        
F = true;
        for(new 
i = 0; i < MAX_PLAYERS; i ++)
        {
            
Servico[i] = false;
            
Apagando[i] = 0;
            
Chegou[i] = false;
            
DisablePlayerCheckpoint(i);
            
KillTimer(Timer);
        }
        
SendClientMessage(playerid, AMARELO, "O sistema de incendio foi desativado temporariamente ! Para reativб-lo digite /ativar.");
        return 
1;
    }
    if(
strcmp(cmd, "/ativar", true) == 0)
    {
        if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, VERMELHO, "Vocк nгo estб logado na RCON.");
        
F = false;
        
SendClientMessage(playerid, AMARELO, "O sistema de incendio foi ativado novamente. Para desativб-lo digite /desativar.");
        return 
1;
    }
    if(
strcmp(cmd, "/fogo", true) == 0)
    {
        if(
Bombeiro[playerid] == false) return SendClientMessage(playerid, VERMELHO, "Vocк nгo й bombeiro.");
        if(
F == false) return SendClientMessage(playerid, LARANJA, "Nгo hб nenhum foco de incendio em San Andreas no momento.");
        
Servico[playerid] = true;
        
SetPlayerCheckpoint(playerid, LugarFogo[0], LugarFogo[1], LugarFogo[2], 8.0);
        
SendClientMessage(playerid, AMARELO, "Siga o checkpoint com um carro de bombeiros ou com um extintor agora !!");
        
Tick = GetTickCount();
        return 
1;
    }
    if(
strcmp(cmd, "/ajudabombeiro", true) == 0)
    {
        new 
string[1000];
        
strcat(string, "\t- /bm: Serve para se tornar um bombeiro.", sizeof(string));
        
strcat(string, "\n\t- /bmsair: Serve para sair do emprego de bombeiro.", sizeof(string));
        
strcat(string, "\n\t- /serviзo: Serve para entrar em serviзo, caso vocк seja bombeiro.", sizeof(string));
        
strcat(string, "\n\t- /fogo: Serve para descobrir qual o local do incкndio.", sizeof(string));
        
strcat(string, "\n\t- /hq: Serve para localizar a HQ Bombeiros.", sizeof(string));
        
strcat(string, "\n\t- /removergps: Serve para desabilitar o checkpoint.", sizeof(string));
        
strcat(string, "\n\t- /bombeiros: Serve para ver quais sгo os bombeiros ONLINE.", sizeof(string));
        
strcat(string, "\n\t- /chat: Serve para se comunicar com os outros bombeiros ONLINE.", sizeof(string));
        
strcat(string, "\n\t- /ativar: Serve para ativar o sistema de incкndio, quando desativado. ESTE COMANDO SУ PODER SER USADO POR ADMINS !", sizeof(string));
        
strcat(string, "\n\t- /desativar: Faz o contrario do comando anterior. ESTE COMANDO SУ PODER SER USADO POR ADMINS !", sizeof(string));
        
strcat(string, "\n\nOBS№: Os comandos de administrador sу podem ser usados caso o jogador esteja logado na RCON.", sizeof(string));
        
strcat(string, "\nOBSІ: Caso o checkpoint seja desativado nгo serб possivel apagar o fogo. Para ativб-lo novamente, digite /fogo.", sizeof(string));
        
strcat(string, "\nOBSі: Ao apagar um incкndio, o jogador й remunerado em 500 $.", sizeof(string));
        
ShowPlayerDialog(playerid, AJUDA, DIALOG_STYLE_MSGBOX, "Sistema de Incкndio criado por Shadoww5 !", string, "OK", "");
        return 
1;
    }
    return 
0;
}
public 
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(
dialogid == ENTRAR)
    {
        if(
response)
        {
            for(new 
i = 0; i < MAX_PLAYERS; i++) { if(Bombeiro[i] == true) return SendClientMessage(playerid, LARANJA, "Hб um novo bombeiro ! Digite /bombeiros para saber quem й."); }
            
SendClientMessage(playerid, AMARELO, "Vocк acaba de tornar-se um bombeiro. Digite /ajudabombeiro para conhecer os comandos.");
            
Bombeiro[playerid] = true;
        }
    }
    if(
dialogid == SAIR)
    {
        if(
response)
        {
            
SendClientMessage(playerid, AMARELO, "Vocк agora nгo й mais bombeiro.");
            
Bombeiro[playerid] = false;
            
Servico[playerid] = false;
            
Chegou[playerid] = false;
        }
    }
    return 
1;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
    if(
Servico[playerid] == true && Chegou[playerid] == false)
    {
        
SendClientMessage(playerid, LARANJA, "Vocк acaba de chegar no foco de incendio ! Aponte o extintor ou o jato d'agua para o fogo por algum tempo para apagб-lo.");
        
Chegou[playerid] = true;
    }
    return 
1;
}
public 
OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(
HOLDING(KEY_FIRE) && Servico[playerid] == true)
    {
        
SetTimerEx("Check", 750, false, "i", playerid);
        
Apagando[playerid] = 1;
    }
    if(
RELEASED(KEY_FIRE))
    {
        
Apagando[playerid] = 0;
    }
    if(
PRESSED(KEY_SECONDARY_ATTACK))
    {
        if(
IsPlayerInRangeOfPoint(playerid, 1.2, 1732.9530, -1452.6234, 13.5513))
        {
            if(
Bombeiro[playerid] == false) return SendClientMessage(playerid, VERMELHO, "Vocк nгo pode entrar na HQ Bombeiros.");
            
SetPlayerPos(playerid, 2324.5447, -1147.2544, 1050.7101);
            
SetPlayerInterior(playerid, 12);
            
SetPlayerFacingAngle(playerid, 359.8319);
            
SetCameraBehindPlayer(playerid);
        }
        if(
IsPlayerInRangeOfPoint(playerid, 1.2, 2324.4641,-1148.8071,1050.7101))
        {
            
SetPlayerInterior(playerid, 0);
            
SetPlayerPos(playerid, 1732.8002, -1449.7598, 13.5469);
            
SetPlayerFacingAngle(playerid, 357.7995);
            
SetCameraBehindPlayer(playerid);
        }
        if(
IsPlayerInRangeOfPoint(playerid, 1.2, 2338.0422,-1139.8947,1054.3047))
        {
            new 
arma[2];
            
GetPlayerWeaponData(playerid, 9, arma[0], arma[1]);
            if(
arma[0] == 42 && arma[1] >= 750) return SendClientMessage(playerid, VERMELHO, "No momento vocк nгo pode pegar mais extintores.");
            
GivePlayerWeapon(playerid, 42, 150);
        }
        if(
IsPlayerInRangeOfPoint(playerid, 1.2, 2311.0740, -1137.7225, 1054.3047))
        {
            new 
arma[2];
            
GetPlayerWeaponData(playerid, 2, arma[0], arma[1]);
            if(
arma[0] == 24 && arma[1] >= 250) return SendClientMessage(playerid, VERMELHO, "No momento vocк nгo pode pegar mais muniзхes.");
            
GivePlayerWeapon(playerid, 24, 50);
        }
        if(
IsPlayerInRangeOfPoint(playerid, 1.2, 2311.0833, -1139.8, 1054.3047)) return SetPlayerArmour(playerid, 80);
    }
    return 
1;
}
public 
OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(
newstate == 2)
    {
        if(
GetPlayerVehicleID(playerid) >= Carros[0] && GetPlayerVehicleID(playerid) <= Carros[2])
        {
            if(
Bombeiro[playerid] == false)
            {
                
RemovePlayerFromVehicle(playerid);
                
SendClientMessage(playerid, VERMELHO, "Vocк nгo й bombeiro e, por isso, nгo pode pegar esta viatura.");
            }
        }
    }
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    if(
Bombeiro[playerid] == true)
    {
        
SetPlayerPos(playerid, 2324.3792, -1136.6516, 1051.3047);
        
SetPlayerInterior(playerid, 12);
        
SetPlayerFacingAngle(playerid, 178.7233);
        
SetCameraBehindPlayer(playerid);
    }
    return 
1;
}
public 
Fogoo()
{
    new 
fire = random(sizeof(Fogo));
    new 
Float:X, Float:Y, Float:Z;
    
GetObjectPos(Fire[0], X, Y, Z);
    if(
LugarFogo[0] != X) { LugarFogo[0] = X; }
    else if(
LugarFogo[1] != Y) { LugarFogo[1] = Y; }
    else if(
LugarFogo[2] != Z) { LugarFogo[2] = Z; }
    if(
GetTickCount() - Tick > TEMPO*1000)
    {
        if(
F == false)
        {
            for(new 
f = 0; f < sizeof(Fire); f ++) { DestroyObject(Fire[f]); DestroyObject(Fire[f]); }
            
F = true;
            
Timer = SetTimer("Apagar", APAGAR*1000, false);
            
Fire[0] = CreateObject(18691, Fogo[fire][0], Fogo[fire][1], Fogo[fire][2]-2.5, 0.0, 0.0, 0.0);
            
Fire[1] = CreateObject(18691, Fogo[fire][0]+1, Fogo[fire][1], Fogo[fire][2]-2.5, 0.0, 0.0, 0.0);
            
Fire[2] = CreateObject(18691, Fogo[fire][0], Fogo[fire][1]+1, Fogo[fire][2]-2.5, 0.0, 0.0, 0.0);
            
Fire[3] = CreateObject(18691, Fogo[fire][0]+1, Fogo[fire][1]+1, Fogo[fire][2]-2.5, 0.0, 0.0, 0.0);
            
Fire[4] = CreateObject(18691, Fogo[fire][0]-1, Fogo[fire][1], Fogo[fire][2]-2.5, 0.0, 0.0, 0.0);
            
Fire[5] = CreateObject(18691, Fogo[fire][0], Fogo[fire][1]-1, Fogo[fire][2]-2.5, 0.0, 0.0, 0.0);
            
Fire[6] = CreateObject(18691, Fogo[fire][0]-1, Fogo[fire][1]-1, Fogo[fire][2]-2.5, 0.0, 0.0, 0.0);
            for(new 
i = 0; i < MAX_PLAYERS; i++)
            {
                if(
Bombeiro[i] == true && Servico[i] == true)
                {
                    new 
str[128];
                    
format(str, sizeof(str), "Hб um novo foco de incкndio ! Siga o checkpoint com um carro de bombeiros ou extintor agora !!", Fogo[fire][0], Fogo[fire][1], Fogo[fire][2]);
                    
SendClientMessage(i, AMARELO, str);
                    
SetPlayerCheckpoint(i, Fogo[fire][0], Fogo[fire][1], Fogo[fire][2], 8.0);
                    
LugarFogo[0] = Fogo[fire][0];
                    
LugarFogo[1] = Fogo[fire][1];
                    
LugarFogo[2] = Fogo[fire][2];
                }
            }
        }
    }
    for(new 
i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerInRangeOfPoint(i, 40, 1731.51, -1449.32, 13.12)) return RemovePlayerMapIcon(i, ICON); }
    return 
1;
}
public 
Apagar()
{
    if(
F == true)
    {
        for(new 
i = 0; i < MAX_PLAYERS; i ++)
        {
            if(
Bombeiro[i] == true && Servico[i] == true)
            {
                
SendClientMessage(i, VERMELHO, "O incendio nao foi apagado por nenhum bombeiro e o fogo se extinguiu.");
                
DisablePlayerCheckpoint(i);
                
Chegou[i] = false;
            }
            
F = false;
            for(new 
f = 0; f < sizeof(Fire); f ++)
            {
                
DestroyObject(Fire[f]);
                
DestroyObject(Fire[f]);
            }
            
Tick = GetTickCount();
        }
    }
    return 
1;
}
public 
Check(playerid)
{
    if(
F == true)
    {
        if(
GetPlayerState(playerid) == 1)
        {
            if(
GetPlayerWeapon(playerid) == 42)
            {
                if(
IsPlayerInRangeOfPoint(playerid, 7.0, LugarFogo[0], LugarFogo[1], LugarFogo[2]))
                {
                    if(
Apagando[playerid] > 0)
                    {
                        
Apagando[playerid]++;
                        
SetTimerEx("Check", 750, false, "i", playerid);
                        if(
Apagando[playerid] == 13)
                        {
                            for(new 
f = 0; f < sizeof(Fire); f ++) { DestroyObject(Fire[f]); DestroyObject(Fire[f]); }
                            
F = false;
                            
GivePlayerMoney(playerid, 500);
                            for(new 
i = 0; i < MAX_PLAYERS; i ++)
                            {
                                
Chegou[i] = false;
                                
Apagando[i] = 0;
                                
SendClientMessage(i, AMARELO, "O incкndio foi apagado !");
                                
Tick = GetTickCount();
                                
DisablePlayerCheckpoint(i);
                                
KillTimer(Timer);
                            }
                        }
                    }
                }
            }
        }
        if(
GetPlayerState(playerid) == 2)
        {
            if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 407)
            {
                if(
IsPlayerInRangeOfPoint(playerid, 12.0, LugarFogo[0], LugarFogo[1], LugarFogo[2]))
                {
                    if(
Apagando[playerid] > 0)
                    {
                        
Apagando[playerid]++;
                        
SetTimerEx("Check", 750, false, "i", playerid);
                        if(
Apagando[playerid] == 10)
                        {
                            for(new 
f = 0; f < sizeof(Fire); f ++) { DestroyObject(Fire[f]); DestroyObject(Fire[f]); }
                            
F = false;
                            
GivePlayerMoney(playerid, 500);
                            for(new 
i = 0; i < MAX_PLAYERS; i ++)
                            {
                                
Chegou[i] = false;
                                
Apagando[i] = 0;
                                
SendClientMessage(i, AMARELO, "O incкndio foi apagado !");
                                
Tick = GetTickCount();
                                
DisablePlayerCheckpoint(i);
                                
KillTimer(Timer);
                            }
                        }
                    }
                }
            }
        }
    }
    return 
1;
}
public 
Msgs()
{
    new 
cor = random(sizeof(Cores));
    
SendClientMessageToAll(Cores[cor], "Quer ajuda na profissгo de bombeiro ? /ajudabombeiro.");
     
SendClientMessageToAll(AMARELO,"Este servidor usa o FilterScript de Incкndio criado por Shadoww5.");
    return 
1;
}
stock Salvar(playerid)
{
    new 
save[24],nome[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,nome,sizeof(nome));
    
format(save,sizeof(save),"%s", nome);
     
dini_BoolSet("Bombeiros.txt", save, Bombeiro[playerid]);
    return 
1;
}
stock Carregar(playerid)
{
    new 
save[24],nome[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,nome,sizeof(nome));
    
format(save,sizeof(save),"%s",nome);
    if(
dini_Isset("Bombeiros.txt", save))
    {
        
Bombeiro[playerid] = bool:dini_Bool("Bombeiros.txt", save);
    }
    else { 
Bombeiro[playerid] = false; }
    return 
1;
}
/*! FILTERSCRIPT DE INCENDIO DESENVOLVIDO POR SHADOWW5 !
  ! FILTERSCRIPT DE INCENDIO DESENVOLVIDO POR SHADOWW5 !
           Contato: http://*******/iT6xEw
           Contato: http://*******/iT6xEw
    NAO RETIRE OS CREDITOS !! NAO RETIRE OS CREDITOS !!
    NAO RETIRE OS CREDITOS !! NAO RETIRE OS CREDITOS !!*/ 
Reply
#2

aprovado testei com ele
Nota:10
Reply
#3

Bom. Mais Usa strcat em dialog assim :
pawn Код:
new JFS[20];
strcat(JFS," EEEEEEE");
strcat(JFS," EMOOO0");
ShowPlayerDialog...
Bom.
Reply
#4

Eu fiz isso, Jonathan.

Vocк abriu o codigo ?
Reply
#5

Fui eu sim ... Integralmente feito por mim.
Reply
#6

xD.

pawn Код:
strcat(string, "\t- /bm: Serve para se tornar um bombeiro.", sizeof(string));
Para
pawn Код:
strcat(string,"\t- /bm: Serve para se tornar um bombeiro.");
й mais da no Mesmo xD

Parabйns pelo Code. gostei do sistema de bombeiro *-* bom pra RP
Reply
#7

Valeu ae ...

Mas dб tudo na mesma coisa, conforme vocк disse.
Reply
#8

Comentem ae ...

Sу desta forma poderei descobrir os bugs, melhorar o codigo e, consequentemente, otimizar o FilterScript.
Reply
#9

Quote:
Originally Posted by The Knight
Посмотреть сообщение
Foi vocк mesmo que fez? Jб vi uns parecidos na arйa original do fуrum.
Mas bom trabalho, parabйns (:
Eu tambйm, jб vi um feito acho que pelo o rjj.


@tуpico

Bom. Parabйns.
Reply
#10

Quote:
Originally Posted by Ricop522
Посмотреть сообщение
Eu tambйm, jб vi um feito acho que pelo o rjj.


@tуpico

Bom. Parabйns.
Quote:
Originally Posted by Shadoww5
Посмотреть сообщение
Notei que aqui no fуrum hб poucos topicos relacionados а isto. Dentre os mais procurados (dois), um estб com o link invбlido e o outro й do rjj.

Todavia, eu quis criar um sistema alternativo ao dele (que й muito bom, diga-se de passagem) e aprimorar meus conhecimentos em pawn.
.....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)