Unknown 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: Unknown Command ??? (
/showthread.php?tid=557567)
Unknown Command ??? -
nezo2001 - 14.01.2015
I have updated my script but when i use any commands it gives me
Server: Unknown command
And there is more than 20 commands and all don't work ?
Please help !
Re: Unknown Command ??? -
ATGOggy - 14.01.2015
Did you type return 1 at the end of each command?
Also, show the last 3 lines of your gamemode
Re: Unknown Command ??? -
nezo2001 - 14.01.2015
Yes here is an example
PHP код:
CMD:setlevel(playerid, params[])
{
new targetid, level, string[128];
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, "Command not found on server! /help");
if(sscanf(params,"ui", targetid, level)) return SendClientMessage(playerid, COLOR_RED,"Administrator level: /setlevel (id) (level)");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected to the server");
if(level < 0) return SendClientMessage(playerid, COLOR_RED, "You have filled in an invalid administrator level (below minimum level)");
if(level > 5) return SendClientMessage(playerid, COLOR_RED, "You have filled in an invalid administrator level (above maximum level)");
if(LoggedIn[targetid] == false) return SendClientMessage(playerid, COLOR_RED, "Player is not logged in his account");
if(PlayerInfo[playerid][pAdmin] == 5 || IsPlayerAdmin(playerid))
{
switch(level)
{
case 0: LevelName = ADMIN_LEVEL_0;
case 1: LevelName = ADMIN_LEVEL_1;
case 2: LevelName = ADMIN_LEVEL_2;
case 3: LevelName = ADMIN_LEVEL_3;
case 4: LevelName = ADMIN_LEVEL_4;
case 5: LevelName = ADMIN_LEVEL_5;
}
}
format(string, sizeof(string), "Administrator %s has set level %s to %s", PlayerName(playerid), PlayerName(targetid), LevelName);
SendToAdmins(COLOR_RED, string);
new INI:File = INI_Open(UserPath(targetid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Admin",level);
INI_Close(File);
return 1;
}
Re: Unknown Command ??? -
Ironboy - 14.01.2015
You're not supposed to use zcmds inside OnPlayerCommandText callback, make sure that.
Re: Unknown Command ??? -
ATGOggy - 14.01.2015
Is this a filterscript?
Re: Unknown Command ??? -
nezo2001 - 14.01.2015
Nothing !
Re: Unknown Command ??? -
nezo2001 - 14.01.2015
no it is my gamemode
Re: Unknown Command ??? -
Accent - 14.01.2015
How many command processors do you have included in your script?
Re: Unknown Command ??? -
nezo2001 - 14.01.2015
all my includes
PHP код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
#include <YSI\y_ini>
#include <streamer>
#include <cpstream>
#include <foreach>
Re: Unknown Command ??? -
xVIP3Rx - 14.01.2015
post your
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
public OnPlayerCommandReceived(playerid, cmdtext[])