26.06.2015, 22:46
(
Последний раз редактировалось DKDarkking; 27.06.2015 в 00:54.
)
galera baixei essa filterscript mas assim quando o player ta no evento e o adm dgt /fecharevento que seria para trancar o evento , as pessoas ainda consegue dgt /evento ent poderiam me ajudar ? tambйm com o comando /destruirevento ? prfv
PHP код:
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
//Defines
#define LARANJA 0xFF6600AA
#define VERDECLARO 0x00FF0CAA
#define VERDEMEDIO 0xa5b1A3AA
#define BRANCO 0xFFFFFFAA
#define VERMELHO 0xFF0000AA
#define VERDEFRACO 0x80cf80AA
#define ROXO 0x9900FFAA
#define VERMELHOFORTE 0x33AA33AA
#define AZUL 0x8000FF96
#define AZULFRACO 0x33CCFFAA
#define VERMELHOLOUCO 0xff6633AA
#define AZULFORTE 0xFFFF00AA
#define AMARELOFORTE 0xF5DEB3AA
#define MARRON 0x58504796
new VencedorDoEvento = 999;
new JogadorNoEvento[MAX_PLAYERS];
new str2[128];
forward FimEvento();
new Float:ex;//Posiзгo X
new Float:ey;//Posiзгo Y
new Float:ez;//Posiзгo Z
new Text:EventomGo;
new EntrounoEvento;
public OnFilterScriptInit()
{
return 1;
}
#endif
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
new killerName[MAX_PLAYER_NAME];
new playerName[MAX_PLAYER_NAME];
if(EntrounoEvento == 1)
{
GetPlayerName(playerid,killerName,sizeof(killerName));
GetPlayerName(playerid,playerName,sizeof(playerName));
format(str2, sizeof(str2), "[Evento] %s matou %s Arma:%d", killerName, playerName, reason);
SendClientMessageToAll(0xff6633AA, str2);
EntrounoEvento = 0;
}
if(JogadorNoEvento[playerid] != 1)
{
JogadorNoEvento[killerid] ++;
if(JogadorNoEvento[killerid] > VencedorDoEvento)
{
new killer[MAX_PLAYER_NAME];
VencedorDoEvento = killerid;
VencedorDoEvento = JogadorNoEvento[killerid];
GetPlayerName(killerid, killer, sizeof(killer));
}
return 1;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(EntrounoEvento == 1)
{
ResetPlayerWeapons(playerid);
SetPlayerHealth(playerid,200);
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
TextDrawDestroy(EventomGo);
return 1;
}
public OnGameModeInit()
{
EventomGo = TextDrawCreate(11.000000, 319.000000, "Server mGo Eventos - 2010");
TextDrawBackgroundColor(EventomGo, 255);
TextDrawFont(EventomGo, 3);
TextDrawLetterSize(EventomGo, 0.569999, 1.000000);
TextDrawColor(EventomGo, -1);
TextDrawSetOutline(EventomGo, 0);
TextDrawSetProportional(EventomGo, 1);
TextDrawSetShadow(EventomGo, 1);
TextDrawUseBox(EventomGo, 1);
TextDrawBoxColor(EventomGo, -16711681);
TextDrawTextSize(EventomGo, 279.000000, 0.000000);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/eabrir",cmdtext,true)==0)
{
if (IsPlayerAdmin(playerid))
{
if(EntrounoEvento != 1)
{
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
new number = 20;
format(string, sizeof(string), "* Admin %s criou um Evento Numero Maximo de Jogadores:%d.", sendername,number);
format(string, sizeof(string), "* /evento", sendername,number);
SendClientMessageToAll(AZULFORTE,string);
GetPlayerPos(playerid,ex,ey,ez);
}
else
{
SendClientMessage(playerid, 0xff6633AA, "O Evento jб esta aberto.");
}
}
else
{
SendClientMessage(playerid, 0xff6633AA, "Voce nao e Admin.");
}
return 1;
}
if(strcmp("/evento",cmdtext,true)==0)
{
if (IsPlayerConnected(playerid))
{
if(EntrounoEvento == 0)
{
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s foi para o evento.", sendername);
SendClientMessageToAll(AZULFORTE,string);
SetPlayerPos(playerid,ex,ey,ez);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
SetPlayerPos(playerid,ex,ey,ez);
}
else
{
SendClientMessage(playerid, 0xff6633AA, "Voce nгo pode entrar no evento.");
}
}
else
{
SendClientMessage(playerid, 0xff6633AA, "Voce nao estб logado.");
}
return 1;
}
if(strcmp("/efechar",cmdtext,true)==0)
{
if (IsPlayerAdmin(playerid))
{
if(EntrounoEvento == 0)
{
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Admin %s fechou o evento.", sendername);
SendClientMessageToAll(AZULFORTE,string);
SetTimer("GoEvento", 1000, 0);
}
else
{
SendClientMessage(playerid, 0xff6633AA, "O evento jб esta trancado.");
}
}
else
{
SendClientMessage(playerid, 0xff6633AA, "Voce nao e Admin.");
}
return 1;
}
if(strcmp("/sairevento",cmdtext,true)==0)
{
if (IsPlayerAdmin(playerid))
{
if(EntrounoEvento == 1)
{
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %saiu do evento .", sendername);
SetPlayerPos(playerid,ex,ey,ez);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}
else
{
SendClientMessage(playerid, 0xff6633AA, "Impossivel sair do evento.");
}
}
else
{
SendClientMessage(playerid, 0xff6633AA, "Voce nao e Admin.");
}
return 1;
}
return 0;
}
forward GoEvento();
public GoEvento()
{
VencedorDoEvento = 999;
EntrounoEvento = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ResetPlayerWeapons(i);
ResetPlayerMoney(i);
SetPlayerMarkerForPlayer( 42,1,0xFF0000FF );
GivePlayerWeapon(i, 24, 999);
GivePlayerWeapon(i, 30, 999);
GivePlayerWeapon(i, 31, 999);
GivePlayerWeapon(i, 24, 999);
GivePlayerWeapon(i, 25, 999);
TogglePlayerControllable(i, 1);
SendClientMessage(i, 0x8000FF96, "O DEATHMATCH foi iniciado.");
PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
TextDrawShowForPlayer(i,EventomGo);
}
}
SetTimer("AcabandoEvento", 240000, 0);
return 1;
}
forward AcabandoEvento();
public AcabandoEvento()
{
new string[256];
new name[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(JogadorNoEvento[i] != 0)
{
if(IsPlayerConnected(VencedorDoEvento))
{
GetPlayerName(VencedorDoEvento, name, sizeof(name));
format(string,sizeof(string), "[Evento] %s Ganhou o Evento, Matou: %d ",name,VencedorDoEvento);
SendClientMessage(i, 0x8000FF96, string);
}
ResetPlayerWeapons(i);
JogadorNoEvento[i] = 0;
SpawnPlayer(i);
GameTextForAll("~g~Evento ~g~terminado!", 3000,3);
TextDrawDestroy(EventomGo);
}
}
}
return 1;
}