Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //FilterScript de ModoWar feito em [22/06/2013] por Lucas Vinícius, agradecimentos especiais a: Willian Luigi.
- //Atualizações realizadas em 24/06/2013, foi utilizado operação ternária e optimizações
- #tryinclude < a_samp >
- #tryinclude < zcmd >
- #define function::%0(%1) forward %0(%1); public %0(%1)
- new DeathMatch[MAX_PLAYERS] = {0,...};
- new bool:LiberouWar;
- //new bool:LiberouWar = !!LiberouWar;
- //new bool:LiberourWar = !!LiberouWar;
- //new bool:LiberouWar = !!LiberouWar;
- new Float:RandomDM[][3] =
- {
- {-329.3650,1536.5566,76.6117},
- {-2386.9773,-587.2404,132.1172}
- };
- //forward VerificarDM(hour);
- //public VerificarDM(hour)
- function::VerificarDM(hour)
- {
- new minute, second;
- gettime(hour, minute, second);
- //if(hour ==> 19 && minute == 0 && second == 0)
- //if(hour == 19)
- //if(minute >= 00 && minute <= 30)
- if (hour == 19 && 30 >= minute >= 00)
- {
- for(new i; i < MAX_PLAYERS; i++) {
- DeathMatch[i] = 1;
- SendClientMessage(i, 0x00FFFFAA,"* Modo DeathMatch inicilizado,para ir digite '/war'. *");
- printf("* O modo war foi inicializado no horario normal, 19:00 com o prazo de até 19:30, até ser fechado. *");
- return 0x01;
- }
- }
- else if(hour == 00 && minute == 0 && second == 0) {
- for(new i; i < MAX_PLAYERS; i++) {
- if(DeathMatch[i] == 1) {
- SpawnPlayer(i);
- SetPlayerInterior(i, 0);
- DeathMatch[i] = 0;
- SendClientMessage(i, 0x00FFFFAA,"* Modo DeathMatch foi desativado, só será aberto agora às 19:00 de amanhã, obrigado. *");
- printf("* O modo war foi desativado no horario normal, 00:00:00, só será aberto as 19:00 do dia seguinte. *");
- }
- return 0x01;
- }
- return 0x01;
- }
- return 0x01;
- }
- CMD:war(playerid,params[])
- {
- if(DeathMatch[playerid] == 0)
- {
- SendClientMessage(playerid, 0x8000FFAA,"* O Mod war está fechado no momento, volte às 19:00. *");
- return 1;
- }
- new rand = random(sizeof(RandomDM));
- SetPlayerPos(playerid, RandomDM[rand][0], RandomDM[rand][1], RandomDM[rand][2]);
- if(RandomDM[rand][0]) {
- SendClientMessage(playerid, 0x00FFFFAA,"* Você foi como um policial no DeathMatch. *");
- SetPlayerPos(playerid,-975.975708,1060.983032,1345.671875);
- SetPlayerInterior(playerid,10);
- GivePlayerWeapon(playerid,22,100);
- GivePlayerWeapon(playerid,26,100);
- GivePlayerWeapon(playerid,29,100);
- GivePlayerWeapon(playerid,31,100);
- GivePlayerWeapon(playerid,32,100);
- GivePlayerWeapon(playerid,34,100);
- SetPlayerColor(playerid, 0x808000AA);
- }
- else if(RandomDM[rand][1]) {
- SetPlayerPos(playerid, 1128.4297,1057.4825,1346.4141);
- SetPlayerInterior(playerid,10);
- GivePlayerWeapon(playerid,22,100);
- GivePlayerWeapon(playerid,26,100);
- GivePlayerWeapon(playerid,29,100);
- GivePlayerWeapon(playerid,31,100);
- GivePlayerWeapon(playerid,32,100);
- GivePlayerWeapon(playerid,34,100);
- SendClientMessage(playerid, 0x00FFFFAA,"* Você fo como terrorista no DeathMatch. *");
- SetPlayerColor(playerid, 0x00FF80AA);
- }
- return 0x01;
- }
- CMD:abrir_war(playerid,params[])
- {
- if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "* Você precisa ser administrador logado na rcon. *");
- if(!LiberouWar)
- {
- LiberouWar = true;
- SendClientMessage(playerid, -1,"{FFFFFF}[INFO]: {D02090}Modo 4Fun/War foi aberto por um administrador.");
- }
- return 0x01;
- }
- CMD:fechar_war(playerid,params[])
- {
- if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "* Você precisa ser administrador logado na rcon. *");
- if(LiberouWar)
- {
- //LiberouWar = false;
- LiberouWar = !LiberouWar;
- SendClientMessage(playerid, -1,"{FFFFFF}[INFO]: {D02090}Modo 4Fun/War foi fechado por um administrador.");
- }
- return 0x01;
- }
- CMD:sair_war(playerid,params[])
- {
- return SpawnPlayer(playerid), 0x01;
- }
- CMD:comandoswar(playerid)
- {
- return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Modo War - 4FUN", "[DM]: /war e /sair_war\n[4FUN]: Em breve 4FUN\n\nEm breve, mais novidades!", "Fechar", ""), 0x01;
- }
Advertisement
Add Comment
Please, Sign In to add comment