Command help.
#1

I'm having a problem, i downloaded an gamemmode, all commands are with ''!'' not with ''/'' It uses dutils.inc.
Can you help me? How can i get ''/''
Reply
#2

Guess you'll have to change all the ! to / then ?
Reply
#3

I tried it already, then it says ''Unknown command''.
Reply
#4

Can you show us an example command ?
Reply
#5

Код:
public OnPlayerText(playerid, text[])
{
    new cmd[256], tmp[256], idx;

	cmd = strtok(text, idx);
	tmp = strtok(text, idx);
	if(strcmp(cmd, "!makeadmin", true) == 0)
	{
		if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, White, "Console: You're not authorised to use"), SendClientMessage(playerid, White, "this command");
		if(!strlen(tmp)) return SendClientMessage(playerid, White, "Console: {FF0000}Usage: {FFFFFF}!makeadmin [playerid]");
		if(!IsPlayerConnected(strval(tmp))) return SendClientMessage(playerid, White, "Console: {FF0000}Invalid{FFFFFF} player id!");
		if(IsAdmin(strval(tmp))) return SendClientMessage(playerid, White, "Console: The player is already Admin.");
		new other = strval(tmp);
		new otherip[200], file[200], name[128], oname[128];
		new afor[128], ofor[128];
		GetPlayerIp(other, otherip, sizeof(otherip));
		GetPlayerName(playerid, name, sizeof(name));
		GetPlayerName(other, oname, sizeof(oname));
		format(file, sizeof(file), aFile, otherip);
		format(afor, sizeof(afor), "{FFFFFF}Console: You've promote {33FF33}%s [IP: %s]{FFFFFF} to Admin", oname, otherip);
		format(ofor, sizeof(ofor), "{FFFFFF}Console: You've been promote to Admin by {33FF33}Rcon %s", name);
		file_create(file);
		SendClientMessage(playerid, White, afor);
		SendClientMessage(other, White, ofor);
		return 1;
{
Reply
#6

Why are the commands under OnPlayerText ?

They should be under OnPlayerCommandText.

Now try changing them to / and see if it works.
Reply
#7

Okay.

EDIT : Got it, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)