[Ajuda] Como corrigir esses erros?
#1

Como corrigir esses 3 errinhos?
Codigo:
Код:
CMD:reportar(playerid, params[])  return cmd_report(playerid, params);
	CMD:report(playerid, params[])
	{
	params = strtok(cmd_reportar, idx);
	if(!strlen(params)) return SendClientMessage(playerid, 0xFFFFFFAA, "USE: /reportar [id] [motivo]");
	playerid = strval(params);
	new reportado[MAX_PLAYER_NAME], reportador[MAX_PLAYER_NAME], motivo[128];
	GetPlayerName(playerid, reportado, sizeof(reportado));
	GetPlayerName(playerid, reportador, sizeof(reportador));
	if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "Error: Jogador off.");
	if(playerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFAA, "ERROR: Jogador invбlido.");
	motivo = strtok(cmd, idx);
	if(!strlen(motivo)) return SendClientMessage(playerid, 0xFFFFFFAA, "USE: /reportar [id] [motivo]");
	new string[128];
	format(string, sizeof(string), "Jogador %s[%i] reportou %s[%i] motivo %s", reportador, playerid, reportado, playerid, motivo);
	SendClientMessage(playerid, 0xFFFFFFAA, "[js] Relatуrio enviado.");
	for(new i = 0; i < MAX_PLAYERS; ++i)
	{
		if(IsPlayerAdmin(i))
		{
			SendClientMessage(playerid, 0xFFFFFFAA, string);
		}
	}
	return 1;
}
Erros:
Код:
(52161) : error 046: unknown array size (variable "params")
(52161) : error 076: syntax error in the expression, or invalid function call
(52169) : error 017: undefined symbol "idx"
Reply
#2

PHP код:
 new idx
PHP код:
 error 017undefined symbol "idx" 
Reply
#3

Recomendo o uso do sscanf2
Reply
#4

Quote:
Originally Posted by IlanZ
Посмотреть сообщение
Recomendo o uso do sscanf2
Como faзo essa alteraзгo?
Reply
#5

Amigo recomendo vc baixar o fs LL admin do Lucas Alemгo, eu usei muito ele para base de comandos, ele й oque vc precisa, tem muitos comandos em zcmd e sscanf2, Espero ter ajudado:

Reply
#6

Quote:
Originally Posted by MtPlayerZ
Посмотреть сообщение
Como faзo essa alteraзгo?
Este tutorial mostra a conversгo:

https://sampforum.blast.hk/showthread.php?tid=493276
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)