29.02.2016, 16:38
Hello i try to make something like when you in a truck and trailer is attached to create a checkpoint but it isn't working
Any solution?
Код:
public OnPlayerStateChange(playerid, newstate, oldstate) { new vID = GetPlayerVehicleID(playerid); if(newstate == PLAYER_STATE_DRIVER) { if(vID == 403 || 514 || 515) { if(IsTrailerAttachedToVehicle(vID)) { new trailerid = GetVehicleTrailer(vID); new trailermodel = GetVehicleModel(trailerid); if(trailermodel == 435 || 450 || 584) { //new WorkCP = CreateDynamicCP(1588.8866,715.2956,10.8203,3.0,-1,-1,playerid,100.0); SetPlayerCheckpoint(playerid, 1588.8866,715.2956,10.8203, 3.0); } } } } else if(newstate == PLAYER_STATE_ONFOOT) { DisablePlayerCheckpoint(playerid); } return 1; }