[Ayuda] Script no funciona pero compila
#1

Buenas, deseo una soluciуn a este gran error. Bueno, el error es bбsicamente que desconoce los comandos y, no funcionan. Dejo el cуdigo por aquн:

Код:
#include <a_samp>

#if defined FILTERSCRIPT

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

public OnFilterScriptInit()

public OnPlayerCommandText(playerid, cmdtext[])
{
  dcmd(vida, 4, cmdtext);
  dcmd(morir, 5, cmdtext);
 
  return SendClientMessage(playerid, 0xFFFFFFFF, "Comando desconocido.");
}

dcmd_morir(playerid, params[])
{
  new id; 
  new string; 
  if(sscanf(params, "u", id)) 
  {
    SendClientMessage(playerid, 0xFFFFFFFF, "Comando: /matar [player id]"); 
  }
  else if(IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFFFFFFFF, "Ese jugador no esta conectado"); 
  else 
  {
    SetPlayerHealth(id, 0.0); // se cambia la vida del jugador a 0
    format(string, sizeof(string), "Has matado al jugador con la ID %d!", id); 
    SendClientMessage(playerid, 0xFFFFFFFF, string);
  }
  return 1;
}

dcmd_vida(playerid, params[])
{
  new id; 
  new string; 
  if(sscanf(params, "u", id)) 
  {
    SendClientMessage(playerid, 0xFFFFFFFF, "Comando: /vida [player id]"); 
  }
  else if(IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFFFFFFFF, "Ese jugador no esta conectado"); 
  else 
  {
    SetPlayerHealth(id, 100.0); // se cambia la vida del jugador a 0
    format(string, sizeof(string), "Has curado al jugador con el ID %d!", id); 
    SendClientMessage(playerid, 0xFFFFFFFF, string); 
  }
  return 1;
}
Espero una soluciуn y en lo posible un tutorial sobre un estilo de script como este. Tengo algo de conocimiento de lua por lo tanto algo difнcil entre lo fбcil.

Un saludo y gracias de antemano.
Reply


Messages In This Thread
[Ayuda] Script no funciona pero compila - by Platin - 05.05.2014, 23:43
Re: [Ayuda] Script no funciona pero compila - by Vitor_Marfioso - 06.05.2014, 01:12

Forum Jump:


Users browsing this thread: 1 Guest(s)