Como se hace esto? - 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: Como se hace esto? (
/showthread.php?tid=474771)
Como se hace esto? -
ValenRatti - 09.11.2013
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;
}
Respuesta: Como se hace esto? -
OTACON - 09.11.2013
pawn Код:
format(string, sizeof(string), "Anunciante: %s, ID: %d", GetPlayerNameEx(playerid), ]playerid); //aca esta el tema
ABroadCast( COLORADMIN, string, 1337);
Respuesta: Como se hace esto? -
Parka - 09.11.2013
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
Re: Como se hace esto? -
ValenRatti - 09.11.2013
Gracias a ambos, lo habia intentado antes con playerid pero en vez de poner "%d" habia puesto "%s". Gracias!
Respuesta: Como se hace esto? -
OTACON - 09.11.2013
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 '%'