04.01.2013, 19:46
Heya, I got a crate system and I'm trying to add a command which will attach the crate to the player when he's in a truck. No errors come/warnings too, but when I'm in a truck it says unknown command.. Help please
Код:
CMD:dropcrate(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(vehicleid == CrateIslandVehicles[12] || vehicleid == CrateIslandVehicles[13]) { new TruckFound, UsedSlot; new Float:x, Float:y, Float:z; TruckFound = INVALID_VEHICLE_ID; if(UsedSlot == -1) return SendClientMessageEx(playerid, COLOR_GRAD2, "This Truck is empty!"); GetPlayerPos(playerid, x, y, z); CrateInfo[CrateVehicleLoad[TruckFound][vCrateID][UsedSlot]][InVehicle] = vehicleid; CrateVehicleLoad[vehicleid][vCrateID][0] = CrateVehicleLoad[TruckFound][vCrateID][UsedSlot]; CrateVehicleLoad[vehicleid][vForkObject] = CreateDynamicObject(964,-1077.59997559,4274.39990234,3.40000010,0.00000000,0.00000000,0.00000000); AttachObjectToPlayer(CrateVehicleLoad[vehicleid][vForkObject], playerid, x, y, z+3, 0, 0, 0); if(UsedSlot != -1) { UsedSlot = -1; } CrateVehicleLoad[TruckFound][vCrateID][UsedSlot] = -1; SendClientMessageEx(playerid, COLOR_GRAD2, "You've dropped the crate from the truck!"); } else { return SendClientMessageEx(playerid, COLOR_GRAD2, "You're not in a truck!"); } return 1; }