SetObjectTextMaterial
#1

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
Reply
#2

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.
Reply
#3

ok im trying
Reply
#4

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)