SA-MP Forums Archive
[Ayuda]Con un comando - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: [Ayuda]Con un comando (/showthread.php?tid=207869)



[Ayuda]Con un comando - RcoN! - 07.01.2011

pawn Код:
/*----------------------------------------------------------------------------*-
 |
 | Label de mierda - por MrDeath
 |
-*----------------------------------------------------------------------------*/


#include <a_samp>
#define cmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (cmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (cmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
/*----------------------------------------------------------------------------*/

new
    Text3D: g_iaPlayerLabel[MAX_PLAYERS];

/*----------------------------------------------------------------------------*/

public OnPlayerConnect(playerid)
{
    g_iaPlayerLabel[playerid] = Create3DTextLabel("-", 0xFFFFFFFF, 30.0,40.0,50.0,40.0,0, false);

    return 1;
}

/*----------------------------------------------------------------------------*/

public OnPlayerDisconnect(playerid, reason)
{
    Delete3DTextLabel(g_iaPlayerLabel[playerid]);

    return 1;
}

/*----------------------------------------------------------------------------*/
public OnPlayerCommandText(playerid, cmdtext[])
{

    cmd(texto,5,cmdtext);

    return 0;
}

cmd_texto(playerid,params[])
{

    if(!strlen(params)) return  SendClientMessage(playerid, 0xFFFFFFFF, "[Frase] Uso: /texto <frase>.Ejemplo:ElMejor");

                PlayerPlaySound(playerid,1057,0.0,0.0,0.0);

                Update3DTextLabelText(g_iaPlayerLabel[playerid], 0xFFFFFFFF, params);


    Attach3DTextLabelToPlayer(g_iaPlayerLabel[playerid], playerid, 0.0, 0.0, 0.2);


    return 1;
}

/*----------------------------------------------------------------------------*/
este comando no funciona

porfavor alguien que me diga que cambiarle para que funcione porfa




Re: [Ayuda]Con un comando - [SRG]Toxic_R. - 07.01.2011

Creo que le tienes que agregar unas llaves al comando...

Код:
*----------------------------------------------------------------------------*-
 |
 | Label de mierda - por MrDeath
 |
-*----------------------------------------------------------------------------*/

#include <a_samp>
#define cmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (cmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (cmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
/*----------------------------------------------------------------------------*/

new
    Text3D: g_iaPlayerLabel[MAX_PLAYERS];

/*----------------------------------------------------------------------------*/

public OnPlayerConnect(playerid)
{
    g_iaPlayerLabel[playerid] = Create3DTextLabel("-", 0xFFFFFFFF, 30.0,40.0,50.0,40.0,0, false);

    return 1;
}

/*----------------------------------------------------------------------------*/

public OnPlayerDisconnect(playerid, reason)
{
    Delete3DTextLabel(g_iaPlayerLabel[playerid]);

    return 1;
}

/*----------------------------------------------------------------------------*/
public OnPlayerCommandText(playerid, cmdtext[])
{

    cmd(texto,5,cmdtext);

    return 0;
}

cmd_texto(playerid,params[])
{
   if(!strlen(params)) return  SendClientMessage(playerid, 0xFFFFFFFF, "[Frase] Uso: /texto <frase>.Ejemplo:ElMejor");
      {
      PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
      Update3DTextLabelText(g_iaPlayerLabel[playerid], 0xFFFFFFFF, params);
      Attach3DTextLabelToPlayer(g_iaPlayerLabel[playerid], playerid, 0.0, 0.0, 0.2);
      }
   return 1;
}

/*----------------------------------------------------------------------------*/
Estoy seguro que es eso, de todas formas, espero haberte ayudado, mucha suerte!


Re: [Ayuda]Con un comando - RcoN! - 07.01.2011

No,No aparece el label :S
que sera...


Respuesta: [Ayuda]Con un comando - Rodro - 07.01.2011

Creo que cuando te pones un label con esa funciуn tu no lo ves, pero los demбs si. їProbaste con otra persona?


Re: [Ayuda]Con un comando - RcoN! - 07.01.2011

Si con 15 personas xDD


Re: [Ayuda]Con un comando - RcoN! - 07.01.2011

algo deve estar bug en el cmd pero no se que es...