27.03.2012, 00:27
(
Последний раз редактировалось TiNcH010; 27.03.2012 в 16:29.
)
Код:
if(strcmp(cmdtext, "/remolcar", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsPlayerInAnyVehicle(playerid)) { if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 525) { if(GetPlayerState(playerid) == 2) { new Float:pX,Float:pY,Float:pZ; GetPlayerPos(playerid,pX,pY,pZ); new Float:vX,Float:vY,Float:vZ; new Found = 0; new vid = 0; while((vid < MAX_VEHICLES) && (!Found)) { 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))) { Found = 1; if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) { DetachTrailerFromVehicle(GetPlayerVehicleID(playerid)); } else { AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid)); } } } if(!Found) { SendClientMessage(playerid,0xFFFF00AA,"No hay Ningun vehiculo cerca para remolcar."); } } else { SendClientMessage(playerid, 0xFFFF00AA, "Tienes que ser el conductor para poder remolcar!"); return 1; } } else { SendClientMessage(playerid, 0xFFFF00AA, "Nesesitas estar en una grua para remolcar!"); return 1; } } else { SendClientMessage(playerid, 0xFFFF00AA, "No puedes remolcar a pie!"); return 1; } } return 1; }