SA-MP Forums Archive
SetObjectTextMaterial - 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: SetObjectTextMaterial (/showthread.php?tid=404152)



SetObjectTextMaterial - CBCandyBoy - 02.01.2013

man i made a cmd for setobjecttextmaterial now its not working

at the top i wrote

pawn Код:
new hello;
under

public OnFilterScriptint()

i wrote

hello = CreateObject(19353, -2081.90, 246.23, 46.38, 2.00, 84.00, 6.56); //that is on worker spawn area

and the cmd

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/text", cmdtext, true, 10) == 0)
    {
        SetObjectMaterialText(hello, "hello everyone", 0, OBJECT_MATERIAL_SIZE_256x128,"Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
        return 1;
    }
    return 0;
}
when ever i use it it says server:unknown command


Re: SetObjectTextMaterial - Intoxicated - 02.01.2013

That is because the command is not being read. If your code has return 0; in it, it will say unknown command when it reaches that line. So in this case,

Код:
    if (strcmp("/text", cmdtext, true, 10) == 0)
    {
        SetObjectMaterialText(hello, "hello everyone", 0, OBJECT_MATERIAL_SIZE_256x128,"Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
        return 1;
    }
Is not being executed, so the code returns 0.

Try replacing
Код:
 if (strcmp("/text", cmdtext, true, 10) == 0)
with
Код:
 if (strcmp("/text", cmdtext, true, 5) == 0)
Because 5 its the length of '/text', and strcmp is instructed to compare the length as well.


Re: SetObjectTextMaterial - CBCandyBoy - 02.01.2013

ok im trying


Re: SetObjectTextMaterial - CBCandyBoy - 02.01.2013

same thing happening try any other command from /help it says


Re: SetObjectTextMaterial - [HK]Ryder[AN] - 02.01.2013

Are you using Any other command processor like ZCMD or YCMD too with this?


Re: SetObjectTextMaterial - CBCandyBoy - 02.01.2013

no im using as combinedc fs made by me with many objects and other cmds but no zcmd and ycmd