What's wrong here..
#1

Hello. I have tried to do something but it gives me this error.
Here is what I did:
Код:
    // :
new myobject = CreateObject(18646,0,0,-1000,0,0,0,100);
AttachObjectToVehicle(myobject, GetPlayerVehicleID(playerid), 0.000000,0.824999,0.225000,0.000000,0.000000,0.000000);
It gives me the error about that "playerid"

Anyone can help me?
Reply
#2

Can you show the full compiler error,and the rest of the code these lines are located in?
Reply
#3

Код:
F:\Games\Game-Mode\RP\Roleplay 0.3x\gamemodes\rp.pwn(21528) : error 017: undefined symbol "playerid"
Код:
// :
	new myobject = CreateObject(18646,0,0,-1000,0,0,0,100);
	AttachObjectToVehicle(myobject, GetPlayerVehicleID(playerid), 0.000000,0.824999,0.225000,0.000000,0.000000,0.000000);
	//-----------Objects---------
	//Police Chiefs office
	CreateDynamicObject(2206,218.44000000,68.05000000,1004.00000000,0.00000000,0.00000000,0.00000000); //
	CreateDynamicObject(1715,218.81000000,69.68000000,1004.07000000,0.00000000,0.00000000,0.00000000); //
	CreateDynamicObject(1715,220.20000000,69.73000000,1004.07000000,0.00000000,0.00000000,0.00000000); //
	CreateDynamicObject(1714,219.41000000,66.52000000,1004.17000000,0.00000000,0.00000000,183.14000000); //
	CreateDynamicObject(2614,219.49000000,65.86000000,1006.62000000,0.00000000,0.00000000,182.06000000); //
	CreateDynamicObject(14885,190.86000000,41.45000000,1094.59000000,0.00000000,0.00000000,0.00000000); //
	CreateDynamicObject(2647,218.15000000,67.71000000,1005.10000000,0.00000000,0.00000000,0.00000000); //
	CreateDynamicObject(2690,221.47000000,65.83000000,1005.21000000,0.00000000,0.00000000,0.00000000); //
	CreateDynamicObject(2768,218.56000000,67.81000000,1005.00000000,0.00000000,0.00000000,0.00000000); //
	CreateDynamicObject(2775,219.39000000,72.45000000,1007.00000000,0.00000000,0.00000000,0.00000000); //
	CreateDynamicObject(2828,220.25000000,67.95000000,1005.00000000,0.00000000,0.00000000,153.88000000); //
	CreateDynamicObject(2610,217.17000000,72.56000000,1005.00000000,0.00000000,0.00000000,90.64000000); //
	CreateDynamicObject(2610,217.18000000,72.07000000,1005.00000000,0.00000000,0.00000000,90.64000000); //
	CreateDynamicObject(2610,217.17000000,71.58000000,1005.00000000,0.00000000,0.00000000,90.64000000); //
	CreateDynamicObject(2610,217.17000000,71.07000000,1005.00000000,0.00000000,0.00000000,90.64000000); //
	CreateDynamicObject(2617,218.52000000,71.36000000,1004.62000000,0.00000000,0.00000000,0.00000000); //
	CreateDynamicObject(2737,216.93000000,67.32000000,1006.00000000,0.00000000,0.00000000,88.85000000); //
	CreateDynamicObject(2855,220.03000000,72.02000000,1004.59000000,0.00000000,0.00000000,0.00000000); //
	CreateDynamicObject(2921,221.93000000,66.66000000,1006.89000000,0.00000000,0.00000000,327.66000000); //
	CreateDynamicObject(2921,225.73000000,68.98000000,1006.89000000,0.00000000,0.00000000,327.66000000); //
	CreateDynamicObject(2167,217.39000000,65.68000000,1004.05000000,0.00000000,0.00000000,181.62000000); //
	CreateDynamicObject(2254,221.86000000,67.82000000,1006.00000000,0.00000000,0.00000000,269.68000000); //
	CreateDynamicObject(2412,225.94000000,72.91000000,1004.02000000,0.00000000,0.00000000,91.48000000); //
Reply
#4

I mean,can you show where is this code located in?
Is it some function,or...?
If it's a function,that creates objects,for example ExampleFunction()
and if you declared it like ExampleFunction(); you need to make it like this then ExampleFunction(playerid);
If you had no playerid in the brackets,that's what would cause that error.

Just post the function where this is happening.
Reply
#5

There is no function I think.
Reply
#6

Well where are those lines of code located at?
Which callback,where are they?
I'm asking you to post it like this:
Код:
CODE WHERE THIS IS LOCATED AT

CODE YOU POSTED
But you posted like this
Код:
NO CODE WHERE THIS IS LOCATED

CODE YOU POSTED
Reply
#7

21527: new myobject = CreateObject(18646,0,0,-1000,0,0,0,100);
21528: AttachObjectToVehicle(myobject, GetPlayerVehicleID(playerid), 0.000000,0.824999,0.225000,0.000000,0.000000,0.000 000);
21529: //-----------Objects---------
//Police Chiefs office
21530:CreateDynamicObject(2206,218.44000000,68.050 00000,1004.00000000,0.00000000,0.00000000,0.000000 00); //
21531:CreateDynamicObject(1715,218.81000000,69.680 00000,1004.07000000,0.00000000,0.00000000,0.000000 00); //


Like this?
Reply
#8

No like this : (doesn't have to be OnPlayerConnect,i'm using this as an example)
Код:
public OnPlayerConnect(playerid)
{
	GameTextForPlayer(playerid,"~w~Grand Larceny",3000,4);
  	SendClientMessage(playerid,COLOR_WHITE,"Welcome to {88AA88}G{FFFFFF}rand {88AA88}L{FFFFFF}arceny");
  	
  	// class selection init vars
  	gPlayerCitySelection[playerid] = -1;
	gPlayerHasCitySelected[playerid] = 0;
	gPlayerLastCitySelectionTick[playerid] = GetTickCount();

	//SetPlayerColor(playerid,COLOR_NORMAL_PLAYER);

	//Kick(playerid);
	
	/*
	Removes vending machines
	RemoveBuildingForPlayer(playerid, 1302, 0.0, 0.0, 0.0, 6000.0);
	RemoveBuildingForPlayer(playerid, 1209, 0.0, 0.0, 0.0, 6000.0);
	RemoveBuildingForPlayer(playerid, 955, 0.0, 0.0, 0.0, 6000.0);
	RemoveBuildingForPlayer(playerid, 1775, 0.0, 0.0, 0.0, 6000.0);
	RemoveBuildingForPlayer(playerid, 1776, 0.0, 0.0, 0.0, 6000.0);
	*/
	
	/*
	new ClientVersion[32];
	GetPlayerVersion(playerid, ClientVersion, 32);
	printf("Player %d reports client version: %s", playerid, ClientVersion);*/

 	return 1;
}
But you posted just this part:
Код:
GameTextForPlayer(playerid,"~w~Grand Larceny",3000,4);
  	SendClientMessage(playerid,COLOR_WHITE,"Welcome to {88AA88}G{FFFFFF}rand {88AA88}L{FFFFFF}arceny");
  	
  	// class selection init vars
  	gPlayerCitySelection[playerid] = -1;
	gPlayerHasCitySelected[playerid] = 0;
	gPlayerLastCitySelectionTick[playerid] = GetTickCount();

	//SetPlayerColor(playerid,COLOR_NORMAL_PLAYER);

	//Kick(playerid);
	
	/*
	Removes vending machines
	RemoveBuildingForPlayer(playerid, 1302, 0.0, 0.0, 0.0, 6000.0);
	RemoveBuildingForPlayer(playerid, 1209, 0.0, 0.0, 0.0, 6000.0);
	RemoveBuildingForPlayer(playerid, 955, 0.0, 0.0, 0.0, 6000.0);
	RemoveBuildingForPlayer(playerid, 1775, 0.0, 0.0, 0.0, 6000.0);
	RemoveBuildingForPlayer(playerid, 1776, 0.0, 0.0, 0.0, 6000.0);
	*/
	
	/*
	new ClientVersion[32];
	GetPlayerVersion(playerid, ClientVersion, 32);
	printf("Player %d reports client version: %s", playerid, ClientVersion);*/
What i'm saying,post the place where the code is located too,not just those object creating lines.
Reply
#9

Код:
public LoadSBizz()
{
	new file[64];
	for(new idx = 0; idx < sizeof(SBizzInfo) ; idx++)
	{
	    format(file, sizeof(file),"LARP/SBizzes/%d.ini", idx);

		SBizzInfo[idx][sbOwned] = dini_Int(file,"Owned");
		strmid(SBizzInfo[idx][sbOwner], dini_Get(file,"Owner"), 0, strlen(dini_Get(file,"Owner")), 255);
		strmid(SBizzInfo[idx][sbMessage], dini_Get(file,"Message"), 0, strlen(dini_Get(file,"Message")), 255);
		strmid(SBizzInfo[idx][sbExtortion], dini_Get(file,"ExtortionBy"), 0, strlen(dini_Get(file,"ExtortionBy")), 255);
		SBizzInfo[idx][sbEntranceX] = dini_Float(file,"Entrance_X");
		SBizzInfo[idx][sbEntranceY] = dini_Float(file,"Entrance_Y");
		SBizzInfo[idx][sbEntranceZ] = dini_Float(file,"Entrance_Z");
		SBizzInfo[idx][sbLevelNeeded] = dini_Int(file,"LevelNeeded");
		SBizzInfo[idx][sbBuyPrice] = dini_Int(file,"Price");
		SBizzInfo[idx][sbEntranceCost] = dini_Int(file,"EntranceCost");
		SBizzInfo[idx][sbTill] = dini_Int(file,"Till");
		SBizzInfo[idx][sbLocked] = dini_Int(file,"Locked");
		SBizzInfo[idx][sbInterior] = dini_Int(file,"Interior");
		SBizzInfo[idx][sbProducts] = dini_Int(file,"Products");
		SBizzInfo[idx][sbMaxProducts] = dini_Int(file,"MaxProducts");
		SBizzInfo[idx][sbPriceProd] = dini_Int(file,"ProductPrice");
	}
	print("[SCRIPT]: Loaded S-Bizzes");
	return 1;
}
	// :
	new myobject = CreateObject(18646,0,0,-1000,0,0,0,100);
	AttachObjectToVehicle(myobject, GetPlayerVehicleID(playerid), 0.000000,0.824999,0.225000,0.000000,0.000000,0.000000);
Reply
#10

That script looks really old... I mean it's using DINI for crying out loud.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)