Need help pawn
#1

I have problem with scripting

Код:
C:\Users\Korisnik\Desktop\DeathMatch\gamemodes\DeathMatch.pwn(1786) : error 036: empty statement
C:\Users\Korisnik\Desktop\DeathMatch\gamemodes\DeathMatch.pwn(1790) : error 036: empty statement
C:\Users\Korisnik\Desktop\DeathMatch\gamemodes\DeathMatch.pwn(1802) : error 036: empty statement
C:\Users\Korisnik\Desktop\DeathMatch\gamemodes\DeathMatch.pwn(1806) : error 036: empty statement
Код:
// /enter /exit commands
	if (strcmp("/enter", cmdtext, true, 10) == 0)
	{
        if(IsPlayerInRangeOfPoint(playerid, 5, 1465.3230,-1010.9038,26.8438))
        {
            SetPlayerPos(playerid,2305.2227,-16.1804,26.7422);
        }
        if(IsPlayerInRangeOfPoint(playerid, 5, 2421.6328,-1220.3962,25.4868));
		{
		    SetPlayerPos(playerid,1204.8491,-13.1725,1000.9219);
		}
		if(IsPlayerInRangeOfPoint(playerid, 5, 2104.4556,-1806.4227,13.5547));
		{
		    SetPlayerPos(playerid,372.4194,-133.1292,1001.4922);
		}
	    return 1;
	}
	if (strcmp("/exit", cmdtext, true, 10) == 0)
	{
		if(IsPlayerInRangeOfPoint(playerid, 5, 2305.2227,-16.1804,26.7422))
		{
		    SetPlayerPos(playerid,1465.3230,-1010.9038,26.8438);
		}
		if(IsPlayerInRangeOfPoint(playerid, 5, 1204.8491,-13.1725,1000.9219));
		{
            SetPlayerPos(playerid,2421.6328,-1220.3962,25.4868);
		}
		if(IsPlayerInRangeOfPoint(playerid, 5, 372.4194,-133.1292,1001.4922));
		{
		    SetPlayerPos(playerid,2104.4556,-1806.4227,13.5547);
		}
	}
PROBLEM solved. Delete Post
Reply
#2

you should format your code, just by looking this i want to vomit
Reply
#3

PHP код:
if(IsPlayerInRangeOfPoint(playerid52421.6328,-1220.3962,25.4868)); 
Remove the ; after each if-statement.

TIP: if an if-statement is followed by only one line of code, you don't need the {}, it makes more readable code:
PHP код:
if (strcmp("/enter"cmdtexttrue10) == 0)
{
    if(
IsPlayerInRangeOfPoint(playerid51465.3230,-1010.9038,26.8438))
        
SetPlayerPos(playerid,2305.2227,-16.1804,26.7422);
    if(
IsPlayerInRangeOfPoint(playerid52421.6328,-1220.3962,25.4868))
        
SetPlayerPos(playerid,1204.8491,-13.1725,1000.9219);
    if(
IsPlayerInRangeOfPoint(playerid52104.4556,-1806.4227,13.5547))
        
SetPlayerPos(playerid,372.4194,-133.1292,1001.4922);
    return 
1;
}
if (
strcmp("/exit"cmdtexttrue10) == 0)
{
    if(
IsPlayerInRangeOfPoint(playerid52305.2227,-16.1804,26.7422))
        
SetPlayerPos(playerid,1465.3230,-1010.9038,26.8438);
    if(
IsPlayerInRangeOfPoint(playerid51204.8491,-13.1725,1000.9219))
        
SetPlayerPos(playerid,2421.6328,-1220.3962,25.4868);
    if(
IsPlayerInRangeOfPoint(playerid5372.4194,-133.1292,1001.4922))
        
SetPlayerPos(playerid,2104.4556,-1806.4227,13.5547);

Reply
#4

Remove the ";" semicolons after your if-statements.
They should only be used on functions, in this case SetPlayerPos.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)