Problem with /o cmd ...
#1

This is my FS:
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Blank Filterscript by your name here");
	print("--------------------------------------\n");
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(gPlayerLogged[playerid] == 0)
	    {
	      SendClientMessage(playerid, COLOR_GREY, "  You havent logged in yet !");
	      return 1;
	    }
			if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "  The OOC channel has been disabled by an Admin !");
				return 1;
			}
			if(PlayerInfo[playerid][pMuted] == 1)
			{
				SendClientMessage(playerid, TEAM_CYAN_COLOR, "  You can't speak, you have been silenced !");
				return 1;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/o)oc [ooc chat]");
				return 1;
			}
			format(string, sizeof(string), "(( %s: %s ))", sendername, result);
			OOCOff(COLOR_OOC,string);
			printf("%s", string);
		}
		return 1;
	}
	if(strcmp(cmd, "/noooc", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if (PlayerInfo[playerid][pAdmin] >= 3 && (!noooc))
			{
				noooc = 1;
				BroadCast(COLOR_GRAD2, "  OOC chat channel disabled by an Admin !");
			}
			else if (PlayerInfo[playerid][pAdmin] >= 3 && (noooc))
			{
				noooc = 0;
				BroadCast(COLOR_GRAD2, "  OOC chat channel enabled by an Admin !");
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");
			}
		}
		return 1;
	}
	if(strcmp(cmd, "/speedo", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if (gSpeedo[playerid] == 1)
			{
				gSpeedo[playerid] = 2;
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~on", 5000, 5);
				PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
			}
			else if (gSpeedo[playerid] == 2)
			{
				gSpeedo[playerid] = 1;
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~r~off", 5000, 5);
				PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "you dont have a speedometer");
			}
		}
		return 1;
	}
	if(strcmp(cmd, "/fuel", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if (gGas[playerid] == 0)
			{
				gGas[playerid] = 1;
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~g~Fuel Info on", 5000, 5);
				PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
			}
			else if (gGas[playerid] == 1)
			{
				gGas[playerid] = 0;
				GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~r~Fuel Info off", 5000, 5);
				PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
			}
		}
		return 1;
	}
  return 0;
}
#endif
It compiled away the game but it says that the SERVER: UNKNOW CODE .
I USE TRANSLATOR -.-
Reply
#2

you have to define the cmd,why just not adding it to your GM Under onplayercommandtext?
Reply
#3

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)

Where did you defined ''cmd''?
Reply
#4

i edited cmd to cmdtext , same problem...
Reply
#5

Quote:
Originally Posted by Renn47
i edited cmd to cmdtext , same problem...
No, as cmdtext is defined into the system, cmd isn't.
Reply
#6

butt cmd is not woorkiing :S
Reply
#7

Quote:
Originally Posted by Renn47
butt cmd is not woorkiing :S
Because you need to change the 'cmd' to 'cmdtext'
Reply
#8

Changed .. still does not work
Reply
#9

May I suggest asking in your own language in one of the boards at the bottom of the forums.
Reply
#10

estonians are a few here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)