error 029: invalid expression, assumed zero
#1

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

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

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.
Reply
#4

What is wrong with these two functions?

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

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

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)