[Ajuda] /Asay
#1

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
Reply
#2

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;
}
Reply
#3

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);
Reply
#4

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)