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



"/" - Another1 - 30.10.2013

can i make a command without this "/" xD ?


Re: "/" - whatthefuck123 - 30.10.2013

yes.


Re : "/" - Matnix - 30.10.2013

Yes, if you only use this callback OnPlayerText.


Re: "/" - Another1 - 30.10.2013

i use zcmd


Re: "/" - Superhot - 30.10.2013

pawn Код:
COMMAND:mycommand(playerid, params[]) // or CMD:mycommand(playerid, params[])
{
  // Do something
  return 1;
}



Re: "/" - Kyance - 30.10.2013

Superhot, that's what not he asked..
OT: This should help you -> https://sampforum.blast.hk/showthread.php?tid=335123
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, "help me up", true)) { //If the player types this 'command'
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        SetPlayerPos(playerid, X, Y, Z + 10); //He will be slapped up
        SendClientMessage(playerid, -1, "I've set your position 10 meters higher - I hope you aren't stuck anymore!"); //And he will receive this message.
        return 0; //return 0; will not send his message to the players(They wont see that he typed the command/message)
    }
    return 1;
}
Another example:
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, "commands", true)) { //If the player types 'commands'
        SendClientMessage(playerid, -1, "[COMMANDS] - /command1 - /command2 - /command3"); //he will receive this message.
        return 0; //And the other players again, won't be able to see what he typed.
    }
    return 1;
I did not test this.. just typed it xd
NOTE: If you want other players see him type the "commands", then remove the return 0;