03.01.2011, 09:12
Hey guys, so I got the problem:
when i use the command /v lock i always get that i need to get closer to my vehicle, the command is:
I load vehicles with the command LoadVehicle(playerid), here it is:
I have static vehicles too, made with AddStaticVehicleEx on GameModeInit, and the thing is, that when i type /v lock i got you must get closer which means i am not close enough to my vehicle, BUT when i go to the police car, and its the 1st AddStaticVehicleEx on GameModeInit, i get the "!" which means it should be my vehicle. So what the? I dont know, maybe the vehicleids mixed up or something. I even made a small debug code, so when i am near that police vehicle i get that "vehicleid: 1 owner: Billy_Mace" <- thats me. Its very strange. And i dont really know how to fix this? Could please some one help me? Or is there other way of loading a vehicle and assigning it to a player?
OH AND BTW, the vehicle loads perfectly from the file, with the color, and position and the model even with right numbers on the number plate. So any ideas?
when i use the command /v lock i always get that i need to get closer to my vehicle, the command is:
pawn Код:
new vehid = GetPlayerVehicleId(playerid);
new Float:X,Float:Y,Float:Z;
GetVehiclePos(vehid,X,Y,Z);
if(IsPlayerInRangeOfPoint(playerid,2,X,Y,Z))
{
SendClientMessage(playerid,CLR_GREY,"!");
printf("%d %s",vehid,carDB[vehid][cOwner]);
} else
{
SendClientMessage(playerid,CLR_GREY,"You need to get closer to your vehicle.");
printf("%d %s",vehid,carDB[vehid][cOwner]);
}
return 1;
pawn Код:
new file[70];
format(file,sizeof(file),"*******/vehicles/%s.ini",playerDB[playerid][name]);
new vehid = SetVehicleNumberPlate(CreateVehicle(dini_Int(file,"model"),
dini_Float(file,"x"),
dini_Float(file,"y"),
dini_Float(file,"z"),
dini_Float(file,"a"),
dini_Int(file,"color1"),
dini_Int(file,"color2"),
0), dini_Get(file,"number"));
format(carDB[vehid][cOwner],MAX_PLAYER_NAME,"%s",dini_Get(file,"owner"));
carDB[vehid][cLocked] = 1;
carDB[vehid][cParked] = 0;
carDB[vehid][cColorOne] = dini_Int(file,"color1");
carDB[vehid][cColorTwo] = dini_Int(file,"color2");
format(carDB[vehid][cNumber],9,"%s",dini_Get(file,"number"));
OH AND BTW, the vehicle loads perfectly from the file, with the color, and position and the model even with right numbers on the number plate. So any ideas?


