First script - 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: First script (
/showthread.php?tid=259022)
First script -
flashsnake - 02.06.2011
Argh, I am doing my first script but it is not working, what is the problem?
Код:
26238 if strcmp("/heal", cmdtext, true, 10) == 0)
26239 {
26240 SetPlayerHealth(playerid,100);
26241 SendClientMessage(playerid,"You have been healed!");
26242 Return 1;
26243}
I get this: ER\Gamem\The Godfather\gamemodes\gf.pwn(2623
![Cool](images/smilies/cool.gif)
: error 010: invalid function or declaration
This is really my first dont be mad
Re: First script -
Jay. - 02.06.2011
Nevermind. lol
Re: First script -
sleepysnowflake - 02.06.2011
Код:
26238 if ( strcmp("/heal", cmdtext, true, 10) == 0)
26239 {
26240 SetPlayerHealth(playerid,100);
26241 SendClientMessage(playerid,"You have been healed!");
26242 Return 1;
26243}
You missed a "(".
LOL at Funtime. It would give errors TO ALL THE LINES if it would compile it with numbers.
Re: First script -
flashsnake - 02.06.2011
Aa yes, thanks
Re: First script -
Jay. - 02.06.2011
Quote:
Originally Posted by Berlovan
Код:
26238 if ( strcmp("/heal", cmdtext, true, 10) == 0)
26239 {
26240 SetPlayerHealth(playerid,100);
26241 SendClientMessage(playerid,"You have been healed!");
26242 Return 1;
26243}
You missed a "(".
LOL at Funtime. It would give errors TO ALL THE LINES if it would compile it with numbers.
|
Lol at me? You obviously didn't check my second edit.
He posted the script with the numbers anyway.
And you can clearly see he copied it of pastebin.
Re: First script -
sleepysnowflake - 02.06.2011
So, you have a problem with that ?
Re: First script -
flashsnake - 02.06.2011
I just added the numbers manually because the error says line 26238 you wouldnt know what line in the error is on.
if (strcmp("/heal", cmdtext, true, 10) == 0)
Still something wrong it gives me the same error
why u have to be so mad
Re: First script -
sleepysnowflake - 02.06.2011
Silly me, it is return 1; not Return 1;
Re: First script -
gamer931215 - 02.06.2011
You've forgotten to declare the color at SendClientMessage! its SendClientMessage(playerid,color,msg) and did you put the code under "OnPlayerCommandText" ?
like:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/heal", cmdtext, true, 10) == 0)
{
SetPlayerHealth(playerid,100);
SendClientMessage(playerid,0xFFFFFF,"You have been healed!");
return 1;
}
return 0;
}
Re: First script -
Jay. - 02.06.2011
Solved.