Unknown command -
AhmedMohamed - 01.01.2019
when I use this command it works but it also says Unknown command.
Код:
command(newbie, playerid, params[])
{
new
string[128];
if(isnull(params))
{
SendClientMessage(playerid, WHITE, "SYNTAX: /n(ewbie) [message]");
}
else
{
if(NewbieEnabled == 1)
{
if(Player[playerid][ToggedNewbie] == 0)
{
if(Player[playerid][CanUseNewbie] == 1 && Player[playerid][Authenticated] >= 1)
{
if(Player[playerid][nMuted] >= 1)
{
SendClientMessage(playerid, WHITE, "You have been muted from this channel by an admin.");
}
else
{
if(Player[playerid][AdminDuty] == 0)
{
if(Player[playerid][VipLevel] >= 1)
{
format(string, sizeof(string), "{CCFFCC}VIP {00C983}%s{CCFFCC}: %s", GetName(playerid), params);
SendClientMessageToAll(NEWBIE_CHAT, string);
OOCChatLog(string);
}
else
{
if(Player[playerid][PlayingHours] < 1)
{
format(string, sizeof(string), "{CCFFCC}%s {00C983}%s{CCFFCC}: %s", OOCRanks[Rank1], GetName(playerid), params);
SendClientMessageToAll(NEWBIE_CHAT, string);
Player[playerid][CanUseNewbie] = 0;
SetTimerEx("RefreshNewbieChatForPlayer", 30000, false, "d", playerid);
}
else if(Player[playerid][PlayingHours] >= 1 && Player[playerid][PlayingHours] < 25)
{
format(string, sizeof(string), "{CCFFCC}%s {00C983}%s{CCFFCC}: %s", OOCRanks[Rank2], GetName(playerid), params);
SendClientMessageToAll(NEWBIE_CHAT, string);
Player[playerid][CanUseNewbie] = 0;
SetTimerEx("RefreshNewbieChatForPlayer", 30000, false, "d", playerid);
}
else if(Player[playerid][PlayingHours] >= 25 && Player[playerid][PlayingHours] < 100)
{
format(string, sizeof(string), "{CCFFCC}%s {00C983}%s{CCFFCC}: %s", OOCRanks[Rank3], GetName(playerid), params);
SendClientMessageToAll(NEWBIE_CHAT, string);
Player[playerid][CanUseNewbie] = 0;
SetTimerEx("RefreshNewbieChatForPlayer", 30000, false, "d", playerid);
}
else if(Player[playerid][PlayingHours] >= 100 && Player[playerid][PlayingHours] < 300)
{
format(string, sizeof(string), "{CCFFCC}%s {00C983}%s{CCFFCC}: %s", OOCRanks[Rank4], GetName(playerid), params);
SendClientMessageToAll(NEWBIE_CHAT, string);
Player[playerid][CanUseNewbie] = 0;
SetTimerEx("RefreshNewbieChatForPlayer", 30000, false, "d", playerid);
}
else if(Player[playerid][PlayingHours] >= 300)
{
format(string, sizeof(string), "{CCFFCC}%s {00C983}%s{CCFFCC}: %s", OOCRanks[Rank5], GetName(playerid), params);
SendClientMessageToAll(NEWBIE_CHAT, string);
Player[playerid][CanUseNewbie] = 0;
SetTimerEx("RefreshNewbieChatForPlayer", 30000, false, "d", playerid);
}
OOCChatLog(string);
}
}
else
{
format(string, sizeof(string), "Server Admin %s: %s", Player[playerid][AdminName], params);
SendClientMessageToAll(AQUAGREEN, string);
}
}
}
else
{
SendClientMessage(playerid, WHITE, "Please wait 30 seconds before submitting another message.");
}
}else SendClientMessage(playerid, WHITE, "You toggled off newbie chat(/tognewbie to toggle it on)");
}
else
{
SendClientMessage(playerid, WHITE, "Newbie Chat is currently unavailable.");
}
}
return 1;
}
Any problems?
Re: Unknown command -
AhmedMohamed - 01.01.2019
Any one?
Re: Unknown command -
d1git - 01.01.2019
Which command processor do you use?
Maybe consider using this instead;
https://sampforum.blast.hk/showthread.php?tid=608474
Re: Unknown command -
AhmedMohamed - 02.01.2019
It's about changing a whole system, it has 400 commands.
I am using zcmd.
Re: Unknown command -
AhmedMohamed - 02.01.2019
The problem not in the whole code:
When Player[playerid][AdminDuty](that in the else in the previous code) it works perfectly without saying unknown command, the problem is at Player[playerid][AdminDuty]==0 as specified below:
pawn Код:
if(Player[playerid][VipLevel] >= 1)
{
if(Player[playerid][VipLevel] == 1)
{
format(VipString, sizeof(VipString), "Bronze");
}
if(Player[playerid][VipLevel] == 2)
{
format(VipString, sizeof(VipString), "Silver");
}
if(Player[playerid][VipLevel] == 3)
{
format(VipString, sizeof(VipString), "Gold");
}
if(Player[playerid][VipLevel] == 4)
{
format(VipString, sizeof(VipString), "Platinum");
}
if(Player[playerid][VipLevel] == 5)
{
format(VipString, sizeof(VipString), "Crown");
}
format(string, sizeof(string), "(Newbie){CCFFCC}%s VIP {00C983}%s{CCFFCC}: %s", VipString, GetName(playerid), message);
SendClientMessageToAll(NEWBIE_CHAT, string);
OOCChatLog(string);
}
else
{
if(Player[playerid][PlayingHours] < 1)
{
format(string, sizeof(string), "(Newbie){CCFFCC}%s {00C983}%s{CCFFCC}: %s", OOCRanks[Rank1], GetName(playerid), message);
SendClientMessageToAll(NEWBIE_CHAT, string);
Player[playerid][CanUseNewbie] = 0;
SetTimerEx("RefreshNewbieChatForPlayer", 30000, false, "d", playerid);
}
else if(Player[playerid][PlayingHours] >= 1 && Player[playerid][PlayingHours] < 25)
{
format(string, sizeof(string), "(Newbie){CCFFCC}%s {00C983}%s{CCFFCC}: %s", OOCRanks[Rank2], GetName(playerid), message);
SendClientMessageToAll(NEWBIE_CHAT, string);
Player[playerid][CanUseNewbie] = 0;
SetTimerEx("RefreshNewbieChatForPlayer", 30000, false, "d", playerid);
}
else if(Player[playerid][PlayingHours] >= 25 && Player[playerid][PlayingHours] < 100)
{
format(string, sizeof(string), "(Newbie){CCFFCC}%s {00C983}%s{CCFFCC}: %s", OOCRanks[Rank3], GetName(playerid), message);
SendClientMessageToAll(NEWBIE_CHAT, string);
Player[playerid][CanUseNewbie] = 0;
SetTimerEx("RefreshNewbieChatForPlayer", 30000, false, "d", playerid);
}
else if(Player[playerid][PlayingHours] >= 100 && Player[playerid][PlayingHours] < 300)
{
format(string, sizeof(string), "(Newbie){CCFFCC}%s {00C983}%s{CCFFCC}: %s", OOCRanks[Rank4], GetName(playerid), message);
SendClientMessageToAll(NEWBIE_CHAT, string);
Player[playerid][CanUseNewbie] = 0;
SetTimerEx("RefreshNewbieChatForPlayer", 30000, false, "d", playerid);
}
else if(Player[playerid][PlayingHours] >= 300)
{
format(string, sizeof(string), "(Newbie){CCFFCC}%s {00C983}%s{CCFFCC}: %s", OOCRanks[Rank5], GetName(playerid), message);
SendClientMessageToAll(NEWBIE_CHAT, string);
Player[playerid][CanUseNewbie] = 0;
SetTimerEx("RefreshNewbieChatForPlayer", 30000, false, "d", playerid);
}
OOCChatLog(string);
}