[Help]
#1

hello i need help, i have this error when i compile my script
Script.pwn(198 ) : error 010: invalid function or declaration
Script.pwn(201) : error 010: invalid function or declaration

line 198 is this code
if(strcmp("/heal", cmdtext, true,10) == 0);

and 201 is this
return 1;

any sugestion how to fix it ?
thx
Reply
#2

if(strcmp("/heal", cmdtext, true,10) == 0);

Get rid of the ';' at the end of that.
Reply
#3

still not working
Reply
#4

LOL! You need to tell the computer what to do, like:

Код:
if(strcmp("/heal", cmdtext, true,10) == 0);

SetPlayerHealth(playerid, 100);

return 1;
Reply
#5

Код:
if(strcmp("/heal", cmdtext, true,10) == 0)
{
SetPlayerHealth(playerid, 100);
return 1;
}
Reply
#6

Quote:
Originally Posted by Kar
Код:
if(strcmp("/heal", cmdtext, true,10) == 0)
{
SetPlayerHealth(playerid, 100);
return 1;
}
And i think you'd like it this way
Код:
if(strcmp("/heal", cmdtext, true,5) == 0)
5 insted of 10, but i donno, i dont use strcmp
Reply
#7

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(heal, 4, cmdtext);
	return 0;
}
 
dcmd_heal(playerid, params[])
{
	if (strlen(params))
	{
		id = strval(params);
		if (IsPlayerConnected(id))
		{
			SetPlayerHealth(id, 100.0);
			SendClientMessage(id, 0x00FF00AA, "You have been healed");
			SendClientMessage(playerid, 0x00FF00AA, "Player healed");
		}
		else
		{
			SendClientMessage(playerid, 0xFF0000AA, "Player not found");
		}
	}
	else
	{
		SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)