Scripting Problem [error 76 and 29]
#1

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
Reply
#2

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

Best regards,
Jesse
Reply
#3

Код 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
Reply
#4

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
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)