09.06.2017, 19:46
Hey people, today i tried for hours to attach a trailer for my job. He need to check on the waypoint if the trailer is attached. If it is not attached it have to say ''Trailer not attached'' and if the trailer is attached it have to give your payout etc. The vehicle id is 485 and trailer id is 606
I tried this code but after changing and testing it for hours i can figure out how it works.
Is here someone who knows how to fix this?
I tried this code but after changing and testing it for hours i can figure out how it works.
Is here someone who knows how to fix this?
Код HTML:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 485) { if(Info[playerid][Bagage] == 1) { SetPlayerCheckpoint(playerid, 1857.0491,-2655.3923,13.5469, 8); CreateVehicle(606,1861.7717,-2656.6096,13.2069,5.0111,1,78); PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0); Info[playerid][Bagage] = 2; return 1; } if(Info[playerid][Bagage] == 2) { SetPlayerCheckpoint(playerid, 1921.4204,-2441.5576,13.5391, 8); PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0); Info[playerid][Bagage] = 3; return 1; } if(Info[playerid][Bagage] == 3) { if(IsTrailerAttachedToVehicle(485)) { printf("Vehicle %i has a trailer!", 485); } SendClientMessage(playerid, LIGHT_BLUE, "You need to attach the trailer!"); Info[playerid][Bagage] = 3; return 0; } if(Info[playerid][Bagage] == 3) { if(IsTrailerAttachedToVehicle(485)) DisablePlayerCheckpoint(playerid); GameTextForPlayer(playerid, "~y~+$12000", 3000, 4); SendClientMessage(playerid, LIGHT_BLUE, "You have recieved $12000 for finish this work!"); PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0); GivePlayerCash(playerid, 12000); DetachTrailerFromVehicle(485); Info[playerid][Bagage] = 0; return 1; } } return 1;