01.03.2019, 10:31
Problem:
When i type /tow and i'm not in a tow truck,i give the (correct) message: You are not in a tow truck.
But when i'n in this vehicle,i get the message: Server: Unknown command.
command:
When i type /tow and i'm not in a tow truck,i give the (correct) message: You are not in a tow truck.
But when i'n in this vehicle,i get the message: Server: Unknown command.
command:
Код:
CMD:tow(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi inainte de a face asta."); if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pJob] == 8) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { new m = GetVehicleModel(GetPlayerVehicleID(playerid)); if (m == 525) { if(PlayerInfo[playerid][pJob] == 8) return 0; if(GetPlayerVehicleID(playerid) == 525) return 0; 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))) { if(IsABike(vid) || GetVehicleModel(vid) == 448 || GetVehicleModel(vid) == 461 || GetVehicleModel(vid) == 462 || GetVehicleModel(vid) == 463 || GetVehicleModel(vid) == 468 || GetVehicleModel(vid) == 471 || GetVehicleModel(vid) == 521 || GetVehicleModel(vid) == 522 || GetVehicleModel(vid) == 523) { return 1; } if(IsAnOwnableCar(vid)) { SCM(playerid,COLOR_WHITE,"Nu ai voie sa tractezi masini personale."); return 1; } if(TowAcc[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "Nu poti tracta atat de repede o masina, trebuie sa astepti 2 minute."); Found=1; if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) { DetachTrailerFromVehicle(GetPlayerVehicleID(playerid)); DisablePlayerCheckpoint(playerid); gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE; } else { AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid)); new rand; rand = random(sizeof(TowCarCk)); SetPlayerCheckpoint(playerid, TowCarCk[rand][0],TowCarCk[rand][1],TowCarCk[rand][2], 6); CP[playerid] = 34; } } } if(!Found) return SendClientMessage(playerid, COLOR_GREY, "There is no car near to you."); } else return SendClientMessage(playerid, COLOR_GREY, "You need to be the driver."); } else return SendClientMessage(playerid, COLOR_GREY, "You need to be in a tow truck to use this command."); } else return SendClientMessage(playerid, COLOR_GREY, "You need to be in a tow truck to use this command."); } else return SendClientMessage(playerid, COLOR_GREY, "You need to be a mechanic to use this command."); } return 1; }