AKA CMD
#1

Suprise. It's me again...

What the hell is the problem with this command, I'm geting some errors in format line

Код:
error 029: invalid expression, assumed zero
 error 017: undefined symbol "name"
error 001: expected token: ";", but found "return"
 fatal error 107: too many error messages on one line
Код:
CMD:aka(playerid,params[])
{
	new player1, playername[MAX_PLAYER_NAME], str[128], ip[16];
	player1 = strval(params);
 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
 	{
	  	GetPlayerIp(player1, ip, sizeof(ip));
		format(str,sizeof(str),"|- %s's AKA -|", GetName(player1));
        SendClientMessage(playerid,-1,str);
	    format(str,sizeof(str), "Id: %d Ip: %s Names: %s", GetName(player1), ip, INI_Int("/Korisnici/%s.ini",ip));
        SendClientMessage(playerid, -1, str);
	}
	else return SendClientMessage(playerid, -1, "Player is not connected or is yourself");
	return 1;
}
Reply
#2

Please add line numbers with your error code and the actual code itself. For all we know the errors could be talking about something elsewhere in the script.
Reply
#3

Quote:
Originally Posted by Hunud
Посмотреть сообщение
Suprise. It's me again...

What the hell is the problem with this command, I'm geting some errors in format line

Код:
error 029: invalid expression, assumed zero
 error 017: undefined symbol "name"
error 001: expected token: ";", but found "return"
 fatal error 107: too many error messages on one line
Код:
CMD:aka(playerid,params[])
{
	new player1, playername[MAX_PLAYER_NAME], str[128], ip[16];
	player1 = strval(params);
 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
 	{
	  	GetPlayerIp(player1, ip, sizeof(ip));
		format(str,sizeof(str),"|- %s's AKA -|", GetName(player1));
        SendClientMessage(playerid,-1,str);
	    format(str,sizeof(str), "Id: %d Ip: %s Names: %s", GetName(player1), ip, INI_Int("/Korisnici/%s.ini",ip));
        SendClientMessage(playerid, -1, str);
	}
	else return SendClientMessage(playerid, -1, "Player is not connected or is yourself");
	return 1;
}
you can't do that (%s) here
PHP код:
INI_Int("/Korisnici/%s.ini",ip
you have to format the string first if you want to get the ip/name after the '/'

despite that the rest of that format is also kind of wrong.
Quote:
Код:
format(str,sizeof(str), "Id: %d Ip: %s Names: %s", GetName(player1), ip, INI_Int("/Korisnici/%s.ini",ip));
1. you expect a id, a Number but you offer the name (string)
3. expect (probably, guessing) multiple names, but only offer return code of INI_Int, no actual string of names

so that's that. you should know what to do
Reply
#4

Sounds hard to me as well. I'll try but not going to promise anything
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)