[PEDIDO]/tempopresos. - 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: [PEDIDO]/tempopresos. (
/showthread.php?tid=314812)
[PEDIDO]/tempopresos. -
lyllrasta - 31.01.2012
Alguem Tem Como fazer Um Comando /tempopresos Pra Mim ? HEHE.
tentei tudo que й forma mas nгo consigo. FUUUUUUUUUUUUUUUUUUU
Quem ajudar +rep.
Vlws.
Re: [PEDIDO]/tempopresos. -
Hard` - 31.01.2012
Desculpe-me se nгo der certo, sou iniciante em pawn.
Tente:
pawn Код:
if(!strcmp(cmdtext, "/presos", true))
{
SendClientMessage(playerid, 0x00FF00FF, "|_____[PRESOS ONLINE]_____|");
new count=0;
new tmpp[256];
tmp = strtok(cmdtext, idx);
tmpp = strtok(cmdtext, idx);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(logado[i] == 1)
{
if(PlayerInfo[i][Preso] >= 1)
{
new str[256];
new pname[24];
GetPlayerName(i, pname, 24);
format(str, 256, "PRESO - %s - [Tempo Restante: %d Segundos] ", pname, SecondsJailed);
SendClientMessage(playerid, 0xC0C0C0FF, str);
count++;
}
}
}
}
if(count == 0)
{
SendClientMessage(playerid, COLOR_CYAN, "Nenhum Preso Online !");
}
return 1;
}
Re: [PEDIDO]/tempopresos. -
lyllrasta - 31.01.2012
Nao uso STRTOK eu us ZCMD !
VLW A INTENЗГO
Re: [PEDIDO]/tempopresos. -
[Pawno] - 31.01.2012
Quote:
Originally Posted by Hard`
Desculpe-me se nгo der certo, sou iniciante em pawn.
Tente:
pawn Код:
if(!strcmp(cmdtext, "/presos", true)) { SendClientMessage(playerid, 0x00FF00FF, "|_____[PRESOS ONLINE]_____|"); new count=0; new tmpp[256]; tmp = strtok(cmdtext, idx); tmpp = strtok(cmdtext, idx); for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(logado[i] == 1) { if(PlayerInfo[i][Preso] >= 1) { new str[256]; new pname[24]; GetPlayerName(i, pname, 24); format(str, 256, "PRESO - %s - [Tempo Restante: %d Segundos] ", pname, SecondsJailed); SendClientMessage(playerid, 0xC0C0C0FF, str); count++; } } } } if(count == 0) { SendClientMessage(playerid, COLOR_CYAN, "Nenhum Preso Online !"); } return 1; }
|
Conheзo esse code, mais deixa quieto, CTRL C + CTRL V, sem contar a pйssima identaзгo
@TOPIC
Dei uma arrumada no comando acima e coloquei em ZCMD.
pawn Код:
CMD:presos(playerid)
{
new count = 0;
SendClientMessage(playerid, 0x00FF00FF, "|_____[PRESOS ONLINE]_____|");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(logado[i] == 1)
{
if(PlayerInfo[i][Preso] >= 1)
{
new str[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(i, playername, sizeof(playername));
format(str, sizeof(str), "PRESO - %s - [Tempo Restante: %d Segundos] ", playername, SecondsJailed);
SendClientMessage(playerid, 0xC0C0C0FF, str);
count++;
}
}
}
if(count == 0)
{
SendClientMessage(playerid, COLOR_CYAN, "* Nenhum Presidiбrio Online !");
}
return 1;
}