SA-MP Forums Archive
Compiling errors - 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)
+--- Thread: Compiling errors (/showthread.php?tid=308392)



Compiling errors - milanosie - 03.01.2012

new error:


C:\Users\Milan\Documents\Nieuwe map\larp.pwn(84144) : warning 225: unreachable code
C:\Users\Milan\Documents\Nieuwe map\larp.pwn(84144) : warning 217: loose indentation
C:\Users\Milan\Documents\Nieuwe map\larp.pwn(84144) : error 029: invalid expression, assumed zero
C:\Users\Milan\Documents\Nieuwe map\larp.pwn(84144) : error 017: undefined symbol "cmdtext"
C:\Users\Milan\Documents\Nieuwe map\larp.pwn(84146) : error 017: undefined symbol "cmdtext"
C:\Users\Milan\Documents\Nieuwe map\larp.pwn(84157) : error 030: compound statement not closed at the end of file (started at line 84000)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


script starting at line 84144

Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext, "/entermech", true))
    {
        if(!IsPlayerInRangeOfPoint(playerid,5,1790.2391,-1720.8370,13.5395))
        {
            SetPlayerPos(playerid,-2029.798339,-106.675910,1035.171875);
            SetPlayerInterior(playerid,3);
            GameTextForPlayer(playerid,"Welcome to Cobomau Mechanics",4000,6);
            return 1;
        }
    }
}



Re: Compiling errors - Ironboy - 03.01.2012

Try this
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/entermech", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerInRangeOfPoint(playerid,5,1790.2391,-1720.8370,13.5395))
        {
            SetPlayerPos(playerid,-2029.798339,-106.675910,1035.171875);
            SetPlayerInterior(playerid,3);
            GameTextForPlayer(playerid,"Welcome to Cobomau Mechanics",4000,6);
            return 1;
        }
    }
       
    return 0;
}



Re: Compiling errors - Konstantinos - 03.01.2012

It compiles for me now!
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext, "/entermech", true))
    {
        if(!IsPlayerInRangeOfPoint(playerid,5,1790.2391,-1720.8370,13.5395))
        {
            SetPlayerPos(playerid,-2029.798339,-106.675910,1035.171875);
            SetPlayerInterior(playerid,3);
            GameTextForPlayer(playerid,"Welcome to Cobomau Mechanics",4000,6);
            return 1;
        }
    }
    return 0;
}
However, about the undefined symbol "cmdtext", I don't know why.

Edit: Ironboy was faster


Re: Compiling errors - Kaperstone - 03.01.2012

use zcmd for commands:
pawn Код:
CMD:entermech(playerid, params[])
    {
        if(!IsPlayerInRangeOfPoint(playerid,5,1790.2391,-1720.8370,13.5395))
        {
            SetPlayerPos(playerid,-2029.798339,-106.675910,1035.171875);
            SetPlayerInterior(playerid,3);
            GameTextForPlayer(playerid,"Welcome to Cobomau Mechanics",4000,6);
            return 1;
        }
return 1;
}
download zcmd from here: https://sampforum.blast.hk/showthread.php?tid=91354


Re: Compiling errors - Konstantinos - 03.01.2012

Quote:
Originally Posted by xkirill
Посмотреть сообщение
use zcmd for commands:
pawn Код:
CMD:entermech(playerid, params[])
    {
        if(!IsPlayerInRangeOfPoint(playerid,5,1790.2391,-1720.8370,13.5395))
        {
            SetPlayerPos(playerid,-2029.798339,-106.675910,1035.171875);
            SetPlayerInterior(playerid,3);
            GameTextForPlayer(playerid,"Welcome to Cobomau Mechanics",4000,6);
            return 1;
        }
return 1;
}
download zcmd from here: https://sampforum.blast.hk/showthread.php?tid=91354
I will not recomment it, because ofc ZCMD is better but look the Script lines. It will have a lot of commands for sure.
But if the person with the script is patient and has free time, ok


Re: Compiling errors - milanosie - 03.01.2012

can I use both ZCMD and the *i forgot name* proccesor?


Re: Compiling errors - Konstantinos - 03.01.2012

No, you can't use ZCMD and Strcmp together. Just choose
* ZCMD
* Dcmd
* Strcmp


Re: Compiling errors - milanosie - 03.01.2012

I use strcmp..
but why does it give me the error?
I checked it all and cant find the solution


Re: Compiling errors - milanosie - 03.01.2012

bump.. need help


Re: Compiling errors - #Pwn. - 03.01.2012

Is under the code more?

I mean it so;


Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/entermech", true))
    {
        if(!IsPlayerInRangeOfPoint(playerid,5,1790.2391,-1720.8370,13.5395))
        {
            SetPlayerPos(playerid,-2029.798339,-106.675910,1035.171875);
            SetPlayerInterior(playerid,3);
            GameTextForPlayer(playerid,"Welcome to Cobomau Mechanics",4000,6);
            return 1;
        }
    }
}


    		if(strcmp(cmdtext,"/stats",true)==0)
 			{
			new string[128];
			new string1[128];