SA-MP Forums Archive
help i have problem - 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 i have problem (/showthread.php?tid=245606)



help i have problem - gondes - 01.04.2011

i have problem this:

pawn Код:
C:\Documents and Settings\p\Desktop\New Folder\pawno\Untitled.pwn(75) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\p\Desktop\New Folder\pawno\Untitled.pwn(75) : error 017: undefined symbol "You"
C:\Documents and Settings\p\Desktop\New Folder\pawno\Untitled.pwn(75) : error 017: undefined symbol "Killed"
C:\Documents and Settings\p\Desktop\New Folder\pawno\Untitled.pwn(75) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
        GivePlayerMoney(playerid, -1000);
        SendClientMessage(playerid, 0xFFFFFFFF, "You Died And Lost $1000");
        GivePlayerMoney(killerid, 1000);
        SendClientMessage(killerid,0xFFFFFFFF, "You Killed Him Get the Reward $1000);
    return 1;
}
how to fix that?


Re: help i have problem - Mike Garber - 01.04.2011

You forgot the last " on this line;

pawn Код:
SendClientMessage(killerid,0xFFFFFFFF, "You Killed Him Get the Reward $1000<HERE>);
So this will work.

pawn Код:
SendClientMessage(killerid,0xFFFFFFFF, "You Killed Him Get the Reward $1000"); //



Re: help i have problem - bijoyekuza - 01.04.2011

You need to close the " "
so replace
pawn Код:
SendClientMessage(killerid,0xFFFFFFFF, "You Killed Him Get the Reward $1000);
with
pawn Код:
SendClientMessage(killerid,0xFFFFFFFF, "You Killed Him Get the Reward $1000");



Re: help i have problem - gondes - 01.04.2011

i got error again

pawn Код:
C:\Documents and Settings\p\Desktop\New Folder\pawno\nubitol.pwn(96) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\p\Desktop\New Folder\pawno\nubitol.pwn(96) : warning 215: expression has no effect
C:\Documents and Settings\p\Desktop\New Folder\pawno\nubitol.pwn(96) : error 001: expected token: ";", but found "-identifier-"
C:\Documents and Settings\p\Desktop\New Folder\pawno\nubitol.pwn(96) : warning 215: expression has no effect
C:\Documents and Settings\p\Desktop\New Folder\pawno\nubitol.pwn(96) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\p\Desktop\New Folder\pawno\nubitol.pwn(96) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext,"/kill',true)) {
    {
        SetPlayerHealth(playerid, 0);
        SendClientMessage(playerid,0xFFFFFFFF, "
You Killed Your Self");
        return 1;
    }
    return 0;
}



Re: help i have problem - Mike Garber - 01.04.2011

You can't open an if-statement with two opening brackets.

pawn Код:
if(!strcmp(cmdtext,"/kill',true)) {
{
This tries to open the if-statement twice, due to the two {'s.

pawn Код:
if(!strcmp(cmdtext,"/kill',true))
{
That'll do it.


Re: help i have problem - gondes - 01.04.2011

error again

pawn Код:
C:\Documents and Settings\p\Desktop\New Folder\pawno\nubitol.pwn(96) : error 037: invalid string (possibly non-terminated string)
C:\Documents and Settings\p\Desktop\New Folder\pawno\nubitol.pwn(96) : warning 215: expression has no effect
C:\Documents and Settings\p\Desktop\New Folder\pawno\nubitol.pwn(96) : error 001: expected token: ";", but found "-identifier-"
C:\Documents and Settings\p\Desktop\New Folder\pawno\nubitol.pwn(96) : warning 215: expression has no effect
C:\Documents and Settings\p\Desktop\New Folder\pawno\nubitol.pwn(96) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\p\Desktop\New Folder\pawno\nubitol.pwn(96) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.



Re: help i have problem - Mike Garber - 01.04.2011

Now try to fix them yourself. You can't keep posting your errors all the time.
When you try to fix the errors yourself you will learn. We will stop helping you if you are going to post your errors every time you get one.

Believe me or not, the more you try the more you learn, even if you don't have a clue what it is from the beginning.


Re: help i have problem - [MG]Dimi - 01.04.2011

Give me lines. It so simple to fix errors, specially these ones.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/kill", cmdtext, true, 10) == 0)
    {
        SetPlayerHealth(playerid, 0);
        SendClientMessage(playerid,0xFFFFFFFF, "You Killed Your Self");
        return 1;
    }
    return 0;
}
Couldn't be simpler


Re: help i have problem - Cameltoe - 01.04.2011

Quote:
Originally Posted by Mike Garber
Посмотреть сообщение
You can't open an if-statement with two opening brackets.

pawn Код:
if(!strcmp(cmdtext,"/kill',true))
{
That'll do it.
No it won't Look at the strcmp.

The string is ended with an '

pawn Код:
if(!strcmp(cmdtext,"/kill",true))
{
That'll do it.


Re: help i have problem - Placebo - 01.04.2011

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext,"/kill----->'<------,true)) {
    {
        SetPlayerHealth(playerid, 0);
        SendClientMessage(playerid,0xFFFFFFFF, "You Killed Your Self");
        return 1;
    }
    return 0;
}