First script
#1

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 : error 010: invalid function or declaration

This is really my first dont be mad
Reply
#2

Nevermind. lol
Reply
#3

Код:
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.
Reply
#4

Aa yes, thanks
Reply
#5

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.
Reply
#6

So, you have a problem with that ?
Reply
#7

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
Reply
#8

Silly me, it is return 1; not Return 1;
Reply
#9

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;
}
Reply
#10

Solved.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)