06.12.2012, 21:26
Im trying to make the dft tow vehicles i found a fs and i am editing it to work.
I have already made it so that the dft tows the car but now i just need it to be in the middle bed part of the dft and i dont know what to do?
I have already made it so that the dft tows the car but now i just need it to be in the middle bed part of the dft and i dont know what to do?
Код:
new Medic=0; new IsMedic[MAX_PLAYERS]; public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate==PLAYER_STATE_DRIVER) { if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 578) { IsMedic[playerid]=1; Medic++; SendClientMessage(playerid,0xFFFF00AA,"You can use the ACTION KEY to Tow cars"); } if((newstate==PLAYER_STATE_ONFOOT)&&(IsMedic[playerid]==1)) { IsMedic[playerid]=0; Medic--; } return 1; } return 0; } //------------------------------------------------------------------------------------------------------ public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if ((newkeys==KEY_ACTION)&&(IsPlayerInAnyVehicle(playerid))&&(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)) { if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 578) { new Float:pX,Float:pY,Float:pZ; GetPlayerPos(playerid,pX,pY,pZ); new Float:vX,Float:vY,Float:vZ; new vid=0; while((vid<MAX_VEHICLES)) { vid++; GetVehiclePos(vid,vX,vY,vZ); if((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid))) { if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) { DetachTrailerFromVehicle(GetPlayerVehicleID(playerid)); } AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid)); } } } } } //------------------------------------------------------------------------------------------------------ public OnPlayerDisconnect(playerid) { if (IsMedic[playerid]==1) { IsMedic[playerid]=0; Medic--; } return 1; }