27.02.2013, 10:02
I made a dynamic food stand, but I can't figure out how to place the pickup and the textdraw in front of the food stall
Here is my code:
After editing the dynamic object:
Picture how it's done after editing:
Here is my code:
After editing the dynamic object:
pawn Код:
if(response == EDIT_RESPONSE_FINAL)
{
DestroyDynamic3DTextLabel(Text3D:FoodStand[GetIntVar(playerid, "FoodStandEditing")][fLabel]);
DestroyDynamicPickup(FoodStand[GetIntVar(playerid, "FoodStandEditing")][fPickUp]);
SetDynamicObjectPos(objectid, x, y, z);
SetDynamicObjectRot(objectid, rx, ry, rz);
x += (2.0 * floatsin(-rz, degrees));
y -= (1.0 * floatcos(-rz, degrees));
format(str, sizeof(str), ""EMBED_RED"["EMBED_WHITE"Food Stand - %d"EMBED_RED"]\n"EMBED_GRAY"%s\nPrice - %d.", GetIntVar(playerid, "FoodStandEditing"), FoodStand[GetIntVar(playerid, "FoodStandEditing")][fInfo], FoodStand[GetIntVar(playerid, "FoodStandEditing")][fFoodPrice]);
FoodStand[GetIntVar(playerid, "FoodStandEditing")][fLabel] = CreateDynamic3DTextLabel(str, -1, x, y, z, 5.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
FoodStand[GetIntVar(playerid, "FoodStandEditing")][fPickUp] = CreateDynamicPickup(1239, 1, x, y, z, -1, -1, -1, 100.0);
format(str, sizeof(str), "{FF8000}[SERVER]{FFFFFF}: Finished editing a dynamic object: Position, %f, %f, %f.", x, y, z);
SCM(playerid, -1, str);
SaveEditedFoodStand(GetIntVar(playerid, "FoodStandEditing"), x, y, z, rx, ry, rz);
RemoveVar(playerid, "EditingFoodStand");
RemoveVar(playerid, "FoodStandEditing");
}