SA-MP Forums Archive
Material[problem] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Material[problem] (/showthread.php?tid=347068)



Material[problem] - Dan_Barocu - 31.05.2012

how can i make so i have on ground a text??i know there is an fs but no work..i know there is tutorials but i dont understand..please tell me here..


Re: Material[problem] - MadeMan - 31.05.2012

Use 3DTextLabel

https://sampwiki.blast.hk/wiki/Create3DTextLabel


Re: Material[problem] - zombieking - 31.05.2012

pawn Код:
Create3DTextLabel("TEXT",COLOR,X,Y,Z,DRAWDISTANCE,VIRTUALWORLD,0);
Like that , replace TEXT,COLOR,X,Y,Z DRAWDISTANCE and VIRTUALWORLD with your options...
Example:

pawn Код:
Create3DTextLabel("3D TEXT", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, 0);
EDIT: Ooops ... I am late xD


Re: Material[problem] - Dan_Barocu - 31.05.2012

will this make the text flat on the ground?


Re: Material[problem] - JaKe Elite - 31.05.2012

no they just giving you example.

get the player position, then set the label position to your player position with little bit far from you.


Re: Material[problem] - MadeMan - 31.05.2012

... or do you mean this?

https://sampwiki.blast.hk/wiki/SetObjectMaterialText


Re: Material[problem] - Dan_Barocu - 31.05.2012

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
yes like that i dont understand the wiki thingy..how can i put a text on ground?


Re: Material[problem] - Dan_Barocu - 01.06.2012

anyone help(isnt a spam i posted yesterday!


Re: Material[problem] - Jonny5 - 01.06.2012

place an object on the ground and then change its mat to text!


heres some functions i wrote just for testing this sort of thing,
I dont have time to explain them but the code should be clear,
use at your own free will, sale it, edit it, give it away lol.

the last one will set the text on an obj

pawn Код:
//objects!!!!!!
YCMD:cobj(playerid, params[], help)
{
    //#pragma unused params
    if (help)   {SendClientMessage(playerid, 0xFF9933FF, "/cobj : create an obj");}
    else       
    {
        new modelid         = strval(params),
            Float:x,
            Float:y,
            Float:z,
            Float:rx        = 0.0,
            Float:ry        = 0.0,
            Float:rz        = 0.0,
            objId;
        GetPlayerPos(playerid,x,y,z);
       
        //objId = CreateDynamicObject(modelid, x, y, z, rx, ry, rz);
        objId = CreateObject(modelid, x + 1.0, y, z, rx, ry, rz);
        new strOut[128];
        format(strOut,128,"ObjID (%d) Created:",objId);
        SendClientMessage(playerid, 0xFF9933FF, strOut);
    }
    return 1;
}
YCMD:sobjx(playerid, params[], help)
{
    //#pragma unused params
    if (help)   {SendClientMessage(playerid, 0xFF9933FF, "/sobjz [objId] [Float:x]: set objects x pos");}
    else       
    {
        new objectid,
            Float:param_x,
            Float:x,
            Float:y,
            Float:z;
        if (sscanf(params,"if",objectid,param_x)) return SendClientMessage(playerid, 0xFF9933FF, "/sobjx [objId] [Float:x]: set objects x pos");
        if (!IsValidObject(objectid)) return SendClientMessage(playerid, 0xFF9933FF, "/sobjx [objId] [Float:x]: Invalid objId");
        GetObjectPos(objectid, x, y, z);
        x += param_x;
        SetObjectPos(objectid, x, y, z);
        new strOut[128];
        format(strOut,128,"ObjID (%d) x Set to (%.02f):",objectid,x);
        SendClientMessage(playerid, 0xFF9933FF, strOut);
    }
    return 1;
}

YCMD:sobjy(playerid, params[], help)
{
    //#pragma unused params
    if (help)   {SendClientMessage(playerid, 0xFF9933FF, "/sobjy [objId] [Float:y]:  set objects y pos");}
    else       
    {
        new objectid,
            Float:param_y,
            Float:x,
            Float:y,
            Float:z;
        if (sscanf(params,"if",objectid,param_y)) return SendClientMessage(playerid, 0xFF9933FF, "/sobjy [objId] [Float:y]:  set objects y pos");
        if (!IsValidObject(objectid)) return SendClientMessage(playerid, 0xFF9933FF, "/sobjy [objId] [Float:y]: Invalid objId");
        GetObjectPos(objectid, x, y, z);
        y += param_y;
        SetObjectPos(objectid, x, y, z);
        new strOut[128];
        format(strOut,128,"ObjID (%i) y Set to (%.02f):",objectid,y);
        SendClientMessage(playerid, 0xFF9933FF, strOut);
    }
    return 1;
}

YCMD:sobjz(playerid, params[], help)
{
    //#pragma unused params
    if (help)   {SendClientMessage(playerid, 0xFF9933FF, "/sobjz [objId] [Float:z]:  set objects z pos");}
    else       
    {
        new objectid,
            Float:param_z,
            Float:x,
            Float:y,
            Float:z;
        if (sscanf(params,"if",objectid,param_z)) return SendClientMessage(playerid, 0xFF9933FF, "/sobjz [objId] [Float:z]:  set objects z pos");
        if (!IsValidObject(objectid)) return SendClientMessage(playerid, 0xFF9933FF, "/sobjz [objId] [Float:z]: Invalid objId");
        GetObjectPos(objectid, x, y, z);
        z += param_z;
        SetObjectPos(objectid, x, y, z);
        new strOut[128];
        format(strOut,128,"ObjID (%i) z Set to (%.02f):",objectid,z);
        SendClientMessage(playerid, 0xFF9933FF, strOut);
    }
    return 1;
}


YCMD:sobjrx(playerid, params[], help)
{
    //#pragma unused params
    if (help)   {SendClientMessage(playerid, 0xFF9933FF, "/sobjrz [objId] [Float:rx]: set objects rx pos");}
    else       
    {
        new objectid,
            Float:param_rx,
            Float:rx,
            Float:ry,
            Float:rz;
        if (sscanf(params,"if",objectid,param_rx)) return SendClientMessage(playerid, 0xFF9933FF, "/sobjrx [objId] [Float:rx]: set objects rx pos");
        if (!IsValidObject(objectid)) return SendClientMessage(playerid, 0xFF9933FF, "/sobjrx [objId] [Float:rx]: Invalid objId");
        GetObjectRot(objectid, rx, ry, rz);
        rx += param_rx;
        SetObjectRot(objectid, rx, ry, rz);
        new strOut[128];
        format(strOut,128,"ObjID (%i) rx Set to (%.02f):",objectid,rx);
        SendClientMessage(playerid, 0xFF9933FF, strOut);
    }
    return 1;
}

YCMD:sobjry(playerid, params[], help)
{
    //#pragma unused params
    if (help)   {SendClientMessage(playerid, 0xFF9933FF, "/sobjry [objId] [Float:ry]:  set objects ry pos");}
    else       
    {
        new objectid,
            Float:param_ry,
            Float:rx,
            Float:ry,
            Float:rz;
        if (sscanf(params,"if",objectid,param_ry)) return SendClientMessage(playerid, 0xFF9933FF, "/sobjry [objId] [Float:ry]:  set objects ry pos");
        if (!IsValidObject(objectid)) return SendClientMessage(playerid, 0xFF9933FF, "/sobjry [objId] [Float:ry]: Invalid objId");
        GetObjectRot(objectid, rx, ry, rz);
        ry += param_ry;
        SetObjectRot(objectid, rx, ry, rz);
        new strOut[128];
        format(strOut,128,"ObjID (%i) ry Set to (%.02f):",objectid,ry);
        SendClientMessage(playerid, 0xFF9933FF, strOut);
    }
    return 1;
}

YCMD:sobjrz(playerid, params[], help)
{
    //#pragma unused params
    if (help)   {SendClientMessage(playerid, 0xFF9933FF, "/sobjrz [objId] [Float:rz]:  set objects rz pos");}
    else       
    {
        new objectid,
            Float:param_rz,
            Float:rx,
            Float:ry,
            Float:rz;
        if (sscanf(params,"if",objectid,param_rz)) return SendClientMessage(playerid, 0xFF9933FF, "/sobjrz [objId] [Float:rz]:  set objects rz pos");
        if (!IsValidObject(objectid)) return SendClientMessage(playerid, 0xFF9933FF, "/sobjrz [objId] [Float:rz]: Invalid objId");
        GetObjectRot(objectid, rx, ry, rz);
        rz += param_rz;
        SetObjectRot(objectid, rx, ry, rz);
        new strOut[128];
        format(strOut,128,"ObjID (%i) rz Set to (%.02f):",objectid,rz);
        SendClientMessage(playerid, 0xFF9933FF, strOut);
    }
    return 1;
}
YCMD:dobj(playerid, params[], help)
{
    //#pragma unused params
    if (help)   {SendClientMessage(playerid, 0xFF9933FF, "/dobj [objId] :  delete an object");}
    else       
    {
        new objectid;
        if (sscanf(params,"i",objectid)) return SendClientMessage(playerid, 0xFF9933FF, "/dobj [objId] :  delete an object");
        if (!IsValidObject(objectid)) return SendClientMessage(playerid, 0xFF9933FF, "/dobj [objId] : Invalid objId");
        DestroyObject(objectid);
        new strOut[128];
        format(strOut,128,"ObjID (%i) Deleted",objectid);
        SendClientMessage(playerid, 0xFF9933FF, strOut);
    }
    return 1;
}


YCMD:eobj(playerid, params[], help)
{
    //#pragma unused params
    if (help)   {SendClientMessage(playerid, 0xFF9933FF, "/eobj [objId] :  edit an object");}
    else       
    {
        new objectid;
        if (sscanf(params,"i",objectid)) return SendClientMessage(playerid, 0xFF9933FF, "/eobj [objId] :  edit an object");
        if (!IsValidObject(objectid)) return SendClientMessage(playerid, 0xFF9933FF, "/eobj [objId] : Invalid objId");
        EditObject(playerid, objectid);
        new strOut[128];
        format(strOut,128,"ObjID (%i) editing",objectid);
        SendClientMessage(playerid, 0xFF9933FF, strOut);
    }
    return 1;
}
 
 YCMD:mobj(playerid, params[], help)
{
    //#pragma unused params
    if (help)   {SendClientMessage(playerid, 0xFF9933FF, "/mobj [objId][text] :  ");}
    else       
    {
        new objectid,strIn[128];
        if (sscanf(params,"is[128]",objectid,strIn)) return SendClientMessage(playerid, 0xFF9933FF, "/mobj [objId][text] :  ");
        if (!IsValidObject(objectid)) return SendClientMessage(playerid, 0xFF9933FF, "/mobj [objId][text] :  Invalid objId");
       
       
       
         
        //new myobject = CreateObject(19353, 0, 0, 10, 0.0, 0.0, 90.0); //create the object
        SetObjectMaterialText
        (
            objectid,
            strIn,
            0,
            OBJECT_MATERIAL_SIZE_512x512  ,
            "Arial",
            28,
            0,
            0xFFFF8200,  //argb
            0xFF000000,  //argb
            OBJECT_MATERIAL_TEXT_ALIGN_CENTER
        );
       
       
        new strOut[128];
        format(strOut,128,"ObjID (%i) mat updated",objectid);
        SendClientMessage(playerid, 0xFF9933FF, strOut);
    }
    return 1;
}
use /cobj to create the obj
/eobj to et the position
/mobj to set the mat text