Command problem
#1

Hello guys!
I have a problem with a command. I've coded a VIP system for my server with some new commands and also, I've introduced a /vipchat command. Because I didn't want to waste time, I've copied the /adminchat command and just replaced some lines. The problem is that when I use /vipchat in game, it does work, but it is also followed by the "SERVER: Unknown command" message and I just don't understand why. Bellow is the script, please help me.
Thanks in advance!



Код:
//===============================================================================================//
	if(strcmp(cmd, "/vipchat", true) == 0 || strcmp(cmd, "/vc", true) == 0 || strcmp(cmd, "/vchat", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_WHITE, "You havent logged in yet");
	            return 1;
	        }
  			if (PlayerInfo[playerid][pVIP]==0 && PlayerInfo[playerid][pAdmin] < 1)
			{
				SendClientMessage(playerid, COLOR_WHITE, "You are not a VIP member");
				return 1;
			}
			if(PlayerInfo[playerid][pMuted] == 1)
			{
				SendClientMessage(playerid, TEAM_CYAN_COLOR, "You can't speak, you have been silenced");
				return 1;
			}
			new result[64];
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GREY, "USAGE: /(v)ip©hat [text]");
				return 1;
			}
			format(string, sizeof(string), "{FFFFFF}» {F3FF02}[VIP CHAT] %s: {FFFFFF}%s", sendername, result);
			for(new i=0; i<=MAX_PLAYERS; i++) {
				if(PlayerInfo[i][pVIP]==1)
				  SendClientMessage(i, -1, string);
			}
						
		}
		 return 1;
	}
//===============================================================================================//
Reply


Messages In This Thread
Command problem - by rraulinio - 12.10.2014, 10:37
Re: Command problem - by Stinged - 12.10.2014, 10:38
Re: Command problem - by rraulinio - 12.10.2014, 10:40
Re: Command problem - by XGreen - 12.10.2014, 10:42
Re: Command problem - by MrJunkiTM - 12.10.2014, 10:43
Re: Command problem - by rraulinio - 12.10.2014, 10:46
Re: Command problem - by Stinged - 12.10.2014, 10:51
Re: Command problem - by XGreen - 12.10.2014, 10:51
Re: Command problem - by rraulinio - 12.10.2014, 10:52
Re: Command problem - by dominik523 - 12.10.2014, 13:27

Forum Jump:


Users browsing this thread: 2 Guest(s)