Jump to content

Scripting - Multiple commands


Rolyy

Recommended Posts

I might not be good here for asking help about scripting but I got no where to post or get help.. =\

And I am truely thankfull if someone could help me out with adding multiple commands.

Example: a peace of coding that has made..

if (strcmp("/command", cmdtext, true, 10) == 0)
{
	SendClientMessage(playerid,COLOR_WHITE,"The text appears after the command...");
	return 1;
}

Example: This is what i sort of want. but this AINT RIGHT and I want to know how to do it right..

if (strcmp("/command1" || "/command2 || "/command3" , cmdtext, true, 10) == 0)
{
	SendClientMessage(playerid,COLOR_WHITE,"The text appears after the command...");
	return 1;
}

I am Really thankfull if smoeone could help me out.

Sorry agian for possible wrong posting :?

Link to comment

MTA commands are created with addCommandHandler.

Your problem can be fixed by doing something like this:

function myFunction(player, command, argument)
-- do.. well, whatever
end
 
addCommandHandler("cake",    myFunction)
addCommandHandler("pie",     myFunction)
addCommandHandler("muda-da", myFunction)

Also, uh... there is a whole subforum named "Scripting", and you still posted it here?

Link to comment

Hey hey instead of moving to SA-MP, go here. It's better. I played SA-MP too before, but this one's my choice. ;)

Go here for wiki: https://wiki.multitheftauto.com/wiki/Main_Page

You'll find it easier to script here.

Btw, the scripting language is "LUA" in MTA SA and "PAWN" which is used on SA-MP. Remember that.

Anyway, don't hesitate to ask, 50p was one of the good scripter here, he could help you in any way. ;) Everyone else is kind at helping too. :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...