Word replace thing
#1

I have this code
Code:
	if(strcmp(cmd, "/radio", true) == 0 || strcmp(cmd, "/r", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[256];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/r)adio [radio chat]");
				return 1;
			}
			switch (PlayerInfo[playerid][pMember])
			{
			    case 1:
			    {
			        format(string, sizeof(string), "** %s %s: %s, over. **", GetPlayerRank(playerid),PlayerName(playerid), result);
			        SendRadioMessage(1, TEAM_BLUE_COLOR, string);
                    PlayerPlaySound(playerid,2607, 0.0, 0.0, 10.0);
					format(string, sizeof(string), "[Radio] %s, over.", result);
					SetPlayerChatBubble(playerid,string,COLOR_WHITE,30.0,10000);
			    }
What i need is when some word like 10-4 Is written in /radio , Like if we do "/radio 10-4" It should be replaced by some word like "got it" how can i do this, thanx million in advnace
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)