Commands problem.
#1

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;
}
Reply
#2

If you have ZCMD, add anywhere this in your script:

Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    return 1;
}
Reply
#3

Both the script and I are asking "what is string" ?
Reply
#4

@Lucky13 I tried this, not working.
@Weaponz What do you mean?

I haven't errors/warnings.
Reply
#5

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;
}
Reply
#6

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.
Reply
#7

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.
Reply
#8

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.
Reply
#9

So your command works, just that at the end appears: Server: Unknown Command?
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)