SERVER: Unknown Command
#1

Ever since I added weapon-config include, these two commands have been bugged, not quite sure why. All of these commands worked before. Now, whenever I type them in, I get this:

However, when I enter the command without putting parameters, or I try to use the command without being the proper admin level, I get the error messages I put in:



Code for the 2 commands:

Код:
CMD<AD1>:forceteam(cmdid, playerid, params[])
{
	new targetid;
	if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /forceteam [player]");
	if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, NOPLAYER);
	if(LoggedIn[targetid] != true) return SendClientMessage(playerid, COLOR_RED, NOTLOGGEDIN);
    if(UserStats[playerid][AdminLevel] < UserStats[targetid][AdminLevel]) return SendClientMessage(playerid, COLOR_RED, NOLEVEL);
	ForceClassSelection(targetid);
	SetPlayerHealth(targetid, 0.0);
	PlayerPlaySound(targetid, 1057, 0.0, 0.0, 0.0);
	PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
	new buf[150];
	format(buf, sizeof(buf), "[AdmCmd]: Admin [%i] %s has forced you to class selection.", playerid, GetName(playerid));
	SendClientMessage(targetid, COLOR_RED, buf);
	format(buf, sizeof(buf), "You have forced [%i] %s to class selection.", GetName(targetid), targetid);
	SendClientMessage(playerid, COLOR_RED, buf);
	return 1;
}
Код:
CMD<AD1>:suicide(cmdid, playerid, params[])
{
	new targetid;
	if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /suicide [player id]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, NOPLAYER);
	if(!LoggedIn[targetid]) return SendClientMessage(playerid, COLOR_RED, NOTLOGGEDIN);
	if(UserStats[playerid][AdminLevel] < UserStats[targetid][AdminLevel]) return SendClientMessage(playerid, COLOR_RED, NOLEVEL);
	SetPlayerHealth(targetid, -1);
	return 1;
}
Reply
#2

1. Don't load FilterScript in OnGamemodeInit
2. There was a broken function inside script that blocked all other things
3. OnPlayerCOmamndText should return 0 value in each FS
Reply
#3

Quote:
Originally Posted by Slawi
Посмотреть сообщение
1. Don't load FilterScript in OnGamemodeInit
2. There was a broken function inside script that blocked all other things
3. OnPlayerCOmamndText should return 0 value in each FS
I have 1 filterscript and it's my map, I don't load it in OnGamemodeInit, it can't be anything to do with my map filterscript because as I stated, these two commands worked before when I had the map in, it's something with weapon-config thats messing with it and I have no idea what. All of my other commands work as intended, it's only these two, which kill you.
Reply
#4

post here the code of weapon-config

ans show some of other commands
Reply
#5

Quote:
Originally Posted by Slawi
Посмотреть сообщение
post here the code of weapon-config

ans show some of other commands
Weapon-config is the Slice Include here: https://sampforum.blast.hk/showthread.php?tid=563387

These are two commands that are similar to the two commands I'm having issues with, in that they both deal with setting health/armor. Both work.
Код:
CMD<AD1>:shp(cmdid, playerid, params[])
{
	new targetid, amount;
    if(sscanf(params, "ui", targetid, amount)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /shp [playerid] [amount]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, NOPLAYER);
	if(LoggedIn[targetid] != true) return SendClientMessage(playerid, COLOR_RED, NOTLOGGEDIN);
	SetPlayerHealth(targetid, amount);
	new buf[150];
	format(buf, sizeof(buf), "You have set %s's health to %d.", GetName(targetid), amount);
	SendClientMessage(playerid, COLOR_RED, buf);
	return 1;
}
Код:
CMD<AD1>:sarm(cmdid, playerid, params[])
{
	new targetid, amount;
    if(sscanf(params, "ui", targetid, amount)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /sarm [playerid] [amount]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, NOPLAYER);
	if(LoggedIn[targetid] != true) return SendClientMessage(playerid, COLOR_RED, NOTLOGGEDIN);
	SetPlayerArmour(targetid, amount);
	new buf[150];
	format(buf, sizeof(buf), "You have set %s's armour to %d.", GetName(targetid), amount);
	SendClientMessage(playerid, COLOR_RED, buf);
	return 1;
}
Reply
#6

It has something to do with setting health to 0, because both of those commands work if I SetPlayerHealth to 1, but as soon as I do 0 i get the Server: Unknown Command
Reply
#7

Compile the code with debug level 3(-d3),you can find out about it in Zeex's Compiler github and post the logs here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)