10.02.2016, 17:53
Quote:
1. Where are you setting `keyid`?
2. Can you verify that both the vehicle and the label exists before attaching? |
PHP код:
new key = SCRIPT_CARS;
if(GetPVarInt(playerid, "CarKey1") != SCRIPT_CARS && OwnableVehicle(GetPVarInt(playerid, "CarKey1"))) { key = GetPVarInt(playerid, "CarKey1"); }
if(GetPVarInt(playerid, "CarKey2") != SCRIPT_CARS && OwnableVehicle(GetPVarInt(playerid, "CarKey2"))) { key = GetPVarInt(playerid, "CarKey2"); }
if(GetPVarInt(playerid, "CarKey3") != SCRIPT_CARS && OwnableVehicle(GetPVarInt(playerid, "CarKey3"))) { key = GetPVarInt(playerid, "CarKey3"); }
if (key == SCRIPT_CARS) return SendClientMessage(playerid, COLOR_WHITE, "You don't have a key to this vehicle slot.");
if (CarInfo[key][cOwned] == 0) return SendClientMessage(playerid, COLOR_WHITE, "The vehicle you have a key to is invalid.");
vehicle3Dtext[key] = Create3DTextLabel("Example Text", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1);
Attach3DTextLabelToVehicle(vehicle3Dtext[key], key, 0.009999, -0.019999, 0.854999);