Compiling errors
#1

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

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

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

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

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

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

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

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

bump.. need help
Reply
#10

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];
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)