[HELP] COmmand
#1

Ok how can i make a Command so when they type in a command thats not in my server instead of Unknow command i want it to say


SendClientMessage(playerid,COLOR_GREY,"Sorry Command not found in NatiosnRoleplay database.");

Thanks please tell me

Reply
#2

Look for the 'return 0':
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  // your commands.
  return 0;
}
and replace it with your message:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  // your commands.
  return SendClientMessage(playerid,COLOR_GREY,"Sorry Command not found in NatiosnRoleplay database.");
}
Reply
#3

No like if they type a command in thats not in my gm instead of it saying Unkown command i want it to say public // your commands.
return SendClientMessage(playerid,COLOR_GREY,"Sorry Command not found in NatiosnRoleplay database.");
}
Reply
#4

I already gave you the code which you're looking for.
Reply
#5

Ok so i put it at the end of my commands?
Reply
#6

Yes.
Reply
#7

ok i did dat but when i type a command and its there its says Sorry command not found in Database but it works the command
Reply
#8

I guess you didn't understand it.

Here's another example:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/mycommand_1", true) == 0)
  {
    // command's code.
    return 1;
  }
  if(strcmp(cmdtext, "/mycommand_2", true) == 0)
  {
    // command's code.
    return 1;
  }
  if(strcmp(cmdtext, "/mycommand_3", true) == 0)
  {
    // command's code.
    return 1;
  }
  return SendClientMessage(playerid,COLOR_GREY,"Sorry Command not found in NatiosnRoleplay database.");
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)