[Help] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] (
/showthread.php?tid=125059)
[Help] -
[OzzY] - 01.02.2010
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
Re: [Help] -
Joe Staff - 01.02.2010
if(strcmp("/heal", cmdtext, true,10) == 0);
Get rid of the ';' at the end of that.
Re: [Help] -
[OzzY] - 01.02.2010
still not working
Re: [Help] -
Sir_bomber - 22.06.2010
LOL! You need to tell the computer what to do, like:
Код:
if(strcmp("/heal", cmdtext, true,10) == 0);
SetPlayerHealth(playerid, 100);
return 1;
Re: [Help] -
Kar - 22.06.2010
Код:
if(strcmp("/heal", cmdtext, true,10) == 0)
{
SetPlayerHealth(playerid, 100);
return 1;
}
Re: [Help] -
Niixie - 22.06.2010
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
Re: [Help] -
HAYTXA - 23.06.2010
Код:
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;
}