Duvida sobre isto - 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: Duvida sobre isto (
/showthread.php?tid=399023)
Duvida sobre isto -
Gleisson_. - 12.12.2012
Bom, esses dias estava pensando em passar meu gamemode para ZCMD, ae tem isso aqui no final de OnPlayerCommandText:
PHP код:
new String[120];
format(String, sizeof(String), "[ERRO]: {FFFFFF}Vocк Digitou ' {00FF00}%s {FFFFFF}', Este comando nгo existe, use: /comandos", cmdtext);
SendClientMessage(playerid, 0xFF0000FF, String);
return 1;
}
Gostaria de saber se tem como colocar algo assim, usando a include ZCMD, se ele digitar o comando errado aparece isso ae.
Re: Duvida sobre isto -
Baiano - 12.12.2012
Em zcmd nгo se usa a OnPlayerCommandText
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success)
{
new string[90];
format(string,sizeof(string),"{FF0000}** Comando {BE8E18}%s{FF0000} й inexistente.",cmdtext);
SendClientMessage(playerid,COR, string);
return 1;
}
return 1;
}
Re: Duvida sobre isto -
Schocc - 12.12.2012
Assim esta bem configurado
pawn Код:
#if defined _zcmd_included
public OnPlayerCommandReceived( playerid, cmdtext[])
{
return printf( "OnPlayerCommandReceived( %i, %s )" , playerid , cmdtext ),1;
}
public OnPlayerCommandPerformed( playerid, cmdtext[], success)
{
if ( success )
return printf( "OnPlayerCommandPerformed( %i, %s, %i )" , playerid , cmdtext , success ),1;
else
return SendClientMessage( playerid , -1, "[ERRO]: Vocк digitou o Comando Errado "),1;
}
#else
public OnPlayerCommandText( playerid, cmdtext[])
{
return 0;
}
#endif
CMD:meucomando(playerid, params[])
{
//pragma unused params; descomente se for usar
//Funзхes nativas
return true;
}
Re: Duvida sobre isto -
Gleisson_. - 12.12.2012
Valeu, brigado aos 2.
@EDIT: +Rep aos 2