PVar problem....
#1

Hello scripter. So i have a /mycar command, with puts you in your locked vehicle, and i have a export system.
What i was trying to do was, so that if a players locked car is exportable, then u can't use the command /mycar....
It's all based on PVars. Let me show you.

MYCAR command:
Код:
dcmd_mycar(playerid,params[])
{
    #pragma unused params
    new veh[MAX_PLAYERS];
	veh[playerid] = GetPlayerVehicleID(playerid);
	new ExportCarID1[MAX_PLAYERS];
   	new ExportCarID2[MAX_PLAYERS];
   	new ExportCarID3[MAX_PLAYERS];
   	new LockedCarModel[MAX_PLAYERS];
   	LockedCarModel[playerid] = GetVehicleModel(LockedCar[playerid]);
   	ExportCarID1[playerid] = GetPVarInt(playerid,"ExportCar1");
   	ExportCarID2[playerid] = GetPVarInt(playerid,"ExportCar2");
   	ExportCarID3[playerid] = GetPVarInt(playerid,"ExportCar3");
	new Float:X,Float:Y,Float:Z,Float:Angle,interior;
	if(GetPlayerScore(playerid) < 3) return SendClientMessage(playerid, GREY, "ERROR: You need 3rd level.");
    if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, GREY, "ERROR: You have to be on foot to use this.");
	if(LockedCar[playerid] == ExportCarID1[playerid] || LockedCar[playerid] == ExportCarID2[playerid] || LockedCar[playerid] == ExportCarID3[playerid]) return SendClientMessage(playerid, GREY, "ERROR: your locked car is on the export list, so u can't use this!");
    if(HasACarLocked[playerid] == 0) return SendClientMessage(playerid, GREY, "ERROR: You havent locked any car!");
	GetPlayerPos(playerid, X,Y,Z);
	GetPlayerFacingAngle(playerid,Angle);
	interior = GetPlayerInterior(playerid);
	SetVehiclePos(LockedCar[playerid], X,Y,Z);
	LinkVehicleToInterior(LockedCar[playerid],interior);
	SetVehicleZAngle(LockedCar[playerid],Angle);
	PutPlayerInVehicle(playerid, LockedCar[playerid], 0);
	return 1;
}
Now here's the part where export system saves the PVar's:
This is a 1sec timer....

Код:
public ScanVehicleStatus()
{
	for (new i = 0; i < MAX_PLAYERS; i++)
   	{
   	if(IsPlayerInAnyVehicle(i))
   	{
   	new carmodel = GetVehicleModel(GetPlayerVehicleID(i));
	if (carmodel == carselect[0] || carmodel == carselect[1] || carmodel == carselect[2])
 	{
  	MiniMission[i] = CHECKPOINT_EXPORT;
  	}
    }
   	}
	for (new i = 0; i < MAX_PLAYERS; i++)
   	{
   	SetPVarInt(i,"ExportCar1",carselect[0]);
   	SetPVarInt(i,"ExportCar2",carselect[1]);
   	SetPVarInt(i,"ExportCar3",carselect[2]);
   	}
   	return 1;
}
When i'm in a exportable vehicle and i type /mycar, it doesnt show the error message, it just puts me itn to the exportable car.

Help would be very epriciated.
Reply
#2

And what's the problem?
Reply
#3

When i'm in a exportable vehicle and i type /mycar, it doesnt show the error message, it just puts me itn to the exportable car.
Reply
#4

Guys, i really need help on this. :/
Reply
#5

Please help...
Reply
#6

did you put the #DEFINE COLORS?
Reply
#7

I'm not that stupid u know.

For some reason it just doesnt save the exportable car's id.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)