SA-MP Forums Archive
Command help. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command help. (/showthread.php?tid=316222)



Command help. - DarkDoom09 - 05.02.2012

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 ''/''


Re: Command help. - grand.Theft.Otto - 05.02.2012

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


Re: Command help. - DarkDoom09 - 05.02.2012

I tried it already, then it says ''Unknown command''.


Re: Command help. - grand.Theft.Otto - 05.02.2012

Can you show us an example command ?


Re: Command help. - DarkDoom09 - 06.02.2012

Код:
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;
{



Re: Command help. - grand.Theft.Otto - 06.02.2012

Why are the commands under OnPlayerText ?

They should be under OnPlayerCommandText.

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


Re: Command help. - DarkDoom09 - 06.02.2012

Okay.

EDIT : Got it, thanks.