30.10.2013, 02:39
can i make a command without this "/" xD ?
COMMAND:mycommand(playerid, params[]) // or CMD:mycommand(playerid, params[])
{
// Do something
return 1;
}
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;
}
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;