error 036: empty statement
#1

hello i need help in my new script

Line 253:

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 12.0, 2782.3027,-2019.0826,13.5547));
error

Код:
E:\GAMES\Omar\tests\mytest5\BK MCRP\filterscripts\BB.pwn(253) : error 036: empty statement
please really i need help and ASAP !!

full cmd

pawn Код:
if (strcmp("/ball", cmdtext, true, 6) == 0)
        {
                new Float:x, Float:y, Float:z;
                GetPlayerPos(playerid, x, y, z);
                DestroyObject(Ball);
                Ball = CreateObject(2114, x+random(3), y+random(3), z-0.8, 0, 0, 96);
                SendClientMessage(playerid,-1,"You started a basketball match, Play with your friends !!");

            if(IsPlayerInRangeOfPoint(playerid, 12.0, 2782.3027,-2019.0826,13.5547));


        else return SendClientMessage(playerid,-1,"ERROR: You are not in the basketball field!");

                return 1;
        }
        return 0;
}
thanks in advance
Reply
#2

PHP код:
if(IsPlayerInRangeOfPoint(playerid12.02782.3027,-2019.0826,13.5547)); 
if statments should not end with semicolons ( ; ).

If you want to check if the statement is false use '!' at the start of it (which also means NOT in a similar way != means NOT EQUAL).

'!' Will check if the function returns false (0) and will pass if so.

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 12.0, 2782.3027,-2019.0826,13.5547))
       return SendClientMessage(playerid,-1,"ERROR: You are not in the basketball field!");
Also that code should be above every other part of the code, otherwise the code will be executed first then it'll be checked if the player is not in the range needed.
Reply
#3

thank you sir it worked but when i type /ball the message "You started a basketball match, Play with your friends !!" even when in not range point how can i fix this ?
Reply
#4

pawn Код:
if (strcmp("/ball", cmdtext, true, 6) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, 12.0, 2782.3027,-2019.0826,13.5547));
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        DestroyObject(Ball);
        Ball = CreateObject(2114, x+random(3), y+random(3), z-0.8, 0, 0, 96);
        SendClientMessage(playerid,-1,"You started a basketball match, Play with your friends !!");
    }
    else return SendClientMessage(playerid,-1,"ERROR: You are not in the basketball field!");
    return 1;
}
Reply
#5

giving me loads of errors not working aswell. :/
Reply
#6

replace the line with this
PHP код:
if(IsPlayerInRangeOfPoint(playerid12.02782.3027,-2019.0826,13.5547)) 
Reply
#7

Quote:
Originally Posted by Omar55555
Посмотреть сообщение
giving me loads of errors not working aswell. :/
Errors?
What errors?
Reply
#8

guys nvm i fixed it,

LOCK.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)