Help with a command.
#1

Hey, I tried making a command to enter a specific area, ( a custom made fire department ) for some reason, in pawno it says that there is an error.

If you could fix this, thankyou
The co-ordinates are correct, and what i've set them to.
I just need this working ;[
pawn Код:
if (strcmp("/enterfd", cmdtext, true, 6) == 0)
            {
                if(IsPlayerInRangeOfPoint(playerid,1342.4213867188,-1669.3712158203,17.7265625))
                    {
                        SetPlayerPos(playerid,1289.4602050781,-1604.3106689453,1242.7280273438);
                        return 1;

            }
        if (strcmp("/exitfd", cmdtext, true, 6) == 0)
            {
                if(IsPlayerInRangeOfPoint(playerid,1289.4602050781,-1604.3106689453,1242.7280273438))
                    {
                        SetPlayerPos(playerid,1342.4213867188,-1669.3712158203,17.7265625);
                        return 1;
                    }
Thanks, Menkz (M3NK5)
Reply
#2

show us the error
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/enterfd", cmdtext, true, 6) == 0)
            {
                if(IsPlayerInRangeOfPoint(playerid, 5.0, 1342.4213867188,-1669.3712158203,17.7265625))
                    {                             //^^^range
                        SetPlayerPos(playerid,1289.4602050781,-1604.3106689453,1242.7280273438);
                        return 1;
                    }

            }
        if (strcmp("/exitfd", cmdtext, true, 6) == 0)
            {
                if(IsPlayerInRangeOfPoint(playerid,5.0,1289.4602050781,-1604.3106689453,1242.7280273438))
                    {
                        SetPlayerPos(playerid,1342.4213867188,-1669.3712158203,17.7265625);
                        return 1;
                    }
            }
    return 0;
}
Missing closing brace and "IsPlayerInRangeOfPoint" has range parameter. Not touched the indentation. (incase you didn't notice lol)
Reply
#4

Still getting this,
Quote:

C:\Documents and Settings\user\Desktop\Mitchells Stuff\Ravens\gamemodes\larp.pwn(39612) : warning 217: loose indentation
C:\Documents and Settings\user\Desktop\Mitchells Stuff\Ravens\gamemodes\larp.pwn(39617) : warning 217: loose indentation
C:\Documents and Settings\user\Desktop\Mitchells Stuff\Ravens\gamemodes\larp.pwn(39623) : warning 225: unreachable code

:S
Reply
#5

The unreachable code is caused by another part of your script because when i compile that code i just get loose indentation warnings which you should know how to fix.
Indentation<< Look here

As for the unreachable code warning that is a problem, but you will need to post more code because the warning isn't from the code i posted.
Reply
#6

when I get home i'll get the lines, i'm using ravens roleplay..
Reply
#7

Quote:
Originally Posted by iggy1
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/enterfd", cmdtext, true, 6) == 0)
            {
                if(IsPlayerInRangeOfPoint(playerid, 5.0, 1342.4213867188,-1669.3712158203,17.7265625))
                    {                             //^^^range
                        SetPlayerPos(playerid,1289.4602050781,-1604.3106689453,1242.7280273438);
                        return 1;
                    }

            }
            if (strcmp("/exitfd", cmdtext, true, 6) == 0)
            {
                if(IsPlayerInRangeOfPoint(playerid,5.0,1289.4602050781,-1604.3106689453,1242.7280273438))
                    {
                        SetPlayerPos(playerid,1342.4213867188,-1669.3712158203,17.7265625);
                        return 1;
                    }
            }
    return 0;
}
Missing closing brace and "IsPlayerInRangeOfPoint" has range parameter. Not touched the indentation. (incase you didn't notice lol)
Alright the 6 after the true.

The 6 needs to be changed to 7-8 on /enterfd


Try this
pawn Код:
if (strcmp("/enterfd", cmdtext, true, 8) == 0)
//
if (strcmp("/exitfd", cmdtext, true, 8) == 0)
Just try that above and if it doesn't work then something is conflicting with this script..
Reply
#8

close this please, I fixed it

Thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)