[HELP]Commands
#1

Can someone give a tutorial where to learn how to make simple commands ? I want to learn , I searched and I couldn't find .
Reply
#2

It dependes of what kind of command do you want to learn?...

But, check this out.
Код:
if(strcmp(cmd, "/gotols", true) == 0)
{
	if(IsPlayerConnected(playerid))
 	{
		SetPlayerPos(playerid, 1529.6,-1691.2,13.3);
		SendClientMessage(playerid, COLOR_GRAD1, "You have been teleported !");
		SetPlayerInterior(playerid,0);
		return 1;
	}
}
This command will teleport you to LS, you can chagne "/gotols" to what kind of command you would like to.
At SetPlayerPos... you have x,y,z pretty much as 3D, you need to change it for your x,y,z by /save while you're in your server.
At the position you would like to teleport there... This command is only for teleporting, but I hope you will learn more.
Reply
#3

Hmm yeah . But if I want to add the command to work only for an 101 admin level ?

And how about give me an example of spawning a car or something ?!

BTW : THANK YOU !
Reply
#4

You can read the WIKI for the available functions. Also, in order to make an admin command, you need to see what are you using to DEFINE someone that is admin. For example search for an admin and look what is it defining.

Example:
pawn Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000, "You are not an admin.");
The "IsPlayerAdmin" is the define in this example.
Reply
#5

To put a player in a car (don't know if you want a command to spawn or a command to put a player into any car.) (Basically the same.) But anyway here:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/mycommand", cmdtext, true, 10) == 0)
	{
		PutPlayerInVehicle(0, 562, 1);
		return 1;
	}
	return 0;
}
		return 1;
	}
	return 0;
}
Not sure if it would work but just try it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)