SA-MP Forums Archive
I am getting this error, whats wrong? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I am getting this error, whats wrong? (/showthread.php?tid=249702)



I am getting this error, whats wrong? - NitoPSG - 20.04.2011

Код:
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))



Re: I am getting this error, whats wrong? - SomebodyAndMe - 20.04.2011

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



Re: I am getting this error, whats wrong? - NitoPSG - 20.04.2011

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


Re: I am getting this error, whats wrong? - SomebodyAndMe - 20.04.2011

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


Re: I am getting this error, whats wrong? - NitoPSG - 20.04.2011

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)


Re: I am getting this error, whats wrong? - SomebodyAndMe - 20.04.2011

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


Re: I am getting this error, whats wrong? - NitoPSG - 20.04.2011

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



Re: I am getting this error, whats wrong? - SomebodyAndMe - 20.04.2011

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.


Re: I am getting this error, whats wrong? - NitoPSG - 20.04.2011

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 :/


Re: I am getting this error, whats wrong? - nuriel8833 - 20.04.2011

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