/ooc chat command plz
#1

hy ppl i need the /ooc chat command

only for admins

/o ---> ((SpLoOsH))

this should look

tnx
Reply
#2

As goes for the cnnn command,

Every RP script has it, Get it of there :P
Reply
#3

Reply
#4

Hi!
Код:
#include <a_samp>
#include <a_samp>
#include <dudb>
#include <dutils>
#include <file>
#include <time>
#include <utils>

#define COLOR_GRAD2 0xBFC0C2FF
public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[256];
  new string[256];
  new giveplayer[MAX_PLAYER_NAME];
  new idx, giveplayerid;
  new sendername[MAX_PLAYER_NAME];
	if(strcmp(cmd, "/b", true) == 0)//helyi ooc
	{
	  if(IsPlayerConnected(playerid))
	  {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[63];
  			if(length > 63)
			{
			  while ((idx < 63) && ((idx - offset) < (sizeof(result) - 1)))
				{
				result[idx - offset] = cmdtext[idx];
				idx++;
				}
  			format(string, sizeof(string), "%s ooc: (( %s... ))", sendername, result);
				result[idx - offset] = EOS;
			}
			else
			{
				while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
				{
					result[idx - offset] = cmdtext[idx];
					idx++;
				}
				result[idx - offset] = EOS;
				format(string, sizeof(string), "%s ooc: (( %s ))", sendername, result);
			}
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /b [ooc text here]");
				return 1;
			}
			printf("%s", string);
		}
		return 1;
	}
	return 0;
}
3 Warning :S But working
Reply
#5

Код:
new cmd[256];
new string[256];
new idx;
new sendername[MAX_PLAYER_NAME];
  
// --============ OOC ===========-- //
  
if(strcmp(cmd, "/o", true) == 0)//helyi ooc
{
	if(IsPlayerConnected(playerid))
	{
		GetPlayerName(playerid, sendername, sizeof(sendername));
		new length = strlen(cmdtext);
		while ((idx < length) && (cmdtext[idx] <= ' '))
		{
			idx++;
		}
		new offset = idx;
		new result[63];
		if(length > 63)
		{
			while ((idx < 63) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			format(string, sizeof(string), "%s ooc: (( %s... ))", sendername, result);
			result[idx - offset] = EOS;
		}
		else
		{
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			format(string, sizeof(string), "%s ooc: (( %s ))", sendername, result);
		}
		if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /o [OOC text here]"); return 1;
			}
		printf("%s", string);
	}
	return 1;
}
That code should give you no warnings at all.
Reply
#6

"May 31, 2009"

nice bump, lol.
Reply
#7

Quote:
Originally Posted by //exora
"May 31, 2009"

nice bump, lol.
You never know, it might help someone.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)