All pastes #1353117 Raw Edit

Something

public c v1 · immutable
#1353117 ·published 2009-03-05 01:03 UTC
rendered paste body
  	if(strcmp(cmd, "/local", true) == 0 || strcmp(cmd, "/l", true) == 0)	{	    if(IsPlayerConnected(playerid))	    {			new length = strlen(cmdtext);			while ((idx < length) && (cmdtext[idx] <= ' '))			{				idx++;			}			new offset = idx;			new result[128];			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))			{				result[idx - offset] = cmdtext[idx];				idx++;			}			result[idx - offset] = EOS;			if(!strlen(result))			{				SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "(/l)ocal [message]");				return 1;			}			format(string, sizeof(string), "%s says: %s", GetPlayerNameEx(playerid), result);			ProxDetector(3.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);		}		return 1;	}   	if(strcmp(cmd, "/shout", true) == 0 || strcmp(cmd, "/s", true) == 0)	{	    if(IsPlayerConnected(playerid))	    {			new length = strlen(cmdtext);			while ((idx < length) && (cmdtext[idx] <= ' '))			{				idx++;			}			new offset = idx;			new result[128];			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))			{				result[idx - offset] = cmdtext[idx];				idx++;			}			result[idx - offset] = EOS;			if(!strlen(result))			{				SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "(/s)hout [message]");				return 1;			}			format(string, sizeof(string), "%s shouts: %s", GetPlayerNameEx(playerid), result);			ProxDetector(3.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);		}		return 1;	}	if(strcmp(cmd, "/whisper", true) == 0 || strcmp(cmd, "/w", true) == 0)	{	    if(IsPlayerConnected(playerid))	    {			tmp = strtok(cmdtext, idx);			if(!strlen(tmp))			{				SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "(/w)hisper [playerid] [message]");				return 1;			}			giveplayerid = ReturnUser(tmp);			if (IsPlayerConnected(giveplayerid))			{			    if(giveplayerid != INVALID_PLAYER_ID)			    {					new length = strlen(cmdtext);					while ((idx < length) && (cmdtext[idx] <= ' '))					{						idx++;					}					new offset = idx;					new result[128];					while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))					{						result[idx - offset] = cmdtext[idx];						idx++;					}					result[idx - offset] = EOS;					if(!strlen(result))					{						SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "(/w)hisper [playerid] [message]");						return 1;					}					if (ProxDetectorS(3.0, playerid, giveplayerid))					{						if(giveplayerid != playerid)						{							format(string, sizeof(string), "%s whispers: %s", GetPlayerNameEx(playerid), result);							SendClientMessage(giveplayerid, COLOR_YELLOW, string);							SendClientMessage(playerid, COLOR_YELLOW, string);							PlayerActionMessage(playerid,5.0,"whispers something.");						}						else						{						SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"You cant whisper yourself.");						}					}					else					{							SendClientMessage(playerid,COLOR_LIGHTYELLOW2," You are not close enough to that person.");					}					return 1;				}			}			else			{					format(string, sizeof(string), "No player with the ID %d is connected.", strval(tmp));					SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string);			}		}		return 1;	}