y_commands SERVER: UNKOWN COMMAND
#1

Hi, i want make a command with y_commands and i got an bug/error
Command:
Код:
CMD:kick(playerid, params[])
{
	if(P_DATA[playerid][Level] < 5) return SendClientMessage(playerid, -1, "You must be level 5 to use this command!");
	return 1;
}
Bug/Error: Image

Thanks!
Reply
#2

try this

Код:
CMD:kick(playerid, params[])
{
	if(P_DATA[playerid][Level] == 5)
        { 
                YOUR CODE HERE
        }
        else
        {
               SendClientMessage(playerid, -1, "You must be level 5 to use this command!");
               return 1;
        }
	return 1;
}
Reply
#3

if you're using y_commands, shouldnt it be like this?
Код:
YCMD:kick(playerid, params[], help)
also make sure that you didn't block the command for your team/playerid
using Command_SetPlayerNamed("kick", playerid, false); for example

btw.
Quote:
Originally Posted by dEcooR
Посмотреть сообщение
try this
Код:
CMD:kick(playerid, params[])
{
	if(P_DATA[playerid][Level] == 5)
        { 
                YOUR CODE HERE
        }
        else
        {
               SendClientMessage(playerid, -1, "You must be level 5 to use this command!");
               return 1;
        }
	return 1;
}
there's nothing wrong with his code (the if statement), you can put that in 1 line bro
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)