PM salto de linea [Consulta]
#1

їAlguien sabe que funciуn me puede ayudar para que si escribo una linea en los MP muy larga, en vez de que desaparezca, que continъe en la linea de abajo?


mi funcion
pawn Код:
dcmd_pm(playerid,params[])
{

    if(IsPlayerFlooding(playerid)) return SendClientMessage(playerid,red,"[ADVERTENCIA]: Solo Puedes Enviar Pm's Cada 3 Segundos");
    iPlayerChatTime[playerid] = GetTickCount();

    new id;
    new mensage[600];
    new namax[MAX_PLAYERS];
    new namax2[MAX_PLAYERS];
    new idx, pid[600];
    new string2[64];
    pid = strtok(params, idx); mensage = strtok(params, idx);
    if(!strlen(pid) || !strlen(mensage)) return SendClientMessage(playerid,red,"Usage: /pm [ID] [message]");
    id=strval(pid);

    if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "No Puedes Enviarte Un Mensaje Privado A Ti Mismo");

    if(ADpm[id] == 0)
    {
    if(IsPlayerConnected(id))
    {

    if(ServerInfo[AntiSwear] == 1 && PlayerInfo[playerid][Level] < 6)
    for(new s = 0; s < ForbiddenWordCount; s++)
    {
        new pos;
        while((pos = strfind(mensage,ForbiddenWords[s],true)) != -1) for(new i = pos, j = pos + strlen(ForbiddenWords[s]); i < j; i++) mensage[i] = '*';
    }

     if(DetectarSpam(params[strlen(pid)+1]))
    {
    if(PlayerInfo[playerid][Level] == 0 && !IsPlayerAdmin(playerid))
    {
        GetPlayerName(playerid,string2,sizeof(string2));
        ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "{00FFFF}Anti Spam", "{FFFFFF}No Puedes Hacer Spam o Seras {FF0000}Baneado", "Aceptar", "");
        format(string2,sizeof(string2),"[INFO-ADMINS]: {FFFFFF}%s {FF0000}Id: {FFFFFF}[%i] {FF0000}Posible Spam Dijo: %s",string2,playerid,mensage);
        MessageToAdmins(COLOR_RED,string2);
        return 1;
    }
    }

    GetPlayerName(playerid, namax, sizeof(namax));
    GetPlayerName(id, namax2, sizeof(namax2));
    format(string2, sizeof(string2), ">> %s(%d): %s", namax2, id, params[strlen(pid)+1]);
    SendClientMessage(playerid,COLOR_YELLOW, string2);
    format(string2, sizeof(string2), "** %s(%d): %s", namax, playerid, params[strlen(pid)+1]);
    SendClientMessage(id,COLOR_YELLOW,string2);
     PlayerPlaySound(id,1057,0.0,0.0,0.0);

    if(ServerInfo[ReadPMs] == 1 && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
    {
        format(string2, sizeof(string2), "|- PM: %s(%d) A %s(%d): %s", namax, playerid, namax2, id, params[strlen(pid)+1]);
          for (new a = 0; a < MAX_PLAYERS; a++)
        if(IsPlayerConnected(a) && (PlayerInfo[a][Level] >= 3) && a != playerid)
        SendClientMessage(a, lightred, string2);
    }

    }
    else SendClientMessage(playerid, COLOR_RED, "Ese Player No Esta Conectado");
    }
    else SendClientMessage(playerid, COLOR_RED, "Este Player Tiene Desactivado Los Mensajes Privados");
     return 1;
}
gracias
Reply
#2

Aquн: http://forum.sa-mp.com/showpost.php?...94&postcount=5
Reply
#3

no entiendo como podrнa ir D:
Reply
#4

pawn Код:
stock SendClientMessageMultiline(playerid, color, message[])
{
    #define LETRAS_POR_LINEA 143
    new
        tam = strlen(message),
        lineas = floatround(tam/LETRAS_POR_LINEA, floatround_floor),
        conteo;

    if(!lineas) return SendClientMessage(playerid, color, message);

    inicio:

    static tmp[LETRAS_POR_LINEA+1];

    strmid(tmp, message, conteo*LETRAS_POR_LINEA, (conteo+1)*LETRAS_POR_LINEA);
    SendClientMessage(playerid, color, tmp);

    if(lineas > conteo++) goto inicio;

    #undef LETRAS_POR_LINEA
    return 1;
}
Usa esa funciуn.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)