Command help! Easy for pro's!
#1

Ok, I have a simple MoveObject command, it works really good, nothing bad with it, but how can I do so ONLY names that I write in the script can use the command?

This is for a clan, an example:

I am logged into RCON with name Admin, I type

"/opengarage" - "ERROR: Unknown command"

Then I log into normal with a name like ClanMember1, then I type the same
"/opengarage" - "Garage is opening" then it opens.

How can I do it? Here is the code:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/GarageOpen", true)==0)
	{
	  MoveObject (door, 1460.2858886719, -2214.7924804688, 8.5460910797119, 5);
	  SendClientMessage(playerid, 0x0000000F, "Clan garage is now opening");
	  return 1;
	}
	  if (strcmp(cmdtext, "/GarageClose", true)==0)
	{
	  MoveObject (door, 1460.2858886719, -2214.7924804688, 14.546091079712, 5);
	  SendClientMessage(playerid, 0x0000000F, "Clan garage is now closing.");
	  return 1;
	}
	  return 0;
}
I don't want everybody to open it. Let's say I add a list with ClanMember1, Owner23232, Mark142432323, Gangster2323323 and the list goes on

Can someone help me? I have searched the whole forum and can't find it.

Here is the WHOLE script.

Код:
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT

//new hall;
new door;
//new door_closed; Used for the closed position
//new door_open; Used for rhe open position

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print("      Dave's clan garage enabled      ");
	print("--------------------------------------\n");
	CreateObject(8947, 1448.0778808594, -2214.7619628906, 15.599655151367, 0.000000, 0.000000, 90); //hall
	door = CreateObject(16773, 1460.2858886719, -2214.7924804688, 14.546091079712, 0.000000, 0.000000, 90); //door
	//door_closed = CreateObject(16773, 1460.2858886719, -2214.7924804688, 14.546091079712, 0.000000, 0.000000, 90); //door_closed
	//door_open = CreateObject(16773, 1460.2858886719, -2214.7924804688, 8.5460910797119, 0.000000, 0.000000, 90); //door_open
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else
#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, "/GarageOpen", true)==0)
	{
	  MoveObject (door, 1460.2858886719, -2214.7924804688, 8.5460910797119, 5);
	  SendClientMessage(playerid, 0x0000000F, "Clan garage is now opening");
	  return 1;
	}
	  if (strcmp(cmdtext, "/GarageClose", true)==0)
	{
	  MoveObject (door, 1460.2858886719, -2214.7924804688, 14.546091079712, 5);
	  SendClientMessage(playerid, 0x0000000F, "Clan garage is now closing.");
	  return 1;
	}
	  return 0;
}
Just add 4 names as default, then I will find out how to add.

Add so the name "Dave/dave" may open, then "Kayla" or "kayla", "jack" and "jacket". But make so peoples name can be like mYnAME and MyName.
Reply


Messages In This Thread
Command help! Easy for pro's! - by Kidel - 24.06.2010, 17:37
Re: Command help! Easy for pro's! - by Kidel - 24.06.2010, 17:45
Re: Command help! Easy for pro's! - by Kidel - 24.06.2010, 17:51
Re: Command help! Easy for pro's! - by billiout - 24.06.2010, 17:58
Re: Command help! Easy for pro's! - by MastahServers - 24.06.2010, 18:00
Re: Command help! Easy for pro's! - by Kidel - 24.06.2010, 18:02
Re: Command help! Easy for pro's! - by Kidel - 24.06.2010, 18:03
Re: Command help! Easy for pro's! - by billiout - 24.06.2010, 18:05
Re: Command help! Easy for pro's! - by Kidel - 24.06.2010, 18:07
Re: Command help! Easy for pro's! - by MastahServers - 24.06.2010, 18:09

Forum Jump:


Users browsing this thread: 2 Guest(s)