[Ajuda] /Asay - 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] /Asay (
/showthread.php?tid=370577)
/Asay -
Gabriel Santana - 20.08.2012
Qual erro que tб nesse comando que eu fiz?
pawn Код:
CMD:asay(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, AMARELO, "SERVER: Uso do comando correto: /asay [Texto]");
return 1;
}
{
GetPlayerName(playerid, aName, sizeof(aName));
format(string, sizeof(string), "[GLOBAL ADIMINISTRADOR][%s]: %s",aName,cmdtext[6]);
SendClientMessageToAll(AZUL,string);
}
return 1;
}
Erros:
pawn Код:
C:\Users\Gabriel\Desktop\samp03esvr_win32\gamemodes\aprendendo.pwn(1099) : error 017: undefined symbol "strtok"
C:\Users\Gabriel\Desktop\samp03esvr_win32\gamemodes\aprendendo.pwn(1099) : error 033: array must be indexed (variable "tmp")
C:\Users\Gabriel\Desktop\samp03esvr_win32\gamemodes\aprendendo.pwn(1105) : warning 217: loose indentation
C:\Users\Gabriel\Desktop\samp03esvr_win32\gamemodes\aprendendo.pwn(1106) : error 017: undefined symbol "aName"
C:\Users\Gabriel\Desktop\samp03esvr_win32\gamemodes\aprendendo.pwn(1106) : error 017: undefined symbol "aName"
C:\Users\Gabriel\Desktop\samp03esvr_win32\gamemodes\aprendendo.pwn(1106) : error 029: invalid expression, assumed zero
C:\Users\Gabriel\Desktop\samp03esvr_win32\gamemodes\aprendendo.pwn(1106) : fatal error 107: too many error messages on one line
Re: /Asay -
Abravanel - 20.08.2012
Use dessa forma
pawn Код:
CMD:asay(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, AMARELO, "SERVER: Uso do comando correto: /asay [Texto]");
GetPlayerName(playerid, aName, 25);
format(string, sizeof(string), "[GLOBAL ADIMINISTRADOR][%s]: %s",aName,params);
SendClientMessageToAll(AZUL,string);
return 1;
}
Re: /Asay -
Gabriel Santana - 20.08.2012
Aferreira,
Coloquei seu comando ai deus uns erros, tipo, faltando a string e aName.
Coloquei.
pawn Код:
new string[124];
new aName;
Ai deu um erro.
pawn Код:
C:\Users\Gabriel\Desktop\samp03esvr_win32\gamemodes\aprendendo.pwn(1099) : error 035: argument type mismatch (argument 2)
e a linha do erro й:
pawn Код:
GetPlayerName(playerid, aName, 25);
Re: /Asay -
@Riichard - 20.08.2012
Cуdigo do AFerreira:
pawn Код:
CMD:asay(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, AMARELO, "SERVER: Uso do comando correto: /asay [Texto]");
new aName[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
format(string, sizeof(string), "[GLOBAL ADIMINISTRADOR][%s]: %s",aName,params);
SendClientMessageToAll(AZUL,string);
return 1;
}