Is this correct? CB does not work
#1

Hello there, I made a custom command for a CB Radio. How can I make it available for only certain vehicle ID's, such as Roadtrain and Linerunner?
And why does it come up with SERVER: Unknown command when I do /cb message? When I type /cb, it works, it comes up, but no /cb [text]

Help would be appreciated, here is the code:

Код:
		if(!strcmp(cmdtext, "/cb", true, 4)) // 3 is the length of /cb
	{
	  if(!cmdtext[3]) return SendClientMessage(playerid, COLOR_GREY, "UŻYCIE: /cb [wiadomosc]");
    new string[128], name[16];
	  GetPlayerName(playerid, name, sizeof(name));
	  format(string, 128, "*** CB RADIO ~~ %s mуwi: %s", name, cmdtext[4]);
	  SendClientMessageToAll(FIOLETOWY, string);
	  return 1;
	}
Thanks and Regards
Puzi
Reply
#2

Use a command processor like DCMD.
Reply
#3

All of my commands are in this format, Im worried that it may affect other commands.

And commands such as /me and /og run on the same basis and they work
Reply
#4

Use strmid function...
Part of my CB script:
Код:
	else if(strcmp(cmd,"/cb",true)==0)
	{
		new pName[MAX_PLAYER_NAME], message[128];
		new tmp[256];
		strmid(tmp, cmdtext, 4, strlen(cmdtext));
		if(!strlen(tmp))
		{
			SendClientMessage(playerid,COLOR_GREY,"USAGE: /cb [text], change channel with /channel [channel]");
			return 1;
		}
		GetPlayerName(playerid,pName,sizeof(pName));
		format(message,sizeof(message),"CB[%d] %s: %s",CBCanal[playerid],pName,tmp);
use it to figure out how to make it.
Reply


Forum Jump:


Users browsing this thread: