SA-MP Forums Archive
[Ajuda] Anuncio - 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: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Anuncio (/showthread.php?tid=375567)



Anuncio - s4kuL - 07.09.2012

Criei um comando de anuncio in-game, mais ele nгo tб funcionando corretamente como eu queria, bom se eu entro no servidor e digito /anuncio1 <msg = teste> <tempo = 5(segundos)> aparece a mensagem rapidamente e sai, mais se uso 5000 no tempo aparece por 5 segundos, queria saber como posso colocar para anunciar em segundos, exemplo 10 = anuncia por 10 segundos, etc.

Cуdigo:

pawn Код:
CMD:anuncio1(playerid,params[])
{
    new tempo,msg[150];
    new string[150];
    if(playerinfo[playerid][Admin] < 1) return SendClientMessage(playerid,branco,"SERVER: Unknown command.");
    if(sscanf(params,"s[150]d",msg,tempo)) return SendClientMessage(playerid,yellow,"Use: /anuncio1 <texto> <tempo>");
    format(string,sizeof(string),"%s",msg);
    GameTextForAll(string,tempo,3);
    return 1;
}



Re: Anuncio - paulor - 07.09.2012

pawn Код:
CMD:anuncio1(playerid,params[])
{
    new tempo,msg[150];
    new string[150];
    if(playerinfo[playerid][Admin] < 1) return SendClientMessage(playerid,branco,"SERVER: Unknown command.");
    if(sscanf(params,"s[150]d",msg,tempo)) return SendClientMessage(playerid,yellow,"Use: /anuncio1 <texto> <tempo>");
    format(string,sizeof(string),"%s",msg);
    GameTextForAll(string,(tempo*1000),3);
    return 1;
}



Re: Anuncio - s4kuL - 07.09.2012

@Edit denovo, descobri o erro, se eu coloco espaзo na mensagem nгo dб, mais se nгo coloco dб..


Re: Anuncio - paulor - 07.09.2012

Quote:
Originally Posted by s4kuL
Посмотреть сообщение
Continua a mesma coisa paulor.
Vei nгo mexi em nada no teu CMD, a nгo ser na parte do Tempo... Testa dinovo isso ae!


Re: Anuncio - s4kuL - 07.09.2012

Editei, olha ai.


Re: Anuncio - humildadeforever - 07.09.2012

Sу usar: /anuncio1 tempo texto
pawn Код:
CMD:anuncio1(playerid,params[])
{
    new tempo,msg[150];
    new string[150];
    if(playerinfo[playerid][Admin] < 1) return SendClientMessage(playerid,branco,"SERVER: Unknown command.");
    if(sscanf(params,"ds[150]",tempo,msg)) return SendClientMessage(playerid,yellow,"Use: /anuncio1 <tempo> <texto>");
    format(string,sizeof(string),"%s",msg);
    GameTextForAll(string,tempo*1000,3);
    return 1;
}



Re: Anuncio - s4kuL - 07.09.2012

deu certo aqui humildade valeu.


Re: Anuncio - FeelLikeASir_ - 07.09.2012

SendClientMessage(playerid,branco,"SERVER: Unknown command.");

LOL

nгo й mais fбcil retornar false? '-