Como se hace esto?
#1

Miren, lo que sabes es simple pero recien comienzo con scripting y no se, yo agregue que cuando cada usuario pone /ad y el anuncio a los admins les llegue el nombre y el ID de la persona que lo hizo, pero solo pude hacer que me aparezca el nombre, ya que no se lo otro como hacerlo, si alguno me ayuda, gracias.

pawn Код:
zcmd(ad, playerid, params[]){
        if(!IsPlayerConnected(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "Usted aъn no estб conectado.");
        if(Info[playerid][pADMute] == 1) return SendClientMessageEx(playerid, COLOR_GREY, "Estбs prohibido de hacer anuncios.");
        if(Info[playerid][pPnumber] == 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "No tienes un telйfono.");
        if(GetPlayerCash(playerid) < 100) return SendClientMessageEx(playerid, COLOR_GRAD2, "No tienes suficiente dinero.");
        if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USA: /ad [anuncio]");
        if(iAdverTimer >= 1)
                {
                    new szerror[128];
                    format(szerror, sizeof(szerror), "Sуlo se puede enviar un anuncio cada 1 Minuto, faltan %d segundos.", iAdverTimer);
                    return SendClientMessageEx(playerid, COLOR_GREY, szerror);
                }
            else if(Info[playerid][pPnumber] > 0){
            GivePlayerCash(playerid, -100);
            iAdverTimer = 60;
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            new string[128];
            format(string, sizeof(string), " [Anuncio] %s . (%i)", params, Info[playerid][pPnumber]);
            OOCNews(TEAM_GROVE_COLOR,string);
            format(string, sizeof(string), "Anunciante: %s, ID: .", GetPlayerNameEx(playerid)); //aca esta el tema
            ABroadCast( COLORADMIN, string, 1337);
            }
        return 1;
    }
Reply
#2

pawn Код:
format(string, sizeof(string), "Anunciante: %s, ID: %d", GetPlayerNameEx(playerid), ]playerid); //aca esta el tema
            ABroadCast( COLORADMIN, string, 1337);
Reply
#3

preguntas por un simple playerid, como crees que obtienes el nombre??

pawn Код:
format(string, sizeof(string), "Anunciante: %s, ID: %d .", GetPlayerNameEx(playerid),playerid);

EDIT: @Otacon Nooooooo por un simple minuto putoooo
Reply
#4

Gracias a ambos, lo habia intentado antes con playerid pero en vez de poner "%d" habia puesto "%s". Gracias!
Reply
#5

https://sampwiki.blast.hk/wiki/Format

%b Inserta un numero Binario.
%c Inserta un solo carбcter.
%d Inserta un Numero entero (conjunto).
%f Inserta un Numero Floatante (float).
%i Inserta un entero.
%s Inserta una Cadena(string).
%x Inserta un Numero hexadecimal.
%% Inserta el literal '%'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)