Need help with /admins, RCON and also text colours.
#1

Hey hey,

Can anyone teach me how to make an /admins command? I'm not a bad scripter, but I've got problems with this. I'm admin in-game, and typing ''/ban'' but it says: ''/ban : you're not an admin'' (from RCON). How do I disable that?

I'm not a bad scripter but got problems with the names and text colours...

Код:
dcmd_banip(playerid, params[])
{
	new index = 0;
  tmp2 = strtok(params, index);
	if (pInfo[playerid][pAdmin] == 3)
	{
		SystemMessage(playerid, "You are not an Administrator.");
		return 1;
	}
  if(!strlen(tmp2))
	{
		SystemMessage(playerid, "Correct usage: '/banip [playername] [reason]'");
		return 1;
	}
	new string[MAX_STRING];
	new second, minute, hour, day, month, year;
	giveplayerid = ReturnUser(tmp2);
	if (IsPlayerConnected(giveplayerid))
	{
		format(string, sizeof(string), "You have been IP banned by Administrator %s. (Reason: '%s')", PlayerName(playerid), params);
		SendClientMessage(giveplayerid, COLOR_SYSTEM, string);
		format(string, sizeof(string), "Player %s has been IP banned by Administrator %s. (Reason: '%s')", PlayerName(giveplayerid), PlayerName(playerid), params);
		SendClientMessageToAll(COLOR_SYSTEM, string);
		format(string, sizeof(string), "%s has been IP banned by Administrator %s. (Reason: '%s')", PlayerName(giveplayerid), PlayerName(playerid), params);
		print(string);
		gettime(hour, minute, second);
		getdate(year, month, day);
		format(string,sizeof(string),"Player %s IP banned player %s on %d/%d/%d at %d:%d:%d. (Reason: '%s')", PlayerName(playerid), PlayerName(giveplayerid), month, day, year, hour, minute, second, params);
		ServerLog(string);
		BanPlayer(giveplayerid, "");
  }
  	else
  {
		SendClientMessage(playerid, COLOR_SYSTEM, "That player is not active.");
	}
  return 1;
}
Can someone tell me how to change the text colour? Default is red. And I want it in an other colour, where do I put the ''DEFINE_COLOUR'' ? Please explain.
Reply


Messages In This Thread
Need help with /admins, RCON and also text colours. - by Andy_McKinley - 20.11.2009, 18:35
Re: Need help with /admins, RCON and also text colours. - by bigcomfycouch - 20.11.2009, 22:44
Re: Need help with /admins, RCON and also text colours. - by ExoSanty - 21.11.2009, 04:04

Forum Jump:


Users browsing this thread: 1 Guest(s)