I am getting this error, whats wrong?
#1

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	 if (strcmp("/Redbull", cmdtext, true, 10) == 0)
	 {
		if(IsPlayerInRangeOfPoint(playerid, 1.5, 20.9480, 971.8395, 19.3522))
		{
			if(GetPlayerMoney(playerid) >= 100)
			{
			    GivePlayerMoney(playerid, -100);
			    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER );
	   		    SendClientMessage(playerid, 0xFFFF00AA,"Redbull costed 100$");
			}
			else
			{
  		            SendClientMessage(playerid, 0xFFFF00AA,"Redbull costed 100$");
	                }
			return 1;
               }
I GOT THIS ERROR: error 030: compound statement not closed at the end of file (started at line 93)

This is line 93:
Код:
if(IsPlayerInRangeOfPoint(playerid, 1.5, 20.9480, 971.8395, 19.3522))
Reply
#2

Add a ; at the end.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     if (strcmp("/Redbull", cmdtext, true, 10) == 0)
     {
        if(IsPlayerInRangeOfPoint(playerid, 1.5, 20.9480, 971.8395, 19.3522));
        {
            if(GetPlayerMoney(playerid) >= 100)
            {
                GivePlayerMoney(playerid, -100);
                SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER );
                SendClientMessage(playerid, 0xFFFF00AA,"Redbull costed 100$");
            }
            else
            {
                    SendClientMessage(playerid, 0xFFFF00AA,"Redbull costed 100$");
                    }
            return 1;
               }
Reply
#3

Quote:
Originally Posted by SomebodyAndMe
Посмотреть сообщение
Add a ; at the end.
WHERE?
Reply
#4

if(IsPlayerInRangeOfPoint(playerid, 1.5, 20.9480, 971.8395, 19.3522)) <<<<< THERE
Reply
#5

Quote:
Originally Posted by SomebodyAndMe
Посмотреть сообщение
if(IsPlayerInRangeOfPoint(playerid, 1.5, 20.9480, 971.8395, 19.3522)) <<<<< THERE
it show me other error when put ; there:

error 036: empty statement
error 030: compound statement not closed at the end of file (started at line 93)
Reply
#6

CAn i see the whole code couse this what u show me isnt the whole code
Reply
#7

Quote:
Originally Posted by SomebodyAndMe
Посмотреть сообщение
CAn i see the whole code couse this what u show me isnt the whole code
Код:
#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" Blank Gamemode by your name here");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Script");
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	 if (strcmp("/Redbull", cmdtext, true, 10) == 0)
	 {
		if(IsPlayerInRangeOfPoint(playerid, 1.5, 20.9480, 971.8395, 19.3522))
		{
			if(GetPlayerMoney(playerid) >= 100)
			{
			    GivePlayerMoney(playerid, -100);
			    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER );
	   			SendClientMessage(playerid, 0xFFFF00AA,"Redbull costed 100$");
			}
			else
			{
  				SendClientMessage(playerid, 0xFFFF00AA,"Redbull costed 100$");
	        	}
			return 1;
		      }
Reply
#8

pawn Код:
{
     if (strcmp("/Redbull", cmdtext, true, 10) == 0)
     {
        if(IsPlayerInRangeOfPoint(playerid, 1.5, 20.9480, 971.8395, 19.3522))
        {
            if(GetPlayerMoney(playerid) >= 100)
            {
                GivePlayerMoney(playerid, -100);
                SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER );
                SendClientMessage(playerid, 0xFFFF00AA,"Redbull costed 100$");
            }
            else
            {
                SendClientMessage(playerid, 0xFFFF00AA,"Redbull costed 100$");
                }
            return 1;
            }
         return 1;
         }
     }
Try this one. I've not tested it so.
Reply
#9

Quote:
Originally Posted by SomebodyAndMe
Посмотреть сообщение
pawn Код:
{
     if (strcmp("/Redbull", cmdtext, true, 10) == 0)
     {
        if(IsPlayerInRangeOfPoint(playerid, 1.5, 20.9480, 971.8395, 19.3522))
        {
            if(GetPlayerMoney(playerid) >= 100)
            {
                GivePlayerMoney(playerid, -100);
                SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER );
                SendClientMessage(playerid, 0xFFFF00AA,"Redbull costed 100$");
            }
            else
            {
                SendClientMessage(playerid, 0xFFFF00AA,"Redbull costed 100$");
                }
            return 1;
            }
         return 1;
         }
     }
Try this one. I've not tested it so.
Still geting errors :/
Reply
#10

Quote:
Originally Posted by NitoPSG
Посмотреть сообщение
Still geting errors :/
Which errors?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)