[ayuda] Error
#1

EDIT: Pude solucionar mi problema pero ahora no me funciona como quiero... Osea por mas que tenga los PMS bloqueados le deja mandarle un whisper.

pawn Код:
CMD:w(playerid, params[])
    {
        new whis[128], string[128];
        for(new i = 0; i < MAX_PLAYERS; i++)
        if(Info[params[0]][pAdminZC] < 0) return SendClientMessageEx(playerid, COLOR_WHITE, "Solo puedes /w con adminsitradores!");
        if(HidePM[params[0]] == 1) return SendClientMessageEx(playerid, COLOR_WHITE, "Ese adminsitrador tiene los susurros bloqueados!!");
        if(sscanf(params, "ds[128]", params[0], whis)) return SendClientMessageEx(playerid,  COLOR_GRAD2, "/w [id] [texto]");
        if(IsPlayerConnected(params[0]))
        {
            format(string, sizeof(string), "Mensaje  de %s (%d): %s", GetPlayerNameEx(playerid), playerid, whis);
            SendClientMessageEx(params[0], 0xEEB711FF, string);
            format(string, sizeof(string), "Mensaje a %s (%d): %s", GetPlayerNameEx(params[0]), params[0], whis);
            SendClientMessageEx(playerid,  0xEEB711FF, string);
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(Info[i][pAdminZC] >= 1338)
                {
                    if(See_MP[i] == 1)
                    {
                        format(string, sizeof(string), "[R: %s(%d) a  User %s(%d): {FFFFFF}%s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(params[0]), params[0], params[1]);
                        SendClientMessageEx(i, 0xEEB711FF, string);
                    }
                }
           }
        }
        else SendClientMessageEx(playerid, COLOR_GRAD2, "Esa ID es invбlida.");
        return 1;
    }
pawn Код:
CMD:togpm(playerid, params[])
    {
        if(Info[playerid][pAdminZC] < 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "[ERROR]: No puedes usar este comando.");
        if(HidePM[playerid] == 1)
        {
            HidePM[playerid] = 0;
            SendClientMessageEx(playerid, COLOR_GRAD2, "ЎPMs Bloqueados!");
        }
        else
        {
            HidePM[playerid] = 1;
            SendClientMessageEx(playerid, COLOR_GRAD2, "ЎPMs desbloqueados!");
        }
        return 1;
    }
Reply
#2

Tengo que ponerlo como playerinfo o como lo tengo esta bien? Porque errores no me tora pero no me funciona como lo escribi en el comando
Reply
#3

La restriccion:

pawn Код:
if(sscanf(params, "ds[128]", params[0], whis)) return SendClientMessageEx(playerid,  COLOR_GRAD2, "/w [id] [texto]");
La tienes que poner mas arriba ....

pawn Код:
CMD:w(playerid, params[])
{
    if(sscanf(params, "us[128]", params[0], whis))  return SendClientMessageEx(playerid,  COLOR_GRAD2, "/w [id] [texto]");
    new string[128];
    if(Info[params[0]][pAdminZC] < 0)               return SendClientMessageEx(playerid, COLOR_WHITE, "Solo puedes /w con adminsitradores!");
    if(HidePM[params[0]] == 1)                      return SendClientMessageEx(playerid, COLOR_WHITE, "Ese adminsitrador tiene los susurros bloqueados!!");
    if(IsPlayerConnected(params[0]))
    {
        format(string, sizeof(string), "Mensaje  de %s (%d): %s", GetPlayerNameEx(playerid), playerid, whis);
        SendClientMessageEx(params[0], 0xEEB711FF, string);
        format(string, sizeof(string), "Mensaje a %s (%d): %s", GetPlayerNameEx(params[0]), params[0], whis);
        SendClientMessageEx(playerid,  0xEEB711FF, string);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(Info[i][pAdminZC] >= 1338)
            {
                if(See_MP[i] == 1)
                {
                    format(string, sizeof(string), "[R: %s(%d) a  User %s(%d): {FFFFFF}%s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(params[0]), params[0], params[1]);
                    SendClientMessageEx(i, 0xEEB711FF, string);
                }
            }
        }
    }
    else SendClientMessageEx(playerid, COLOR_GRAD2, "Esa ID es invбlida.");
    return 1;
}
Reply
#4

Eso me tira errores porque si pongo ese script no esta definido el "whis", de todas formas, gracias
Reply
#5

En el comando /w dice:

if(HidePM[params[0]] == 1 - Variable 1 Significa que estбn bloqueados.

Sin embargo en el comando /togpm dice:
pawn Код:
if(HidePM[playerid] == 1)
        {
            HidePM[playerid] = 0;
            SendClientMessageEx(playerid, COLOR_GRAD2, "ЎPMs Bloqueados!");
        }
Se asigna la variable 0 para bloquearlos?.....

En ese caso deberнas cambiar el /w por este:
pawn Код:
CMD:w(playerid, params[])
    {
        new whis[128], string[128];
        for(new i = 0; i < MAX_PLAYERS; i++)
        if(Info[params[0]][pAdminZC] < 0) return SendClientMessageEx(playerid, COLOR_WHITE, "Solo puedes /w con adminsitradores!");
        if(HidePM[params[0]] == 0) return SendClientMessageEx(playerid, COLOR_WHITE, "Ese adminsitrador tiene los susurros bloqueados!!");
        if(sscanf(params, "ds[128]", params[0], whis)) return SendClientMessageEx(playerid,  COLOR_GRAD2, "/w [id] [texto]");
        if(IsPlayerConnected(params[0]))
        {
            format(string, sizeof(string), "Mensaje  de %s (%d): %s", GetPlayerNameEx(playerid), playerid, whis);
            SendClientMessageEx(params[0], 0xEEB711FF, string);
            format(string, sizeof(string), "Mensaje a %s (%d): %s", GetPlayerNameEx(params[0]), params[0], whis);
            SendClientMessageEx(playerid,  0xEEB711FF, string);
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(Info[i][pAdminZC] >= 1338)
                {
                    if(See_MP[i] == 1)
                    {
                        format(string, sizeof(string), "[R: %s(%d) a  User %s(%d): {FFFFFF}%s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(params[0]), params[0], params[1]);
                        SendClientMessageEx(i, 0xEEB711FF, string);
                    }
                }
           }
        }
        else SendClientMessageEx(playerid, COLOR_GRAD2, "Esa ID es invбlida.");
        return 1;
    }
Reply
#6

Si, tienes razon, me confundi, ahora lo arregle ese tema! Pero sin embargo le sigue mandando el MSJ aunque ponga /togpm, ahora puse que si los tiene bloqueados es igual a 1 y desbloqueados es igual a 0... Pero no se, quizas hice algo mal con el orden del comando /w, muchisimas gracias de todas formas
Reply
#7

pawn Код:
CMD:togpm(playerid, params[])
{
    if(Info[playerid][pAdminZC] < 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "[ERROR]: No puedes usar este comando.");
    if(HidePM[playerid] == 0) //desblokeados
    {
        HidePM[playerid] = 1; //blokeados
        SendClientMessageEx(playerid, COLOR_GRAD2, "ЎPMs Bloqueados!");
    }
    else if(HidePM[playerid] == 1) //blokeados
    {
        HidePM[playerid] = 0; //desblokeados
        SendClientMessageEx(playerid, COLOR_GRAD2, "ЎPMs desbloqueados!");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)