SA-MP Forums Archive
Scripting Problem [error 76 and 29] - 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: Scripting Problem [error 76 and 29] (/showthread.php?tid=346524)



Scripting Problem [error 76 and 29] - Josh_Main - 28.05.2012

I need to fix these quick, please help

Код HTML:
				UpdateMoneyBar(i,GetPVarInt(i, "Cash"));
Im getting these errors:
error 076: syntax error in the expression, or invalid function call
error 029: invalid expression, assumed zero


Re: Scripting Problem [error 76 and 29] - jessejanssen - 28.05.2012

Since 'UpdateMoneyBar' isn't a default include I cannot help you unless more information is given. ( Such as the function. )

Best regards,
Jesse


Re: Scripting Problem [error 76 and 29] - Josh_Main - 28.05.2012

Код HTML:
Timer:MoneyUpdate[1000]()
{
	new hour,minuite,second;
	gettime(hour,minuite,second);
	FixHour(hour);
	hour = shifthour;
	new tstring[7];
	if(minuite < 10)
	{
		format(tstring, sizeof(tstring), "%d:0%d", hour, minuite);
	}
	else
	{
		format(tstring, sizeof(tstring), "%d:%d", hour, minuite);
	}
	TextDrawSetString(WristWatch, tstring);


	foreach(Player, i)
	{
		SyncPlayerTime(i);
		if(gPlayerLogged{i})
		{
		    if(GetPlayerPing(i) > MAX_PING)
		    {
		        if(playerTabbed[i] != 1)
		        {
					new
						string[89 + MAX_PLAYER_NAME];

		            format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just been kicked for %d ping (maximum: "#MAX_PING").", GetPlayerNameEx(i), GetPlayerPing(i));
					ABroadCast(COLOR_YELLOW, string, 2);
		        	SendClientMessageEx(i, COLOR_WHITE, "You have been kicked because your ping is higher than the maximum.");
		        	Kick(i);
				}
		    }

		    if(PlayerInfo[i][pTempVIP] >= 1)
			{
				PlayerInfo[i][pTempVIP]--;
    		}

		    if(PlayerInfo[i][pTempVIP] <= 0 && PlayerInfo[i][pBuddyInvited] == 1)
   			{
				PlayerInfo[i][pTempVIP] = 0;
				PlayerInfo[i][pBuddyInvited] = 0;
    			PlayerInfo[i][pDonateRank] = 0;
				SendClientMessageEx(i, COLOR_LIGHTBLUE, "Your temporary VIP subscription has expired.");
				SetPlayerToTeamColor(i);
     		}
			if(PlayerInfo[i][pTriageTime] != 0)
	  		{
				PlayerInfo[i][pTriageTime]--;
    		}
			if(PlayerInfo[i][pTicketTime] != 0)
			{
				PlayerInfo[i][pTicketTime]--;
			}
			if(PlayerInfo[i][pServiceTime] != 0)
			{
			    PlayerInfo[i][pServiceTime]--;
			}
			if(GetPlayerCash(i) != GetPlayerMoney(i))
			{
				ResetMoneyBar(i);
				UpdateMoneyBar(i,GetPVarInt(i, "Cash"));
			}
			if(GetPVarInt(i, "gpsonoff") == 1)
   			{
    			new zone[28];
				GetPlayer2DZone(i, zone, MAX_ZONE_NAME);
				TextDrawSetString(GPS[i], zone);
			}
			if(GetPVarInt(i, "fuelonoff") == 1)
   			{
	     		if(IsPlayerInAnyVehicle(i))
	     		{
	     		    SetProgressBarValue(FuelBar[i], VehicleFuel[GetPlayerVehicleID(i)]);
	     		    UpdateProgressBar(FuelBar[i], i);
	     		}
	     		else
	     		{
	     		    DeletePVar(i, "fuelonoff");
		   		    DestroyProgressBar(FuelBar[i]);
	     		    textdrawscount--;
		   		    FuelBar[i] = INVALID_BAR_ID;
		   		}
			}
		}
	}
}

// Timer Name: SpecUpdate()
// TickRate: 3 secs.
Код HTML:
#define UpdateMoneyBar GivePlayerMoney 7000000
If thats helps


Re: Scripting Problem [error 76 and 29] - jessejanssen - 29.05.2012

Quote:
Originally Posted by Josh_Main
Посмотреть сообщение
Код HTML:
Timer:MoneyUpdate[1000]()
{
	new hour,minuite,second;
	gettime(hour,minuite,second);
	FixHour(hour);
	hour = shifthour;
	new tstring[7];
	if(minuite < 10)
	{
		format(tstring, sizeof(tstring), "%d:0%d", hour, minuite);
	}
	else
	{
		format(tstring, sizeof(tstring), "%d:%d", hour, minuite);
	}
	TextDrawSetString(WristWatch, tstring);


	foreach(Player, i)
	{
		SyncPlayerTime(i);
		if(gPlayerLogged{i})
		{
		    if(GetPlayerPing(i) > MAX_PING)
		    {
		        if(playerTabbed[i] != 1)
		        {
					new
						string[89 + MAX_PLAYER_NAME];

		            format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just been kicked for %d ping (maximum: "#MAX_PING").", GetPlayerNameEx(i), GetPlayerPing(i));
					ABroadCast(COLOR_YELLOW, string, 2);
		        	SendClientMessageEx(i, COLOR_WHITE, "You have been kicked because your ping is higher than the maximum.");
		        	Kick(i);
				}
		    }

		    if(PlayerInfo[i][pTempVIP] >= 1)
			{
				PlayerInfo[i][pTempVIP]--;
    		}

		    if(PlayerInfo[i][pTempVIP] <= 0 && PlayerInfo[i][pBuddyInvited] == 1)
   			{
				PlayerInfo[i][pTempVIP] = 0;
				PlayerInfo[i][pBuddyInvited] = 0;
    			PlayerInfo[i][pDonateRank] = 0;
				SendClientMessageEx(i, COLOR_LIGHTBLUE, "Your temporary VIP subscription has expired.");
				SetPlayerToTeamColor(i);
     		}
			if(PlayerInfo[i][pTriageTime] != 0)
	  		{
				PlayerInfo[i][pTriageTime]--;
    		}
			if(PlayerInfo[i][pTicketTime] != 0)
			{
				PlayerInfo[i][pTicketTime]--;
			}
			if(PlayerInfo[i][pServiceTime] != 0)
			{
			    PlayerInfo[i][pServiceTime]--;
			}
			if(GetPlayerCash(i) != GetPlayerMoney(i))
			{
				ResetMoneyBar(i);
				UpdateMoneyBar(i,GetPVarInt(i, "Cash"));
			}
			if(GetPVarInt(i, "gpsonoff") == 1)
   			{
    			new zone[28];
				GetPlayer2DZone(i, zone, MAX_ZONE_NAME);
				TextDrawSetString(GPS[i], zone);
			}
			if(GetPVarInt(i, "fuelonoff") == 1)
   			{
	     		if(IsPlayerInAnyVehicle(i))
	     		{
	     		    SetProgressBarValue(FuelBar[i], VehicleFuel[GetPlayerVehicleID(i)]);
	     		    UpdateProgressBar(FuelBar[i], i);
	     		}
	     		else
	     		{
	     		    DeletePVar(i, "fuelonoff");
		   		    DestroyProgressBar(FuelBar[i]);
	     		    textdrawscount--;
		   		    FuelBar[i] = INVALID_BAR_ID;
		   		}
			}
		}
	}
}

// Timer Name: SpecUpdate()
// TickRate: 3 secs.
Код HTML:
#define UpdateMoneyBar GivePlayerMoney 7000000
If thats helps
That doesn't really help, I need the 'UpdateMoneyBar' function.

Best regards,
Jesse


Re: Scripting Problem [error 76 and 29] - SuperViper - 29.05.2012

If this is supposed to set the player's money, use this:

pawn Код:
#define UpdateMoneyBar(%0, %1) \
    ResetPlayerMoney(%0); \
    GivePlayerMoney(%0, %1)