Making a command to display command.
#1

I am very new to all of the PAWN scripting so yes I am a big noob. Now I have seen that on some servers there is a command like /cmds or /commands that will show all of the servers commands. I was wondering how I would go about making such a script.

I have a few commands that I would like to add to it like: /help /heal /kill and a few more eventually.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/help", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid, COLOR_1, "Welcome to my server Drifting Legends, I hope you enjoy your stay.");
		SendClientMessage(playerid, COLOR, "If you require any assistance then don't hesitate to ask our administrators.");
		return 1;
	}
	if (strcmp("/heal", cmdtext, true, 10) == 0)
	{
		SetPlayerHealth(playerid, 100);
		SendClientMessage(playerid, COLOR, "Your health has been successfully restored.");
		return 1;
	}
	if (strcmp("/kill", cmdtext, true, 10) == 0)
	{
	   SetPlayerHealth(playerid, 0);
	   return 1;

    }

	return 0;
}
I know I am not using zcmd or anything like that but I want to learn everything the easy way as I am a beginner.

Any assistance would be greatly appreciated and would earn you +Reputation for your account.
Reply


Messages In This Thread
Making a command to display command. - by TheDominator - 22.02.2012, 17:02
Re: Making a command to display command. - by ttloko2 - 22.02.2012, 17:43
Re: Making a command to display command. - by TheDominator - 22.02.2012, 17:47
Re: Making a command to display command. - by sniperwars - 09.03.2012, 22:06
Re: Making a command to display command. - by rangerxxll - 10.03.2012, 00:25

Forum Jump:


Users browsing this thread: 1 Guest(s)