12.10.2013, 04:03
Guys i want a help with Checkpoint at car trunk i made a command for open car trunk with dialog i want if i write the command for open car trunk then after open trunk made a checkpoint at car trunk but i getting a problem see the images
when my car is in this pos then its making correct checkpoint
![](http://i1236.photobucket.com/albums/ff443/Shehroz2/sa-mp-010_zpsf0cc41a8.png)
but when my car in this pos then problem
![](http://i1236.photobucket.com/albums/ff443/Shehroz2/sa-mp-011_zps520d2d86.png)
here is my code and any soultion? i want to if my car is any pos then make marker at car trunk like in 1st image
when my car is in this pos then its making correct checkpoint
![](http://i1236.photobucket.com/albums/ff443/Shehroz2/sa-mp-010_zpsf0cc41a8.png)
but when my car in this pos then problem
![](http://i1236.photobucket.com/albums/ff443/Shehroz2/sa-mp-011_zps520d2d86.png)
here is my code and any soultion? i want to if my car is any pos then make marker at car trunk like in 1st image
pawn Код:
if(strcmp(cmd, "/car", true) == 0)
{
if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && !IsBicycle(GetPlayerVehicleID(playerid)))
{
ShowPlayerDialog(playerid, CAR,DIALOG_STYLE_LIST,"Vehicle Control","Engine\nLights\nHood\nTrunk","Choose","");
}
return 1;
}
pawn Код:
if(dialogid == CAR)
{
if(!response) return 1;
switch(listitem)
{
case 0:
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(engine == 1)
{
SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
GameTextForPlayer(playerid, "Engine off.", 200, 1);
}
else
{
SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
GameTextForPlayer(playerid, "Engine on.", 200, 1);
}
}
case 1:
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(lights == 1)
{
SetVehicleParamsEx(vehicleid, engine, 0, alarm, doors, bonnet, boot, objective);
GameTextForPlayer(playerid, "Lights off.", 200, 1);
}
else
{
SetVehicleParamsEx(vehicleid, engine, 1, alarm, doors, bonnet, boot, objective);
GameTextForPlayer(playerid, "Lights on.", 200, 1);
}
}
case 2:
{
new vehicleid = GetPlayerVehicleID(playerid);
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
if(bonnet == 1)
{
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, 0, boot, objective);
GameTextForPlayer(playerid, "Hood closed.", 200, 1);
}
else
{
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, 1, boot, objective);
GameTextForPlayer(playerid, "Hood popped.", 200, 1);
}
}
case 3://----> This is trunk case
{
new vehicleid = GetPlayerVehicleID(playerid);
new Float:x, Float:y, Float:z;
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
GetVehiclePos(vehicleid, x, y, z);
if(boot == 1)
{
DestroyDynamicCP(Turnk);
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, 0, objective);
GameTextForPlayer(playerid, "Trunk closed.", 200, 1);
}
else
{
RemovePlayerFromVehicle(playerid);
Turnk = CreateDynamicCP(x,y-3.5,z, 1.0, -1, -1, -1 ,15.0);
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, 1, objective);
GameTextForPlayer(playerid, "Trunk popped.", 200, 1);
}
}
}
}