CMD:createboard(playerid, params[]) {
new Float:px, Float:py, Float:pz, Float:pa;
GetPlayerPos(playerid, px, py, pz);
GetPlayerFacingAngle(playerid, pa);
GetXYInFrontOfPlayer(playerid, px, py, 2.0);
pz -= 1.0;
pa += 180;
CreateDynamicObject(3077, px, py, pz, 0.0000, 0.0000, pa); // Board Object
// Calulate X, Y for Text
pa += 90.0;
px = px + (2.0 * floatsin(pa, degrees));
py = py - (2.0 * floatcos(pa, degrees));
pz -= 1.3;
new obj = CreateDynamicObject(19482, px, py, pz + 2.6653, 0.0000, 0.0000, pa);
SetDynamicObjectMaterialText(obj, 0, "TOP 3 Players", OBJECT_MATERIAL_SIZE_256x256, "Arial", 16, 1, 0xFFFFFFFF, 0, 0);
obj = CreateDynamicObject(19482, px, py, pz + 2.0553, 0.0000, 0.0000, pa);
SetDynamicObjectMaterialText(obj, 0, "1. Player 1", OBJECT_MATERIAL_SIZE_256x256, "Arial", 12, 1, 0xFFFFFFFF, 0, 0);
obj = CreateDynamicObject(19482, px, py, pz + 1.6353, 0.0000, 0.0000, pa);
SetDynamicObjectMaterialText(obj, 0, "2. Player 2", OBJECT_MATERIAL_SIZE_256x256, "Arial", 12, 1, 0xFFFFFFFF, 0, 0);
obj = CreateDynamicObject(19482, px, py, pz + 1.2153, 0.0000, 0.0000, pa);
SetDynamicObjectMaterialText(obj, 0, "3. Player 3", OBJECT_MATERIAL_SIZE_256x256, "Arial", 12, 1, 0xFFFFFFFF, 0, 0);
return 1;
}
|
Check out this.
https://github.com/Pottus/Texture-St.../texviewer.pwn Line 1030, 1031 Just tweak your offsets. |
CMD:createboard(playerid, params[]) {
new Float:cbx, Float:cby;
if (sscanf(params, "ff", cbx, cby)) {
SendClientMessage(playerid, COLOR_GRAD1, "USING: /createboard [x] [y]");
return 1;
}
new Float:px, Float:py, Float:pz, Float:pa;
GetPlayerPos(playerid, px, py, pz);
GetPlayerFacingAngle(playerid, pa);
GetXYInFrontOfPlayer(playerid, px, py, 2.0);
pz -= 1.0;
pa += 180;
CreateDynamicObject(3077, px, py, pz, 0.0000, 0.0000, pa);
px += cbx;
py += cby;
pa += 90.0;
px = px + (2.0 * floatsin(pa, degrees));
py = py - (2.0 * floatcos(pa, degrees));
pz -= 1.3;
new obj = CreateDynamicObject(19482, px, py, pz + 2.6653, 0.0000, 0.0000, pa);
SetDynamicObjectMaterialText(obj, 0, "TOP 3 Players", OBJECT_MATERIAL_SIZE_256x256, "Arial", 16, 1, 0xFFFFFFFF, 0, 0);
obj = CreateDynamicObject(19482, px, py, pz + 2.0553, 0.0000, 0.0000, pa);
SetDynamicObjectMaterialText(obj, 0, "1. Player 1", OBJECT_MATERIAL_SIZE_256x256, "Arial", 12, 1, 0xFFFFFFFF, 0, 0);
obj = CreateDynamicObject(19482, px, py, pz + 1.6353, 0.0000, 0.0000, pa);
SetDynamicObjectMaterialText(obj, 0, "2. Player 2", OBJECT_MATERIAL_SIZE_256x256, "Arial", 12, 1, 0xFFFFFFFF, 0, 0);
obj = CreateDynamicObject(19482, px, py, pz + 1.2153, 0.0000, 0.0000, pa);
SetDynamicObjectMaterialText(obj, 0, "3. Player 3", OBJECT_MATERIAL_SIZE_256x256, "Arial", 12, 1, 0xFFFFFFFF, 0, 0);
return 1;
}
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
// Created by ******
new Float:a;
GetPlayerPos(playerid, x, y, a);
if (GetPlayerVehicleID(playerid)) {
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
}
else GetPlayerFacingAngle(playerid, a);
x += (distance * floatsin(-a, degrees));
y += (distance * floatcos(-a, degrees));
}
// Calculate position to left of player
x = (x + 1.75 * floatsin(-fa + -90,degrees));
y = (y + 1.75 * floatcos(-fa + -90,degrees));
// Calculate create offset
if(FlyMode[playerid])
{
x = (x + 4.0 * floatsin(-fa,degrees));
y = (y + 4.0 * floatcos(-fa,degrees));
}
else
{
x = (x + 2.0 * floatsin(-fa,degrees));
y = (y + 2.0 * floatcos(-fa,degrees));
}
startx= (startx+ 1.75 * floatsin(-fa + -90,degrees)); starty= (starty+ 1.75 * floatcos(-fa + -90,degrees)); // Calculate offsets for first object x = (startx + 4.0 * floatsin(-fa,degrees)); y = (starty+ 4.0 * floatcos(-fa,degrees)); Createobject().... // Calculate offsets for second object x = (startx + 3.0 * floatsin(-fa,degrees)); y = (starty+ 3.0 * floatcos(-fa,degrees)); Createobject().... // Calculate offsets for third object x = (startx + 2.0 * floatsin(-fa,degrees)); y = (starty+ 2.0 * floatcos(-fa,degrees)); Createobject()....