[AFK] Motivo . -
Zona_Sky - 09.11.2012
tipo esse mini code criado aki..
quando o player digita /afk ele jah fica afk mais ele nгo digita o motivo..
eu queria que tipo quando ele digitasse /afk ele nгo poderia fica afk antes de coloca o motivo, dps que ele coloca o motivo ai sim ele fica afk..
pawn Код:
if(strcmp(cmdtext, "/afk", true) == 0)
{
ShowPlayerDialog(playerid,DIALOG_AFK,DIALOG_STYLE_INPUT,".. [Digite o Motivo] ..", "Digite o Motivo de querer ficar AFK","OK","");
if(AFK[playerid]==0)
{
AFK[playerid]=1;
DOF2_SetString(temp,"Status>","AFK");
SetPlayerVirtualWorld(playerid, 1);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);
TextDrawShowForPlayer(playerid,AfkText);
TextDrawShowForPlayer(playerid,AfkBackText);
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
}else{
SendClientMessage(playerid,Vermelho,"(ERRO) Vocк jб estб no modo Online para poder utilizar esse comando!");
return 1;
}
return 1;
}
Re: [AFK] Motivo . - Joao Pedro - 09.11.2012
O sscanf pode te ajudar nisso
https://sampforum.blast.hk/showthread.php?tid=120356
Re: [AFK] Motivo . -
Zona_Sky - 09.11.2012
nгo entendi muito --'
Re: [AFK] Motivo . -
Q.I - 09.11.2012
vo nem olhar seu comando que nem identado esta use esse do carinha ali e massa!
obs nao testei ele mais deve funcionar!
https://sampforum.blast.hk/showthread.php?tid=367156
Re: [AFK] Motivo . - Joao Pedro - 09.11.2012
Quote:
Originally Posted by Zona_Sky
nгo entendi muito --'
|
Como nгo entendeu? O sscanf й pra isso, leia o que й o sscanf que aprenderб, ou quer que eu crie um tutorial tambйm? --'
Re: [AFK] Motivo . -
Sky™ - 09.11.2012
Poste o Dialog_afk
ou se nгo tire as funзхes do /afk e coloca no dialog do DIALOG_AFK
e coloque para verificar se hб mais que 2 caracteres e dai ele terб que por um motivo!
Re: [AFK] Motivo . -
Zona_Sky - 09.11.2012
pawn Код:
ShowPlayerDialog(playerid,DIALOG_AFK,DIALOG_STYLE_INPUT,".. [Digite o Motivo] ..", "Digite o Motivo de querer ficar AFK","OK","");
if(AFK[playerid]==0)
pawn Код:
if(dialogid == DIALOG_AFK)
{
if(response)
{
if(isnull(inputtext))return MDIALOG_AFK
format(string, sizeof string,"{FF0000}(INFO) {00FF00}o jogador %s ficou {FF0000}[AFK/Ausente] (/afk) {00FF00}motivo: {FF0000}%s",GetName(playerid),inputtext);
MsgChatAll(string);
return 1;
}
if(!response)return MDIALOG_AFK
return 0;
agr ta tudo
Re: [AFK] Motivo . -
Sky™ - 09.11.2012
pawn Код:
if(strcmp(cmdtext, "/afk", true) == 0)
{
if(AFK[playerid]==0)
{
ShowPlayerDialog(playerid,DIALOG_AFK,DIALOG_STYLE_INPUT,".. [Digite o Motivo] ..", "Digite o Motivo de querer ficar AFK","OK","");
}
else
{
SendClientMessage(playerid,Vermelho,"(ERRO) Vocк jб estб no modo /afk para poder utilizar esse comando!");
return 1;
}
return 1;
}
if(dialogid == DIALOG_AFK){
if(response){
new motivo[256];
if(isnull(inputtext))return MDIALOG_AFK
if(strlen(motivo) < 2)
{
ShowPlayerDialog(playerid,DIALOG_AFK,DIALOG_STYLE_INPUT,".. [Digite o Motivo] ..", "Digite o Motivo de querer ficar AFK","OK","");
return 1;
}
format(string, sizeof string,"{FF0000}(INFO) {00FF00}o jogador %s ficou {FF0000}[AFK/Ausente] (/afk) {00FF00}motivo: {FF0000}%s",GetName(playerid),inputtext);
AFK[playerid]=1;
DOF2_SetString(temp,"Status>","AFK");
SetPlayerVirtualWorld(playerid, 1);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);
TextDrawShowForPlayer(playerid,AfkText);
TextDrawShowForPlayer(playerid,AfkBackText);
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
MsgChatAll(string);
return 1;
}
else
{
ShowPlayerDialog(playerid,DIALOG_AFK,DIALOG_STYLE_INPUT,".. [Digite o Motivo] ..", "Digite o Motivo de querer ficar AFK","OK","");
}
return 1;
}
Simples tente!
Re: [AFK] Motivo . -
Zona_Sky - 09.11.2012
vo testa ai do edit@
@edit paro de compilar.. -'
Re: [AFK] Motivo . -
Zona_Sky - 09.11.2012
ops erro meu malz.. deu certo mais tipo dps que coloca o motivo no dialog.. aparece o dialog dnv e dnv dnv direto .. e nгo aparece menssagem que o player %s fico afk etc.., ex: digito /afk ai digito o motivo e nгo aparece nd.. e dps aparece dnv o dialog e nгo fica afk..
Re: [AFK] Motivo . -
zSuYaNw - 10.11.2012
Criei o sisteminha bбsico(sem precisar de nenhum processador de comandos ou 'sscanf').
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]){
if(!strcmp(cmdtext, "/afk", true, 4)){
if(strlen(cmdtext) == 4)
return SendClientMessage(playerid, -1, "/Afk <Motivo>");
strdel(cmdtext, 0, 5);
static
String[128],
Nome[24]
;
String[0] = '\0';
format(String, 128, "Player %s ficou ausente, motivo: %s", (GetPlayerName(playerid, Nome, 24), Nome), cmdtext);
SendClientMessageToAll(-1, String);
return true;
}
return false;
}
Ai vocк pega como base.
Re: [AFK] Motivo . -
Zona_Sky - 10.11.2012
tipo ai o seu eu consigo fazer.., so nгo to conseguindo em dialog --' que jah cmз da trosso!
Re: [AFK] Motivo . -
xioriscripter - 13.08.2013
como apago esse daqui!
Re: [AFK] Motivo . -
PT - 13.08.2013
ei, n venha reviver topicos velhos, ainda por cima com codigos pegados do seu gm, com variaveis que n ajudariam o cara
e sem double post veja as
regras e
estas tbm
Re: [AFK] Motivo . -
xioriscripter - 13.08.2013
Quote:
Originally Posted by PT
ei, n venha reviver topicos velhos, ainda por cima com codigos pegados do seu gm, com variaveis que n ajudariam o cara
e sem double post veja as regras e estas tbm
|
Mas vocк acha que й quem? sou novo na forum samp ver ai n da pra apagar o baguio e nгo vem falar que peguei o comandos dos outro que acabei de fazer aqui
Re: [AFK] Motivo . -
PT - 13.08.2013
Sou alguem que lhe esta a mostrar o que errou para que n volte a errar, estou a ensinar-lhe por onde comecar, visto que e novato no forum, comecando por ler as regras..
E sou alguem que nao lhe faltou ao respeito, espero que faзa o mesmo.