Fatal Errors, Mystery to All [HELP]
#1

Код:
NewEnter(playerid, Float:x, Float:y, Float:z, universeID, Float:newX, Float:newY, Float:newZ){
	idCounter = 0;
	while(EnterSigns[idCounter][UNIVERSEID] != 9999 && idCounter != MAXENTERS){
		idCounter++;
	}
	if(idCounter == MAXENTERS && playerid != -1){
		SendClientMessage(playerid,COLOR_WHITE,"Maximum number of enter locations hit!");
	}
	else{
	  new aString[128];
   	EnterSigns[idCounter][PICKUPID] = CreatePickup(1239,23,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;
	  if(playerid != -1){
		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);
		}
	}
	idCounter = 0;
}
Works 100% correctly. It gives me the right entrance in the right place to the right area, and combined with my enter/exit scripts, lets me enter and exit buildings however I like. That's not the problem. The problem, compadrйs, is this:

Код:
NewVehicle(playerid, modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2){
	idCounter = 0;
	while(Vehicles[idCounter][MODELID] != 9999 && idCounter != MAXVEHICLES){
		idCounter++;
	}
	if(idCounter == MAXVEHICLES && playerid != -1){
		SendClientMessage(playerid,COLOR_WHITE,"Maximum number of vehicles hit!");
	}
	else{
	  new aString[128];
   	Vehicles[idCounter][VEHICLEID] = CreateVehicle(modelid, x, y, z, angle, color1, color2, 1200);
    Vehicles[idCounter][X] = x;
    Vehicles[idCounter][Y] = y;
	  Vehicles[idCounter][Z] = z;
	  Vehicles[idCounter][ANGLE] = angle;
	  Vehicles[idCounter][COLOR1] = color1;
	  Vehicles[idCounter][COLOR2] = color2;
	  if(playerid != -1){
		format(aString,sizeof(aString),"ID: %i, SLOT: %i",Vehicles[idCounter][VEHICLEID],idCounter);
		SendClientMessage(playerid,COLOR_WHITE,aString);
		}
	}
}
It has exactly the same form as the other script and compiles perfectly. All arrays etc. pertinent are initialised correctly. But when I call it from my command '/spawnveh', which is correct in all ways, I get an INVALID COMMAND error from the server. The problem can be traced to this section in the while loop declaration, which should be fine:

Код:
Vehicles[idCounter][MODELID] != 9999
And this is but the start of my woes. Ideally, all these functions would be declared as publics, with fowards. But when I use this code:

Код:
foward Blah();

public Blah(){
}
I get these errors from the compiler, for no reason. My friend compiles the same code perfectly.

Код:
error 010: invalid function or declaration
warning 235: public function lacks forward declaration (symbol "Blah")
HELP ME, OR I MAY DO SOMETHING HORRIFIC!
Reply


Messages In This Thread
Fatal Errors, Mystery to All [HELP] - by Delphinus - 28.06.2009, 23:59
Re: Fatal Errors, Mystery to All [HELP] - by yezizhu - 29.06.2009, 02:21
Re: Fatal Errors, Mystery to All [HELP] - by Delphinus - 29.06.2009, 17:02
Re: Fatal Errors, Mystery to All [HELP] - by [nl]daplayer - 29.06.2009, 17:07
Re: Fatal Errors, Mystery to All [HELP] - by Delphinus - 29.06.2009, 17:26
Re: Fatal Errors, Mystery to All [HELP] - by yezizhu - 30.06.2009, 00:37
Re: Fatal Errors, Mystery to All [HELP] - by Delphinus - 30.06.2009, 01:25
Re: Fatal Errors, Mystery to All [HELP] - by yezizhu - 30.06.2009, 18:45

Forum Jump:


Users browsing this thread: 2 Guest(s)