SA-MP Forums Archive
error 036: empty statement - 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: error 036: empty statement (/showthread.php?tid=493483)



error 036: empty statement - Omar55555 - 08.02.2014

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


Re: error 036: empty statement - CuervO - 08.02.2014

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.


Re: error 036: empty statement - Omar55555 - 09.02.2014

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 ?


Re: error 036: empty statement - Don_Cage - 09.02.2014

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;
}



Re: error 036: empty statement - Omar55555 - 10.02.2014

giving me loads of errors not working aswell. :/


Re: error 036: empty statement - Vanter - 10.02.2014

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



Re: error 036: empty statement - Don_Cage - 10.02.2014

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


Re: error 036: empty statement - Omar55555 - 10.02.2014

guys nvm i fixed it,

LOCK.