12.09.2013, 14:55
I require help with the following command as it does not display properly. The command functions well enough yet it always returns
"Unknown command."
If someone could help it would be greatly appreciated.
"Unknown command."
If someone could help it would be greatly appreciated.
Код:
IsInvalidNosVehicle(playerid) { new carid = GetPlayerVehicleID(playerid); new closestcar = GetClosestCar(playerid, carid); switch(GetVehicleModel(closestcar)){ case 581, 523, 462, 521, 463, 522, 461, 448, 468, 586, 509, 481, 510, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454, 590, 569, 537, 538, 570, 449: return 1; } return 0; } CMD:nos(playerid, params[]){ new carid = GetPlayerVehicleID(playerid), string[128], closestcar = GetClosestCar(playerid, carid), nostogive, level = PlayerData[playerid][pMechSkill]; if(JobData[PlayerData[playerid][pJobID]][j_iType] == 2 || JobData[PlayerData[playerid][pJobID2]][j_iType] == 2 || PlayerData[playerid][pAdmin] >= 1 && PlayerData[playerid][pAdminDuty] == 1) { if(GetPVarInt(playerid, "InEvent") == 1) return SendClientMessage(playerid, COLOR_GRAD1, "You can't use this while in an event."); if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GRAD1, "You must be outside of a vehicle to use this."); if(PlayerData[playerid][pNosTime] >= 1) { format(string, sizeof(string), "You must wait %d seconds, before installing another nitrous oxyde system.", PlayerData[playerid][pNosTime]); SendClientMessage(playerid, COLOR_GRAD1,string); return 1; } if(!IsPlayerInRangeOfVehicle(playerid, closestcar, 9.0)) return SendClientMessage(playerid, COLOR_GRAD1, "You must be near a vehicle to use this command."); if(PlayerData[playerid][pMaterials] < 799) return SendClientMessage(playerid, COLOR_GRAD1, "You do not have enough materials to install a nitrous oxyde system."); if(IsInvalidNosVehicle(playerid)) return SendClientMessage(playerid, COLOR_GRAD1, "NOS cannot be installed in this vehicle."); if(level >= 0 && level < 50) { nostogive = 1009; } else if(level >= 50 && level < 100) { nostogive = 1009; } else if(level >= 100 && level < 200) { nostogive = 1008; } else if(level >= 200 && level < 400) { nostogive = 1008; } else if(level >= 400) { nostogive = 1010; } AddVehicleComponentEx(closestcar, nostogive, playerid); PlayerPlaySound(playerid,1133,0.0,0.0,0.0); PlayerData[playerid][pMaterials] -= 800; format(string, sizeof(string), "* %s has added nitrous injection to their %s.", getPlayerName(playerid), VehicleName[GetVehicleModel(GetPlayerVehicleID(playerid)) - 400]); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); PlayerData[playerid][pNosTime] = 480; return 1; } else SendClientMessage(playerid, COLOR_GRAD1, "You cannot use this command as you're not a mechanic."); return 1; }