Commands problem. -
KnowNN - 28.01.2016
Hi, I using LIFE-CMD, I added in my gamemode 2-3 commands, working, but server says "SERVER: Unknown command.".
1. I put commands at gm finish.
2. I put "return 1;" at each command.
3. I try with another command processor but only time, the same problem.
So, what is the problem?
Example of command of my gamemode:
Код:
CMD:jobs(playerid, params[])
{
new string[100];
strcat(string, "Trucker\t$$$\n");
ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_LIST, "Jobs", string, "Select", "Exit");
return 1;
}
Re: Commands problem. -
Lucky13 - 28.01.2016
If you have ZCMD, add anywhere this in your script:
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
return 1;
}
Re: Commands problem. -
Weponz - 28.01.2016
Both the script and I are asking "what is string" ?
Re: Commands problem. -
KnowNN - 28.01.2016
@Lucky13 I tried this, not working.
@Weaponz What do you mean?
I haven't errors/warnings.
Re: Commands problem. -
Lucky13 - 28.01.2016
Well Weaponz is right. strcat is to combine 2 string together. And your defined new string[100]; is simply empty.
Maybe make it like this?
Код:
CMD:jobs(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_LIST, "Jobs", "Trucker\t$$$\n", "Select", "Exit");
return 1;
}
Re: Commands problem. -
KnowNN - 28.01.2016
Quote:
Originally Posted by Lucky13
If you have ZCMD, add anywhere this in your script:
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
return 1;
}
|
Quote:
Originally Posted by Weponz
Both the script and I are asking "what is string" ?
|
Quote:
Originally Posted by Lucky13
Well Weaponz is right. strcat is to combine 2 string together. And your defined new string[100]; is simply empty.
Maybe make it like this?
Код:
CMD:jobs(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_LIST, "Jobs", "Trucker\t$$$\n", "Select", "Exit");
return 1;
}
|
I posted an example of command, all commands not working.
# I try and this, same thing ...
http://www.girlshare.ro/3489208028.9 - This is my gamemode.
Re: Commands problem. -
Lucky13 - 28.01.2016
Maybe if you add this anywhere in your script it will work?
Код:
public OnPlayerCommandFinish(playerid, cmdtext[], success)
{
//playerid - ID Player | cmdtext - You Command | success - returns true or false, that is, whether there is a command or not
return true;
}
Took it from LIFE-CMD.
Re: Commands problem. -
KnowNN - 28.01.2016
Quote:
Originally Posted by Lucky13
Maybe if you add this anywhere in your script it will work?
Код:
public OnPlayerCommandFinish(playerid, cmdtext[], success)
{
//playerid - ID Player | cmdtext - You Command | success - returns true or false, that is, whether there is a command or not
return true;
}
Took it from LIFE-CMD.
|
This is added in gamemode.
Re: Commands problem. -
Lucky13 - 28.01.2016
So your command works, just that at the end appears: Server: Unknown Command?
Re: Commands problem. -
KnowNN - 28.01.2016
Quote:
Originally Posted by Lucky13
So your command works, just that at the end appears: Server: Unknown Command?
|
Yes.
Thanks for help, but I found the solution, I forgot to make "return 1;" at public "OnPlayerCommandText", sorry for my mistake.
Thnaks Lucky13 because you want to help me.