[HELP] Dynamic Enters, Icon not Showing [Solved]
#1

Main Code:
Код:
new idCounter = 0;

enum Enters
{
	PICKUPID,
	Float:ENTERX,
	Float:ENTERY,
	Float:ENTERZ,
	UNIVERSEID,
	Float:INTX,
	Float:INTY,
	Float:INTZ,
};

new EnterSigns[256][Enters];

NewEnter(playerid, Float:x, Float:y, Float:z, universeID, Float:newX, Float:newY, Float:newZ){
	idCounter = 0;
	while(EnterSigns[idCounter][UNIVERSEID] != 0 && idCounter != 256){
		idCounter++;
	}
	if(idCounter == 256){
		SendClientMessage(playerid,COLOR_WHITE,"Maximum number of enter locations hit!");
	}
	else{
	  new aString[128];
   	EnterSigns[idCounter][PICKUPID] = CreatePickup(19,1239,x,y,z);
    EnterSigns[idCounter][ENTERX] = x;
    EnterSigns[idCounter][ENTERY] = y;
	  EnterSigns[idCounter][ENTERZ] = z;
	  EnterSigns[idCounter][UNIVERSEID] = universeID;
	  EnterSigns[idCounter][INTX] = newX;
	  EnterSigns[idCounter][INTY] = newY;
	  EnterSigns[idCounter][INTZ] = newZ;
		format(aString,sizeof(aString),"Enter point from %f, %f, %f to Universe %i: %f, %f, %f with ID %i.",EnterSigns[idCounter][ENTERX],EnterSigns[idCounter][ENTERY],EnterSigns[idCounter][ENTERZ],EnterSigns[idCounter][UNIVERSEID],EnterSigns[idCounter][INTX],EnterSigns[idCounter][INTY],EnterSigns[idCounter][INTZ],idCounter);
		SendClientMessage(playerid,COLOR_WHITE,aString);
	}
}
The variables playerX, playerY, and playerZ are picked up earlier. They are correct.

I have a problem with this code. Although it's not implemented yet, it should at least create an information icon at the spot where the player's standing. It doesn't. Everything else in the code works perfectly, as I've tested with the client callback. The only problem is that the icon doesn't appear. To clarify - this is a script for creating dynamic enter locations to various places (you know, in those servers that have you type '/enter' to enter a building etc.). This is just the first part of the script; I'm going to later add functions such as SaveEnters etc. Except the bladdy icons don't show up. Can anyone help?
Reply
#2

So where is the CreatePickup?
Reply
#3

Quote:
EnterSigns[idCounter][0] = CreatePickup(19,1239,Float,Float:y,Float:z);
Reply
#4

Ah ok, missed it.
But you mixed up the model and the type.

Код:
CreatePickup(1239, 19, x, y, z);
Reply
#5

There were actually two problems. Originally I was using an array rather than an enum, which gave me a tag mismatch that messed up the location of the icon because it was an entirely int array rather than being mixed - I was confused as to the nature of the language; I'm used to either Jscript or C++, and I thought that aspect was closer to Jscript than C++, which I was wrong with. That would have caused problems later on, but Limex (AKA Ash, owner of True Roleplay) helped me out with that before he noticed the error Vince just pointed out. The actual problem was the one Vince pointed out, but the other error needed spotting too. Thanks to all involved, especially Limex and Vince.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)