[Ajuda] ajuda com comando de criar evento
#1

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(playeridkilleridreason)
{
    
SendDeathMessage(killeridplayeridreason);
    new 
killerName[MAX_PLAYER_NAME];
    new 
playerName[MAX_PLAYER_NAME];
    if(
EntrounoEvento == 1)
    {
         
GetPlayerName(playerid,killerName,sizeof(killerName));
         
GetPlayerName(playerid,playerName,sizeof(playerName));
        
format(str2sizeof(str2), "[Evento] %s matou %s Arma:%d"killerNameplayerNamereason);
        
SendClientMessageToAll(0xff6633AAstr2);
        
EntrounoEvento 0;
    }
       if(
JogadorNoEvento[playerid] != 1)
    {
        
JogadorNoEvento[killerid] ++;
        if(
JogadorNoEvento[killerid] > VencedorDoEvento)
        {
            new 
killer[MAX_PLAYER_NAME];
            
VencedorDoEvento killerid;
            
VencedorDoEvento JogadorNoEvento[killerid];
            
GetPlayerName(killeridkillersizeof(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.000000319.000000"Server mGo Eventos - 2010");
    
TextDrawBackgroundColor(EventomGo255);
    
TextDrawFont(EventomGo3);
    
TextDrawLetterSize(EventomGo0.5699991.000000);
    
TextDrawColor(EventomGo, -1);
    
TextDrawSetOutline(EventomGo0);
    
TextDrawSetProportional(EventomGo1);
    
TextDrawSetShadow(EventomGo1);
    
TextDrawUseBox(EventomGo1);
    
TextDrawBoxColor(EventomGo, -16711681);
    
TextDrawTextSize(EventomGo279.0000000.000000);
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp("/eabrir",cmdtext,true)==0)
    {
        if (
IsPlayerAdmin(playerid))
        {
            if(
EntrounoEvento != 1)
            {
                new 
string[256];
                new 
sendername[MAX_PLAYER_NAME];
                
GetPlayerName(playeridsendernamesizeof(sendername));
                new 
number 20;
                
format(stringsizeof(string), "* Admin %s criou um Evento Numero Maximo de Jogadores:%d."sendername,number);
                
format(stringsizeof(string), "* /evento"sendername,number);
                
SendClientMessageToAll(AZULFORTE,string);
                
GetPlayerPos(playerid,ex,ey,ez);
                   }
                   else
                {
                
SendClientMessage(playerid0xff6633AA"O Evento jб esta aberto.");
               }
        }
        else
         {
         
SendClientMessage(playerid0xff6633AA"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(playeridsendernamesizeof(sendername));
                  
format(stringsizeof(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(playerid0xff6633AA"Voce nгo pode entrar no evento.");
               }
        }
        else
         {
         
SendClientMessage(playerid0xff6633AA"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(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "* Admin %s fechou o evento."sendername);
                
SendClientMessageToAll(AZULFORTE,string);
                
SetTimer("GoEvento"10000);
                   }
                   else
                {
                
SendClientMessage(playerid0xff6633AA"O evento jб esta trancado.");
               }
        }
        else
         {
         
SendClientMessage(playerid0xff6633AA"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(playeridsendernamesizeof(sendername));
                
format(stringsizeof(string), "* %saiu do evento ."sendername);
                
SetPlayerPos(playerid,ex,ey,ez);
                
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
                   }
                   else
                {
                
SendClientMessage(playerid0xff6633AA"Impossivel sair do evento.");
               }
        }
        else
         {
         
SendClientMessage(playerid0xff6633AA"Voce nao e Admin.");
          }
        return 
1;
    }
    return 
0;
}
forward GoEvento();
public 
GoEvento()
{
    
VencedorDoEvento 999;
    
EntrounoEvento 0;
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            
ResetPlayerWeapons(i);
            
ResetPlayerMoney(i);
            
SetPlayerMarkerForPlayer42,1,0xFF0000FF );
            
GivePlayerWeapon(i24999);
            
GivePlayerWeapon(i30999);
            
GivePlayerWeapon(i31999);
            
GivePlayerWeapon(i24999);
            
GivePlayerWeapon(i25999);
            
TogglePlayerControllable(i1);
            
SendClientMessage(i0x8000FF96"O DEATHMATCH foi iniciado.");
            
PlayerPlaySound(i10570.00.00.0);
            
TextDrawShowForPlayer(i,EventomGo);
        }
    }
    
SetTimer("AcabandoEvento"2400000);
    return 
1;
}
forward AcabandoEvento();
public 
AcabandoEvento()
{
    new 
string[256];
    new 
name[MAX_PLAYER_NAME];
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
JogadorNoEvento[i] != 0)
            {
                if(
IsPlayerConnected(VencedorDoEvento))
                {
                    
GetPlayerName(VencedorDoEventonamesizeof(name));
                    
format(string,sizeof(string), "[Evento] %s Ganhou o Evento, Matou: %d ",name,VencedorDoEvento);
                    
SendClientMessage(i0x8000FF96string);
                }
                
ResetPlayerWeapons(i);
                
JogadorNoEvento[i] = 0;
                
SpawnPlayer(i);
                
GameTextForAll("~g~Evento ~g~terminado!"3000,3);
                
TextDrawDestroy(EventomGo);
            }
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)