CreateDynamic3DTextLabel Not working? -
Dokins - 10.12.2013
pawn Код:
CMD:forsale(playerid, params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOUR_GREY, "You must be in a vehicle to use this.");
if(BizOwned[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You do not own a business.");
if(BizOwned[playerid] != VehBizID[vehicleid]) return SendClientMessage(playerid, COLOUR_GREY, "Your business does not own this vehicle.");
if(VehForSale[vehicleid] == 0)
{
VehForSale[vehicleid] = 1;
new string[128];
new name = VehModel[vehicleid] - 400;
new Float: x, Float: y, Float: z;
MySQL_SetInteger(VehicleSQLID[vehicleid], "VehForSale", 1, "vehicles");
GetVehiclePos(vehicleid, x,y,z);
format(string, sizeof(string), "%s, $%d, %s", VehicleNames[name], VehPrice[vehicleid], VehPlate[vehicleid]);
VehicleLabel[vehicleid] = CreateDynamic3DTextLabel(string, COLOUR_WHITE, x,y, z, 100.0, INVALID_PLAYER_ID, vehicleid, 0, 0, -1, -1, 20.0);
Attach3DTextLabelToVehicle(VehicleLabel[vehicleid] ,vehicleid,0.0,0.0,0.0);
SendClientMessage(playerid, COLOUR_WHITE, "Business vehicle is now for sale.");
}
else if(VehForSale[vehicleid] == 1)
{
VehForSale[vehicleid] = 0;
MySQL_SetInteger(VehicleSQLID[vehicleid], "VehForSale", 0, "vehicles");
SendClientMessage(playerid, COLOUR_WHITE, "Business vehicle is no longer for sale.");
DestroyDynamic3DTextLabel(VehicleLabel[vehicleid]);
}
return 1;
}
I'm using a streamer, yes. It was working, but I've done checks and it does indeed set the vehicle for sale in MySQL it seems the actual problem is the Creating the label..
It used to work, but I've changed things slightly.
I do have the:
pawn Код:
new Text3D: VehicleLabel[MAX_VEHICLES];
Re: CreateDynamic3DTextLabel Not working? -
Dokins - 10.12.2013
Still unresolved
Re: CreateDynamic3DTextLabel Not working? -
Threshold - 11.12.2013
pawn Код:
CMD:forsale(playerid, params[])
{
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOUR_GREY, "You must be in a vehicle to use this.");
if(BizOwned[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You do not own a business.");
if(BizOwned[playerid] != VehBizID[vehicleid]) return SendClientMessage(playerid, COLOUR_GREY, "Your business does not own this vehicle.");
new vehicleid = GetPlayerVehicleID(playerid);
if(VehForSale[vehicleid] == 0)
{
VehForSale[vehicleid] = 1;
new string[80];
new Float: x, Float: y, Float: z;
MySQL_SetInteger(VehicleSQLID[vehicleid], "VehForSale", 1, "vehicles");
GetVehiclePos(vehicleid, x,y,z);
format(string, sizeof(string), "%s, $%d, %s", VehicleNames[(VehModel[vehicleid] - 400)], VehPrice[vehicleid], VehPlate[vehicleid]);
VehicleLabel[vehicleid] = CreateDynamic3DTextLabel(string, COLOUR_WHITE, x,y, z, 20.0, INVALID_PLAYER_ID, vehicleid, 0, 0);
SendClientMessage(playerid, COLOUR_WHITE, "Business vehicle is now for sale.");
}
else if(VehForSale[vehicleid] == 1)
{
VehForSale[vehicleid] = 0;
MySQL_SetInteger(VehicleSQLID[vehicleid], "VehForSale", 0, "vehicles");
SendClientMessage(playerid, COLOUR_WHITE, "Business vehicle is no longer for sale.");
DestroyDynamic3DTextLabel(VehicleLabel[vehicleid]);
}
return 1;
}
CreateDynamic3DTextLabel has an 'attachedvehicle' parameter. Also there is no AttachDynamic3DTextLabel function; so when you use 'Attach3DTextLabel' with the dynamic text label, that was probably what was causing it to disappear, or not display properly.
Re: CreateDynamic3DTextLabel Not working? -
Dokins - 11.12.2013
Hey man. Sorry about the other post, I appreciate your effort extensively. This was mentioned in another post and was not the solution unfortunately! I did try it, several times. Is there anything else it may be?