/ooc chat command plz
#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


Messages In This Thread
/ooc chat command plz - by sploosh013 - 31.05.2009, 09:58
Re: /ooc chat command plz - by JoeDaDude - 31.05.2009, 09:59
Re: /ooc chat command plz - by sploosh013 - 31.05.2009, 10:02
Re: /ooc chat command plz - by The Modder - 31.05.2009, 22:42
Re: /ooc chat command plz - by Haegon - 21.07.2009, 08:11
Re: /ooc chat command plz - by woot - 21.07.2009, 08:28
Re: /ooc chat command plz - by Haegon - 21.07.2009, 15:31

Forum Jump:


Users browsing this thread: 1 Guest(s)