if(!strcmp(cmd, "/parkcar", true)) { if(!dini_Int(GetFile(playerid), "HaveCar")) return SendClientMessage(playerid,red,"You dont have car"); if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You are not in a car"); if(vehicleid != CarID(playerid)) return SendClientMessage(playerid,red,".This is not your car"); new Float:X,Float:Y,Float:Z,Float:A; GetVehiclePos(vehicleid, X, Y, Z); GetVehicleZAngle(vehicleid, A); dini_FloatSet(VFile(vehicleid), "ParkX", X); dini_FloatSet(VFile(vehicleid), "ParkY", Y); dini_FloatSet(VFile(vehicleid), "ParkZ", Z); dini_FloatSet(VFile(vehicleid), "ParkA", A); SetVehicleToRespawn(vehicleid); SendClientMessage(playerid,lgreen,".You parked your car"); return 1; }
if(dini_Float(VFile(vehicleid), "ParkX")) { SetVehiclePos(vehicleid, dini_Float(VFile(vehicleid), "ParkX"), dini_Float(VFile(vehicleid), "ParkY"), dini_Float(VFile(vehicleid), "ParkZ")); SetVehicleZAngle(vehicleid, dini_Float(VFile(vehicleid), "ParkA")); }
Why don't you just create the vehicle in that part of the code instead of setting the position?
|
its my vehicle system, i made /buycar command then i made that parkcar command so people could park the car in the place they want it to be..
|
VehicleInfo[vehicleid][ParkX]
Do you have enum variables that you store the information in?
Example: Код:
VehicleInfo[vehicleid][ParkX] |
if(!strcmp(cmd, "/parkcar", true))
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(!dini_Int(GetFile(playerid), "HaveCar")) return SendClientMessage(playerid,red,"You dont have car");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You are not in a car");
if(vehicleid != CarID(playerid)) return SendClientMessage(playerid,red,".This is not your car");
new Float:X,Float:Y,Float:Z;
new Float:angle;
GetVehiclePos(vehicleid, X, Y, Z);
GetVehicleZAngle(currentveh, angle);
SetVehicleZAngle(currentveh, angle);
dini_FloatSet(VFile(vehicleid), "ParkX", X);
dini_FloatSet(VFile(vehicleid), "ParkY", Y);
dini_FloatSet(VFile(vehicleid), "ParkZ", Z);
SetVehicleToRespawn(vehicleid);
SendClientMessage(playerid,lgreen,".You parked your car");
return 1;
}
pawn Код:
|
if(!strcmp(cmd, "/parkcar", true))
{
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(!dini_Int(GetFile(playerid), "HaveCar")) return SendClientMessage(playerid,red,"You dont have car");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You are not in a car");
if(vehicleid != CarID(playerid)) return SendClientMessage(playerid,red,".This is not your car");
new Float:X,Float:Y,Float:Z;
new Float:angle;
GetVehiclePos(vehicle, X, Y, Z);
GetVehicleZAngle(vehicle, angle);
SetVehicleZAngle(vehicle, angle);
dini_FloatSet(VFile(vehicleid), "ParkX", X);
dini_FloatSet(VFile(vehicleid), "ParkY", Y);
dini_FloatSet(VFile(vehicleid), "ParkZ", Z);
SetVehicleToRespawn(vehicleid);
SendClientMessage(playerid,lgreen,".You parked your car");
return 1;
}