SA-MP Forums Archive
error 029: invalid expression, assumed zero - 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: error 029: invalid expression, assumed zero (/showthread.php?tid=663605)



error 029: invalid expression, assumed zero - Proxus - 06.02.2019

I have a problem where it shows this error:

Код:
error 029: invalid expression, assumed zero
This is my code for this:
Код:
public OnPlayerUpdate(playerid)
{
	new WantedLevel;

	WantedLevel = GetPlayerWantedLevel(playerid);
	if WantedLevel > 0
 	{
		new Text3D:PlayerLabel[MAX_PLAYERS];
		PlayerLabel[playerid] = CreateDynamic3DTextLabel("test", COLOR_RED, 0.0, 0.0, 0.0, 20.0, 0, 1);
		Attach3DTextLabelToPlayer(PlayerLabel[playerid], playerid, 0.0, 0.0, 0.3);
	}
}
I am using the Streamer plugin so CreateDynamic3DTextLabel is valid.

Thanks in advance.


Re: error 029: invalid expression, assumed zero - TheToretto - 06.02.2019

Код:
if(WantedLevel > 0)
{
}
Put the conditions for the if statement between brackets.


Re: error 029: invalid expression, assumed zero - Proxus - 06.02.2019

I compiled it earlier, fixing that. Thanks though because that was a stupid mistake of mine. However, it doesn't show it above people's heads. Tested with 2 players.


Re: error 029: invalid expression, assumed zero - Pottus - 06.02.2019

What is wrong with these two functions?

Код:
CreateDynamic3DTextLabel()
Attach3DTextLabelToPlayer()
Looks like a dog trying to mate with a cat.


Re: error 029: invalid expression, assumed zero - TheToretto - 06.02.2019

You are using the streamer plugin, so one line will be sufficient to both, create the Label and attach it to whatever you'd like. There's the syntax:

Код:
CreateDynamic3DTextLabel(const text[], color, Float:x, Float:y, Float:z, Float:drawdistance,  attachedplayer = INVALID_PLAYER_ID, attachedvehicle = INVALID_VEHICLE_ID, testlos = 0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
Replace INVALID_PLAYER_ID by playerid.

btw the dog is streamer and the cat is a_samp in that case


Re: error 029: invalid expression, assumed zero - Proxus - 07.02.2019

Oh I see. I implemented the Streamer plugin yesterday and didn't realise the params were different. Thanks for your help!

Edit: I +repped you both for your help. Thanks!