Making the command only for a group
#4

Did you mean something like this.
Код:
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

#if defined FILTERSCRIPT

#define ORANGE 			0xF97804FF

#endif

new Gate,
    bool:Open;
    
//Single gate
public OnFilterScriptInit()
{
    Gate = CreateObject(989,1428.6284, 241.9930, 20.3020,359.2969, 0.7000, 172.9962, 0.0);
    return 1;
}
GROUP_ADD<9>
{
@YCMD:gate;
}


CMD:gate(playerid,params[])
{
	if (group[playerid] == 9)
	{
    if(IsPlayerInRangeOfPoint(playerid,10,1428.6456, 242.0033, 20.3020))
    {
        switch(Open)//Check whether the gate opened or closed
        {
            case true://If the gate opened
            {
                MoveObject(Gate,1428.6456, 242.0033, 20.3020,4);//Close the gate
                Open = false;//false for closed
            }
            case false://If the gate closed
            {
                MoveObject(Gate,1426.5259, 237.4716, 20.3020,4);//Open the gate
                Open = true;//true for opened
            }
        }
        return 1;
    }
    SendClientMessage(playerid,ORANGE,"You're not close enough to the gate.");//Send error message if player isn't near any gate
    return 1;
}
Sorry i'm not a very advanced scripter
Reply


Messages In This Thread
Making the command only for a group - by Joshswag - 07.11.2012, 10:14
Re: Making the command only for a group - by Deaglez - 07.11.2012, 10:22
Re: Making the command only for a group - by Joshswag - 07.11.2012, 10:31
Re: Making the command only for a group - by Joshswag - 08.11.2012, 05:32
Re: Making the command only for a group - by Plovix - 08.11.2012, 11:22
Re: Making the command only for a group - by Joshswag - 08.11.2012, 15:51

Forum Jump:


Users browsing this thread: 2 Guest(s)