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



Command problem - Dominic1 - 31.12.2012

I've made cmd so players can open and close gates.It worked well,and i didn't do anything special,i just added few cars,but that shouldn't do any difference.
Well when i type /gd1op doors don't open.
Pawno also don't show any error or warning.
Its strange since i don't have #Include <zcmd>
So i don't know what is the problem.


Create Object codes


OnPlayerCommandText


When I Compile


Any solution?


Re: Command problem - Konstantinos - 31.12.2012

"/gd1op" has lenght 6, not 10. Does it send the message? If it sends the message, then the coordinates are wrong when you're moving the object.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/gd1op", true))
    {
        //MoveObject( ... );
        //SendClientMessage( ... );
        return 1;
    }
    return 0;
}



Re: Command problem - Dominic1 - 31.12.2012

It Dosen't show the message.And i've checked the coordinates and they are good.As i said it worked before.Dunno why it dosen't now.


Re: Command problem - Konstantinos - 31.12.2012

Does it return false/0 at the end of the callback? I've seen a lot of times, that strcmp doesn't work sometimes and the best solution is to switch to ZCMD. You won't have any problem with it, it's faster and easier. Also, it is compatitive with sscanf which is very good.


Re: Command problem - Dominic1 - 31.12.2012

It is return 0;
Well i'll try to change it to ZCMD.
Thanks.