07.05.2015, 16:07
Hello!
I have one question. - What is wrong
Who can tell me what is wrong? The command WORKS fine but it shows me - SERVER: Unknown command.
I have one question. - What is wrong
Who can tell me what is wrong? The command WORKS fine but it shows me - SERVER: Unknown command.
Код:
CMD:veh(playerid, params[]) { new Option[5], SecOption[128], Vehicle[50], VehicleID, Color[2], RespawnTime, Siren[5], Float:X, Float:Y, Float:Z, Float:A, Float:vX, Float:vY, Float:vZ, string[512], vehicleid = GetPlayerVehicleID(playerid); if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "[ERROR]: You are not connected to the server. :D Please connect. xD"); format(string, sizeof(string), "[USAGE]: /veh [Name/ID/Spawn]"); if(sscanf(params, "s[5]S(NULL)[128]", Option, SecOption)) return SendClientMessage(playerid, -1, string); if(!strcmp(Option, "spawn", true)) { //if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "[WARNING]: You are now in vehicle. Please exit and then spawn new one!"); format(string, sizeof(string), "[USAGE]: /veh %s [VehicleName/VehicleID] [Color 1 (optional)] [Color 2 (optional)]", Option); format(string[88], sizeof(string), "[Respawn time in minutes (optional)] [Siren Yes/No (optional)]"); if(sscanf(params, "{s[5]}s[50]D(0)D(0)D(0)S(No)[5]", Vehicle, Color[0], Color[1], RespawnTime, Siren)) return SendClientMessage(playerid, -1, string), SendClientMessage(playerid, -1, string[88]); VehicleID = GetVehicleIDFromNameEx(Vehicle); if('0' <= Vehicle[0] <= '9') { VehicleID = strval(Vehicle); format(string, sizeof(string), "[WARNING]: Invalid vehicle ID! To find vehicle's ID use \"/veh id\"."); if(!(400 <= VehicleID <= 611)) return SendClientMessage(playerid, -1, string); } else { format(string, sizeof(string), "[WARNING]: Invalid vehicle name! To find vehicle's name use \"/veh name\"."); if(VehicleID == -1) return SendClientMessage(playerid, -1, string); } if(!strcmp(Siren, "yes", true)) { Siren[4] = 1; } else if(!strcmp(Siren, "no", true)) { Siren[4] = 0; } else return SendClientMessage(playerid, -1, "[INFO]: Add siren: Yes/No."); if(IsPlayerInAnyVehicle(playerid)) { GetVehicleVelocity(SpawnedVehicle[playerid], vX, vY, vZ); GetVehiclePos(SpawnedVehicle[playerid], X, Y, Z); GetVehicleZAngle(SpawnedVehicle[playerid], A); } else { GetPlayerPos(playerid, X, Y, Z); GetPlayerFacingAngle(playerid, A); } DestroyVehicle(SpawnedVehicle[playerid]); SpawnedVehicle[playerid] = CreateVehicle(VehicleID, X, Y, Z + 1, A, Color[0], Color[1], RespawnTime*60*1000, Siren[4]); LinkVehicleToInterior(SpawnedVehicle[playerid], GetPlayerInterior(playerid)); SetVehicleVirtualWorld(SpawnedVehicle[playerid], GetPlayerVirtualWorld(playerid)); PutPlayerInVehicle(playerid, SpawnedVehicle[playerid], 0); SetVehicleVelocity(SpawnedVehicle[playerid], vX, vY, vZ); format(string, sizeof(string), "[INFO]: You successfully spawned \"%s\" (ID: %d). Enjoy it!", GetVehicleName(vehicleid), GetVehicleIDFromName(GetVehicleName(GetPlayerVehicleID(playerid)))); SendClientMessage(playerid, -1, string); } return 1; }