[Help]2 Errors Must Be Simple For Experts
#1

Well guys im a beginer and ive tried all i know and i cant fix this erors i know is probly dumb but im still learning can someone tell me how to fix it please

Error im getting
Код:
C:\Users\Noxiouz\Desktop\szr.pwn(9164) : error 010: invalid function or declaration
C:\Users\Noxiouz\Desktop\szr.pwn(9167) : error 054: unmatched closing brace ("}")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Code Im Usin
Код:
		if(PlayerInfo[playerid][pHouseCarX] != 0 && PlayerInfo[playerid][pHouseCarY] != 0)
		{
			LoadHouseCars(playerid);
		}

public LoadHouseCars(playerid)
{
	new Float:Carx = PlayerInfo[playerid][pHouseCarX];
	new Float:Cary = PlayerInfo[playerid][pHouseCarY];
	new Float:Carz = PlayerInfo[playerid][pHouseCarZ];
	new Float:Carangle = PlayerInfo[playerid][pHouseCarAngle];
	new CarId = PlayerInfo[playerid][pHouseCarId];
	
	if(PlayerInfo[playerid][pHouseCarColorChosen] == 0) // Random color
	{
	new randcolor = 1 + random(125);
	playercarid[playerid] = CreateVehicle(CarId,Carx,Cary,Carz,Carangle,randcolor,randcolor,10000);
	}
	
	else if(PlayerInfo[playerid][pHouseCarColorChosen] == 1) // bought colors
	{
	new color1 = PlayerInfo[playerid][pHouseCarColor1];
	new color2 = PlayerInfo[playerid][pHouseCarColor2];
	playercarid[playerid] = CreateVehicle(CarId,Carx,Cary,Carz,Carangle,color1,color2,10000);
	}
	
 	for (new i=0; i<MAX_POINTS; i++)
	{
	  new cartolock = playercarid[playerid];
	  SetVehicleParamsForPlayer(cartolock,i,0,0);
	  PlayerInfo[playerid][pHouseCarLocked] = 0; // unlocked
	}
	return 1;
}
can Some one please help me ? Thanks
Reply
#2

Doesn't look like you're showing us the correct part of the code.

From what I see though it looks like your function LoadHouseCars is out of place and is located within another function/callback... where it shouldn't be.
Reply
#3

so what you are trying to say is that this code is allready in use kinda?
so i have to remove the old one and see what happens? well the 2 error lines r this
Код:
   	if(PlayerInfo[playerid][pHouseCarX] != 0 && PlayerInfo[playerid][pHouseCarY] != 0)
	{
		LoadHouseCars(playerid);
	}
i just put the whole code before to make sure everything was right so can you please give me an idea or if you know the Problem
Reply
#4

Quote:
Originally Posted by Onyx09
Well guys im a beginer and ive tried all i know and i cant fix this erors i know is probly dumb but im still learning can someone tell me how to fix it please

Error im getting
Код:
C:\Users\Noxiouz\Desktop\szr.pwn(9164) : error 010: invalid function or declaration
C:\Users\Noxiouz\Desktop\szr.pwn(9167) : error 054: unmatched closing brace ("}")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Code Im Usin
Код:
		if(PlayerInfo[playerid][pHouseCarX] != 0 && PlayerInfo[playerid][pHouseCarY] != 0)
		{
			LoadHouseCars(playerid);
		}

public LoadHouseCars(playerid)
{
	new Float:Carx = PlayerInfo[playerid][pHouseCarX];
	new Float:Cary = PlayerInfo[playerid][pHouseCarY];
	new Float:Carz = PlayerInfo[playerid][pHouseCarZ];
	new Float:Carangle = PlayerInfo[playerid][pHouseCarAngle];
	new CarId = PlayerInfo[playerid][pHouseCarId];
	
	if(PlayerInfo[playerid][pHouseCarColorChosen] == 0) // Random color
	{
	new randcolor = 1 + random(125);
	playercarid[playerid] = CreateVehicle(CarId,Carx,Cary,Carz,Carangle,randcolor,randcolor,10000);
	}
	
	else if(PlayerInfo[playerid][pHouseCarColorChosen] == 1) // bought colors
	{
	new color1 = PlayerInfo[playerid][pHouseCarColor1];
	new color2 = PlayerInfo[playerid][pHouseCarColor2];
	playercarid[playerid] = CreateVehicle(CarId,Carx,Cary,Carz,Carangle,color1,color2,10000);
	}
	
 	for (new i=0; i<MAX_POINTS; i++)
	{
	  new cartolock = playercarid[playerid];
	  SetVehicleParamsForPlayer(cartolock,i,0,0);
	  PlayerInfo[playerid][pHouseCarLocked] = 0; // unlocked
	}
	return 1;
}
can Some one please help me ? Thanks
Would be nice if you said which lines are 9164 and 9167 because we can't see that.
Reply
#5

This is the 2 Error Lines
Код:
   	if(PlayerInfo[playerid][pHouseCarX] != 0 && PlayerInfo[playerid][pHouseCarY] != 0)
	{
		LoadHouseCars(playerid);
	}
Reply
#6

Quote:
Originally Posted by Onyx09
This is the 2 Error Lines
Код:
   	if(PlayerInfo[playerid][pHouseCarX] != 0 && PlayerInfo[playerid][pHouseCarY] != 0)
	{
		LoadHouseCars(playerid);
	}
Have you placed pHouseCarx and pHouseCarY under enum pInfo or whatever it is in your script?
Example:
Quote:

enum pInfo
{
pKey[128],
pLevel,
pAdmin,
pDonateRank,
gPupgrade,
pConnectTime,
pReg,
pSex,
pAge,
pOrigin,
pCK,
pMuted,
pExp,
pCash,
pAccount,
Here comes more!!!!!
pHouseCarY
pHouseCarX
};
new PlayerInfo[MAX_PLAYERS][pInfo];

Reply
#7

yes i allready added that part and the problem still shows
Reply
#8

Quote:
Originally Posted by Onyx09
yes i allready added that part and the problem still shows
But what is this supposed to do??
Reply
#9

Well this is suppost to Call back The players House On player login
because right now even if they own a house and they try to go in the server
and do /home or any house commands it says they dont own any houses
Reply
#10

Ok I think I know what your problem is... You said this in your player login section right?

Well copy and paste your whole public OnPlayerLogin section: (Looks like this)

public OnPlayerLogin()
{
...
...
...
return 1;
}
if your lines are after the return1; then you totally placed them wrong... get what I mean?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)