pawn Код:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////// Incendio FilterScript //// //////// //////// Por: [FeK] Ken ou rjjj //////// //////// Acessem: //////// [FeK] Fуrum: http://feksquad.forumeiros.com/ //////// [FeK] Clгn: http://www.fekclan.blogspot.com/ //////// [FeK] Projetos: http://www.fekprojetos.blogspot.com/ //////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<//>>>>>>>>>>>>>>>>>>|| PROIBIDA A RETIRADA DOS CRЙDITOS ||<<<<<<<<<<<<<<<<<<<<//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<#include <a_samp>new FogoID
[1];
new Float:FogoX
[1],
Float:FogoY
[1],
Float:FogoZ
[1];
new bool:IncendioAcontecendo;
new bool:FogoApagado
[1];
new bool:ApagandoIncendio
[MAX_PLAYERS
];
static Extintor
[MAX_PLAYERS
];
new MeioDeApagar
[MAX_PLAYERS
];
forward Incendio
(playerid
);
forward ApagarFogo
(playerid
);
forward MolotovEfeito
(playerid
);
#define EXTINTOR 5#define CAMINHAO 10public OnFilterScriptInit
(){ print("\n//===================================//");
print(" Incкndio by [FeK]Ken - FeK Squad Member");
print("//===================================//\n");
return 1;
}public OnPlayerCommandText
(playerid, cmdtext
[]){ if(strcmp("/incendiar", cmdtext, true,
10) == 0) { if(IncendioAcontecendo
== true
) return SendClientMessage
(playerid, 0xFFFF00AA,
"[AVISO] Alguйm jб tocou fogo em algum lugar !");
new Float:PlayerX,
Float:PlayerY,
Float:PlayerZ;
GetPlayerPos
(playerid,PlayerX,PlayerY,PlayerZ
);
FogoX
[0]=PlayerX
+-1.9826; FogoY
[0]=PlayerY
+-1.5052; FogoZ
[0]=PlayerZ
-2;
IncendioAcontecendo
= true;
SendClientMessage
(playerid, 0xFFFF00AA,
"[AVISO] O Local б sua frente pegarб Fogo em 5 segundos !");
SetTimerEx
("Incendio",
5000, false,
"i", playerid
);
return 1;
} if(strcmp("/molotov", cmdtext, true,
8) == 0) { if(IncendioAcontecendo
== true
) return SendClientMessage
(playerid, 0xFFFF00AA,
"[AVISO] Alguйm jб tocou fogo em algum lugar !");
SendClientMessage
(playerid, 0xFFFF00AA,
"[AVISO] Vocк recebeu um Molotov para Comeзar um Incкndio !");
SendClientMessage
(playerid, 0x33FF00FF,
"[INFO] Posicione-se e Segure ao Mбximo a Tecla de Atirar para Lanзar o Molotov !");
GivePlayerWeapon
(playerid,
18,
1);
return 1;
} if(strcmp("/caminhao", cmdtext, true,
9) == 0) { if(IncendioAcontecendo
!= true
) return SendClientMessage
(playerid, 0xFFFF00AA,
"[AVISO] Nгo Estб Acontecendo nenhum Incкndio !");
new Float:PlayerX,
Float:PlayerY,
Float:PlayerZ,
Float:PlayerA;
GetPlayerPos
(playerid,PlayerX,PlayerY,PlayerZ
);
GetPlayerFacingAngle
(playerid, PlayerA
);
new Bombeiro
= CreateVehicle
(407, PlayerX,PlayerY,PlayerZ,PlayerA,
3,
1,
60000);
PutPlayerInVehicle
(playerid, Bombeiro,
0);
SetPlayerCheckpoint
(playerid, FogoX
[1]-8.3718,FogoY
[1]-8.429,FogoZ
[1],
8.0);
SendClientMessage
(playerid, 0xFFFF00AA,
"[AVISO] Pare no CheckPoint e Apague o Fogo !");
return 1;
} if(strcmp("/extintor", cmdtext, true,
9) == 0) { if(IncendioAcontecendo
!= true
) return SendClientMessage
(playerid, 0xFFFF00AA,
"[AVISO] Nгo Estб Acontecendo nenhum Incкndio !");
GivePlayerWeapon
(playerid,
42,
999);
SendClientMessage
(playerid, 0xFFFF00AA,
"[INFO] Apague o Fogo !");
return 1;
} return 0;
}public OnPlayerKeyStateChange
(playerid, newkeys, oldkeys
){ if(IncendioAcontecendo
== true
) { if((newkeys
== KEY_FIRE
&& GetPlayerWeapon
(playerid
) == 42) ||
(newkeys
== KEY_FIRE
&& GetVehicleModel
(GetPlayerVehicleID
(playerid
)) == 407)) { if((newkeys
== KEY_FIRE
&& GetPlayerWeapon
(playerid
) == 42)) { MeioDeApagar
[playerid
] = EXTINTOR;
ApagandoIncendio
[playerid
] = true;
if(Extintor
[playerid
] == 0) { SetTimerEx
("ApagarFogo",
12000, false,
"i", playerid
);
Extintor
[playerid
]++;
} } else if(newkeys
== KEY_FIRE
&& GetVehicleModel
(GetPlayerVehicleID
(playerid
)) == 407) { if(IsPlayerInRangeOfPoint
(playerid,
10.0, FogoX
[1]-8.3718,FogoY
[1]-8.429,FogoZ
[1])) { ApagandoIncendio
[playerid
] = true;
MeioDeApagar
[playerid
] = CAMINHAO;
if(Extintor
[playerid
] == 0) { SetTimerEx
("ApagarFogo",
12000, false,
"i", playerid
);
Extintor
[playerid
]++;
} } } } else { MeioDeApagar
[playerid
] = 0;
ApagandoIncendio
[playerid
] = false;
} } if(newkeys
== KEY_FIRE
&& GetPlayerWeapon
(playerid
) == 18) { if(IncendioAcontecendo
== true
) return SendClientMessage
(playerid, 0xFFFF00AA,
"[AVISO] Alguйm jб tocou fogo em algum lugar !");
new Float:PlayerX,
Float:PlayerY,
Float:PlayerZ;
GetPlayerPos
(playerid,PlayerX,PlayerY,PlayerZ
);
FogoX
[0] = PlayerX
+-1.9826+-19.8352+3-0.7077; FogoY
[0] = PlayerY
+-1.5052+-9.3883-7+4.99; FogoZ
[0] = PlayerZ
-2+0.0077;
SetTimerEx
("MolotovEfeito",
1700, false,
"i", playerid
);
} return 1;
}public Incendio
(playerid
){ new string
[200], NickName
[MAX_PLAYER_NAME
];
GetPlayerName
(playerid, NickName,
sizeof(NickName
));
format(string,
sizeof(string
),
"[AVISO] Um Novo Incкndio surgiu na cidade. Culpado: %s !",NickName
);
SendClientMessageToAll
(0x33FF00FF, string
);
FogoID
[0] = CreateObject
(18690,FogoX
[0],FogoY
[0],FogoZ
[0],
0,
0,
0,
0);
KillTimer
(SetTimerEx
("Incendio",
5000, false,
"i", playerid
));
return 1;
}public MolotovEfeito
(playerid
){ new string
[200], NickName
[MAX_PLAYER_NAME
];
GetPlayerName
(playerid, NickName,
sizeof(NickName
));
format(string,
sizeof(string
),
"[AVISO] Um Novo Incкndio surgiu na cidade. Culpado: %s !",NickName
);
SendClientMessageToAll
(0x33FF00FF, string
);
FogoID
[0] = CreateObject
(18690,FogoX
[0],FogoY
[0],FogoZ
[0],
0,
0,
0,
0);
IncendioAcontecendo
= true;
KillTimer
(SetTimerEx
("MolotovEfeito",
2500, false,
"i", playerid
));
return 1;
}public ApagarFogo
(playerid
){ new string
[150], NickName
[MAX_PLAYER_NAME
];
if(Extintor
[playerid
] > 0 && ApagandoIncendio
[playerid
] == true
&& MeioDeApagar
[playerid
] > 0) { if(MeioDeApagar
[playerid
] == EXTINTOR
) { for(new e
= 0; e
< 1; e
++) { if(IsPlayerInRangeOfPoint
(playerid,
10.0, FogoX
[0], FogoY
[0], FogoZ
[0])) { DestroyObject
(FogoID
[0]);
FogoApagado
[0] = true;
} } if(FogoApagado
[0] == true
) { IncendioAcontecendo
= false;
ApagandoIncendio
[playerid
] = false;
Extintor
[playerid
] = 0;
GetPlayerName
(playerid, NickName,
sizeof(NickName
));
format(string,
sizeof(string
),
"[AVISO] Uma Salva de Palmas para Quem Apagou o Fogo, %s !", NickName
);
SendClientMessageToAll
(0x33FF00FF, string
);
GivePlayerMoney
(playerid,
25000);
MeioDeApagar
[playerid
] = 0;
SendClientMessage
(playerid, 0x33CCFFAA,
"[INFO] Vocк Recebeu uma Quantia de 25000 Mil como Prкmio !");
KillTimer
(SetTimerEx
("ApagarFogo",
12000, false,
"i", playerid
));
} } if(MeioDeApagar
[playerid
] == CAMINHAO
&& IsPlayerInRangeOfPoint
(playerid,
10.0, FogoX
[1]-8.3718,FogoY
[1]-8.429,FogoZ
[1])) { DisablePlayerCheckpoint
(playerid
);
DestroyObject
(FogoID
[0]);
FogoApagado
[0] = true;
if(FogoApagado
[0] == true
) { IncendioAcontecendo
= false;
ApagandoIncendio
[playerid
] = false;
Extintor
[playerid
] = 0;
GetPlayerName
(playerid, NickName,
sizeof(NickName
));
format(string,
sizeof(string
),
"[AVISO] Uma Salva de Palmas para Quem Apagou o Fogo, %s !", NickName
);
SendClientMessageToAll
(0x33FF00FF, string
);
GivePlayerMoney
(playerid,
25000);
MeioDeApagar
[playerid
] = 0;
SendClientMessage
(playerid, 0x33CCFFAA,
"[INFO] Vocк Recebeu uma Quantia de 25000 Mil como Prкmio !");
KillTimer
(SetTimerEx
("ApagarFogo",
12000, false,
"i", playerid
));
} } } return 1;
}public OnFilterScriptExit
(){ DestroyObject
(FogoID
[0]);
FogoApagado
[0] = true;
return 1;
}