SA-MP Forums Archive
y_commands SERVER: UNKOWN COMMAND - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: y_commands SERVER: UNKOWN COMMAND (/showthread.php?tid=456066)



[SOLVED]y_commands SERVER: UNKOWN COMMAND - Hardwell - 04.08.2013

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!


Re: y_commands SERVER: UNKOWN COMMAND - dEcooR - 04.08.2013

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;
}



Re: y_commands SERVER: UNKOWN COMMAND - CutX - 04.08.2013

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