OnPlayerCommandText(playerid,"/command"); -
Assyria - 21.05.2010
Hello.
Function: OnPlayerCommandText(playerid,"/command");
Version of that for dcmd?
Regards,
Assyria
Re: OnPlayerCommandText(playerid,"/command"); -
DJDhan - 21.05.2010
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
}
Re: OnPlayerCommandText(playerid,"/command"); -
Assyria - 21.05.2010
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"
Re: OnPlayerCommandText(playerid,"/command"); -
Sergei - 21.05.2010
Same, you can't process command anywhere else than throught OPC callback.
Re: OnPlayerCommandText(playerid,"/command"); -
Assyria - 21.05.2010
-
Re: OnPlayerCommandText(playerid,"/command"); -
BLAbla93 - 21.05.2010
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
Re: OnPlayerCommandText(playerid,"/command"); -
Assyria - 21.05.2010
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.
Re: OnPlayerCommandText(playerid,"/command"); -
BLAbla93 - 21.05.2010
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 ?
Re: OnPlayerCommandText(playerid,"/command"); -
Assyria - 21.05.2010
Nope.
Re: OnPlayerCommandText(playerid,"/command"); -
BLAbla93 - 21.05.2010
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