OnPlayerCommandText(playerid,"/command");
#1

Hello.

Function: OnPlayerCommandText(playerid,"/command");

Version of that for dcmd?

Regards,
Assyria
Reply
#2

Under OnPlayerCommandText:
Код:
dcmd(commands,8,cmdtext);
Somewhere in your script:
Код:
dcmd_commands(playerid,params[])
{
if(!strlen(params)) return SendClientMessage(playerid, LIGHTBLUE2, "Usage: /commands");

//Your script here
}
Reply
#3

Nope, you got it totally wrong.
Something like: dcmd(playerid,dmcd_command);

And nice try though, if I were a beginner, your code would just freak me out as it would always just send the message "Usage: /commands"
Reply
#4

Same, you can't process command anywhere else than throught OPC callback.
Reply
#5

-
Reply
#6

not true dcmd works in 2 parts!

Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
add this to the top of your script.

then add this under OnPlayerCommandText.

Код:
dcmd(commands, 8, cmdtext);
its should look something like this

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  /* This Calls The Command */
  dcmd(commands, 8, cmdtext);
  return 0;
}
then add this at the very bottom of your script

Код:
dcmd_commands(playerid, params[])
{
    /* This is were the command will be called! */
	return 1;
}
Hope that helps you understand it
Reply
#7

Seriosly, you are kidding right? There is a fuction OnPlayerCommandText(playerid,"/bla"); and let's pretend I have sendclientmessage inside the command "/bla", and I put OnPlayerCommandText(playerid,"/bla"); in ondialogresponce for example, and then when I use the dialog, everything what is in command /bla, will happen.
Reply
#8

then add this instead

Код:
dcmd_commands(playerid, params)
and it will call the command /commands



at-least this is what i think your asking for ?
Reply
#9

Nope.
Reply
#10

now im connfused >.> your looking for how to make the command /commands in dcmd or call the function else were in the script as i have given you both now as this

Quote:
Originally Posted by [T_S
DeStunter ]
Код:
dcmd_commands(playerid, params)
will call the dcmd command /commands else were in the script and output it like the player used the command but didnt
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)