[Ajuda] como colocar o sistema no onplayerdealth?
#1

Queria saber quando eu finalizar o Evento O player que mais matou e queria formatar a mensagem, mais nгo faзo idйia, e nгo sei tambйm como mexer na OnPlayerDealth Nгo sei se tб certo, bom Nгo precisa mexer no restante do cod, ta perfeito
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    for(new 
iMAX_PLAYERSi++)
    {
       if(
Participando[i] == true)
       {
          if(
killerid != INVALID_PLAYER_ID)
          {
          
Matou[killerid]++;
          
SendClientMessage(playerid, -1"| INFO | Vocк Matou Mais 1!");
          return 
1;
          }
          else
          {
          
SendClientMessage(playerid, -1"| ERRO | Vocк morreu -1");
          
Morreu[playerid]--;
          return 
1;
          }
       }
       else
       {
       
SendClientMessage(playerid, -1"| ERRO | Tem nenhum evento criado.");
       return 
1;
       }
    }
    return 
1;

PHP код:
#include <a_samp>
#include <DOF2>
#include <zcmd>
#include <sscanf2>
public OnFilterScriptInit()
{
    return 
1;
}
public 
OnFilterScriptExit()
{
    
DOF2_Exit();
    return 
1;
}
#define EVENTODM              523
#define ARMAS                 530
new
    
bool:EventoDM[MAX_PLAYERS],
    
Float:XFloatYFloat:Z,
    
Float:Pos1Float:Pos2Float:Pos3,
    
bool:Participando[MAX_PLAYERS],
    
Matou[MAX_PLAYERS],
    
Morreu[MAX_PLAYERS],
    
bool:Desistiu[MAX_PLAYERS]
;
public 
OnPlayerConnect(playerid)
{
    
Participando[playerid] = false;
    
Desistiu[playerid] = false;
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
Participando[playerid] = false;
    
Desistiu[playerid] = false;
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    for(new 
iMAX_PLAYERSi++)
    {
       if(
Participando[i] == true)
       {
          if(
killerid != INVALID_PLAYER_ID)
          {
          
Matou[killerid]++;
          
SendClientMessage(playerid, -1"| INFO | Vocк Matou Mais 1!");
          return 
1;
          }
          else
          {
          
SendClientMessage(playerid, -1"| ERRO | Vocк morreu -1");
          
Morreu[playerid]--;
          return 
1;
          }
       }
       else
       {
       
SendClientMessage(playerid, -1"| ERRO | Tem nenhum evento criado.");
       return 
1;
       }
    }
    return 
1;
}
CMD:eventodm(playeridparams[])
{
    
ShowPlayerDialog(playeridEVENTODMDIALOG_STYLE_LIST"Config.","Armas\nIniciar\nFechar""Ok""");
    return 
1;
}
CMD:participar(playeridparams[])
{
    if(
EventoDM[playerid] == false) return SendClientMessage(playerid, -1"| ERRO | Nгo tem nenhum evento Criado.");
    if(
Participando[playerid] == true) return SendClientMessage(playerid, -1"| ERRO | Vocк jб estб no Evento DM.");
    
GetPlayerPos(playeridPos1Pos2Pos3);
    
SetPlayerPos(playeridXYZ);
    
SendClientMessage(playerid, -1"| INFO | Vocк estб no Evento de DM!");
    
Participando[playerid] = true;
    return 
1;
}
CMD:desistir(playeridparams[])
{
    if(
EventoDM[playerid] == false) return SendClientMessage(playerid, -1"| ERRO | Nгo tem nenhum evento Criado.");
    if(
Participando[playerid] == false) return SendClientMessage(playerid, -1"| ERRO | Vocк nгo estб participando de nenhum evento!");
    
SetPlayerPos(playeridPos1Pos2Pos3);
    
SendClientMessage(playerid, -1"| INFO | Vocк voltou para a posiзгo que vc tava!");
    
Participando[playerid] = false;
    
Desistiu[playerid] = false;
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == EVENTODM)
    {
       if(
listitem == 0)
       {
       if(
EventoDM[playerid] == false) return SendClientMessage(playerid, -1"| ERRO | Inicie o Evento Primeiro.");
       
SendClientMessage(playerid, -1"| INFO | Abrindo Dialog das Armas...");
       
ShowPlayerDialog(playeridARMASDIALOG_STYLE_LIST"Armas.","Minigun\nBazuca""Ok""");
       return 
1;
       }
       if(
listitem == 1)
       {
       if(
EventoDM[playerid] == true) return SendClientMessage(playerid, -1"| ERRO | Evento Jб criado");
       
EventoDM[playerid] = true;
       
GetPlayerPos(playeridXYZ);
       
SendClientMessage(playerid, -1"| INFO | Iniciado com sucesso.");
       
SendClientMessageToAll(-1"| INFO | Participe do EVENTO DM /Participar");
       return 
1;
       }
       if(
listitem == 2)
       {
          if(
EventoDM[playerid] == false) return SendClientMessage(playerid, -1"| ERRO | Evento Jб fechado!");
          for(new 
iMAX_PLAYERSi++)
          {
          
Participando[i] = false;
          
Desistiu[i] = false;
          
EventoDM[i] = false;
          
SendClientMessageToAll(-1"| INFO | Evento Fechado com Sucesso!");
          
SendClientMessageToAll(-1"| INFO | Evento de DM Foi Fechado, Desculpas!");
          
//SetPlayerPos(i, 1308.0928,-812.6046,77.9248);
          
return 1;
          }
       }
    }
    if(
dialogid == ARMAS)
    {
       if(
listitem == 0)
       {
          if(
EventoDM[playerid] == false) return SendClientMessage(playerid, -1"| ERRO | Inicie o Evento Primeiro.");
          for(new 
iMAX_PLAYERSi++)
          {
             if(
Participando[i] == true)
             {
             
SendClientMessage(playerid, -1"| INFO | Configurado com sucesso. Arma: Minigun");
             
GivePlayerWeapon(i389999);
             
SendClientMessageToAll(-1"| ARMA | Arma configurada para o Evento: Minigun");
             }
             else
             {
             
SendClientMessageToAll(-1"| EVENTO | Quem nгo estiver no Evento nгo irб receber as armas.");
             return 
1;
             }
          }
       }
       if(
listitem == 1)
       {
          if(
EventoDM[playerid] == false) return SendClientMessage(playerid, -1"| ERRO | Inicie o Evento Primeiro.");
          for(new 
iMAX_PLAYERSi++)
          {
             if(
Participando[i] == true)
             {
             
SendClientMessage(playerid, -1"| INFO | Configurado com sucesso. Arma: Bazuca");
             
GivePlayerWeapon(i409999);
             
SendClientMessageToAll(-1"| ARMA | Arma configurada para o Evento: Bazuca");
             }
             else
             {
             
SendClientMessageToAll(-1"| EVENTO | Quem nгo estiver no Evento nгo irб receber as armas.");
             return 
1;
             }
          }
       }
   }
   return 
0;

Ajudem ae =D
Reply
#2

up? gogo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)