Not getting pos properly..
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You're trying to get the position from a vehicle that does not exist because currentveh is 0 and you haven't assigned the currect vehicleid.
pawn Код:
new v = pInfo[playerid][VehicleOwner], currentveh = GetPlayerVehicleID(playerid), string[128];
Tip: use %f to print floats if you want the decimal places too to be printed.
Also, when a player buys a newly spawned vehicle it says they're not a cop to enter it.. I've already defined my LeoVeh's 50 of them infact.. heres some code..

Код:
	if(vehicleid == LEOveh[0] || LEOveh[1] || LEOveh[2] || LEOveh[3] || LEOveh[4] || LEOveh[5] || LEOveh[6] || LEOveh[7] || LEOveh[8] || LEOveh[9] || LEOveh[10] || LEOveh[11] || LEOveh[12] || LEOveh[13] || LEOveh[14] || LEOveh[15] || LEOveh[16] || LEOveh[17] || LEOveh[18] || LEOveh[19] || LEOveh[20] || LEOveh[21] || LEOveh[22] || LEOveh[23] || LEOveh[24] || LEOveh[25] || LEOveh[26] || LEOveh[27] || LEOveh[28] || LEOveh[29] || LEOveh[30] || LEOveh[31] || LEOveh[32] || LEOveh[33] || LEOveh[34] || LEOveh[35])
			{
			    if(pInfo[playerid][Faction] != 1)
				{
					SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER:{FFFFFF} You need to be a police officer in order to operate this vehicle!");
				    RemovePlayerFromVehicle(playerid);
				}
			}
MY CREATE VEHICLE AFTER BUY:

Код:
stock CreatePlayerVehicle(playerid, model)
{
	new pname[30], file[64], playercar, v;
	GetPlayerName(playerid, pname, sizeof(pname));

	playercar = CreateVehicle(model, 170.8668, -16.1531, 1.5781, 220.7102, random(5), random(5), -1);
	PutPlayerInVehicle(playerid, playercar, 0);
	
	new INI:File = INI_Open(VehiclePath(v));

	vInfo[v][ModelID] = model;
    vInfo[v][NrPlate] = "DT-0000-RP";
    vInfo[v][Owner] = pname;

	vInfo[v][posX] = 170.8668;
	vInfo[v][posY] = -16.1531;
	vInfo[v][posZ] = 1.5781;
	vInfo[v][posA] = 220.7102;

	vInfo[v][ColorA] = random(50);
	vInfo[v][ColorB] = random(50);

	vInfo[v][Locked] = 1;

	INI_Close(File);

	format(file, 64, "Vehicles/%d.ini", v);

	if(fexist(file))
    {
        INI_ParseFile(VehiclePath(v), "LoadVehicleData", false, true, v, true, false );
	}

	SaveVehicles();

	pInfo[playerid][VehicleOwner] = playercar;
	vEngine[playercar] = 1;

	return 1;
}
Reply


Messages In This Thread
Not getting pos properly.. - by izeatfishz - 11.04.2015, 14:09
Re: Not getting pos properly.. - by Konstantinos - 11.04.2015, 14:12
Re: Not getting pos properly.. - by izeatfishz - 11.04.2015, 14:18
Re: Not getting pos properly.. - by Konstantinos - 11.04.2015, 14:24
Re: Not getting pos properly.. - by izeatfishz - 11.04.2015, 14:33
Re: Not getting pos properly.. - by Konstantinos - 11.04.2015, 14:38
Re: Not getting pos properly.. - by izeatfishz - 11.04.2015, 14:39
Re: Not getting pos properly.. - by Konstantinos - 11.04.2015, 14:45

Forum Jump:


Users browsing this thread: 1 Guest(s)