CMD:anunciar(playerid, params[])
{
new Texto[128], Msg[128];
if(sscanf(params, "s[128]", Texto)) return SendClientMessage(playerid, -1, "Digite: /anunciar [texto]");
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, MAX_PLAYER_NAME);
format(Msg, sizeof(Msg), "%s: %s", Nome, Texto);
TextDrawSetString(textocnn, Msg);
TextDrawShowForAll(textocnn);
SetTimer("TirarAnuncio",5000,false);
return 1;
}
if (strcmp(cmd, "/comando", true) == 0)
if (strcmp(cmd, "/anunciar", true) == 0) { new params; new Texto[128], Msg[128]; if(sscanf(params, "s[128]", Texto)) return SendClientMessage(playerid, -1, "Digite: /anunciar [texto]"); new Nome[MAX_PLAYER_NAME]; GetPlayerName(playerid, Nome, MAX_PLAYER_NAME); format(Msg, sizeof(Msg), "%s: %s", Nome, Texto); TextDrawSetString(textocnn, Msg); TextDrawShowForAll(textocnn); SetTimer("TirarAnuncio",5000,false); return 1; } |
C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(28861) : error 035: argument type mismatch (argument 1) C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(28863) : warning 219: local variable "Nome" shadows a variable at a preceding level C:\Users\2\Desktop\gamemode\gamemodes\2.pwn(28859) : warning 203: symbol is never used: "params" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
if (strcmp(cmdtext, "/anunciar", true) == 0)
{
new Texto[128], Msg[128];
if(sscanf(cmdtext, "s[128]", Texto)) return SendClientMessage(playerid, -1, "Digite: /anunciar [texto]");
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, MAX_PLAYER_NAME);
format(Msg, sizeof(Msg), "%s: %s", Nome, Texto);
TextDrawSetString(textocnn, Msg);
TextDrawShowForAll(textocnn);
SetTimer("TirarAnuncio",5000,false);
return 1;
}
if(strcmp(cmd,"/anunciar",true)==0)
{
new Texto[60], Nome[MAX_PLAYER_NAME], Msg[128], tmp[128];
GetPlayerName(playerid, Nome, sizeof(Nome));
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Digite: /anunciar [texto]");
format(Msg, sizeof(Msg), "%s: %s", Nome, Texto);
TextDrawSetString(textocnn, Msg);
TextDrawShowForAll(textocnn);
SetTimer("TirarAnuncio", 5000, false);
return 1;
}