SA-MP Forums Archive
Admin cmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Admin cmd (/showthread.php?tid=158389)



Admin cmd - RatHack - 09.07.2010

Hi people

i need to put this commands for level 2 or more

Код:
PublicOnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/opengates", cmdtext, true, 10) == 0)
	{
		MoveObject(gate1,-291.833282, 1507.330078, 76.069191,2.0);
		MoveObject(gate2,-312.522491, 1506.881470, 76.070045,2.0);
		return 1;
	}
	
	if (strcmp("/closegates", cmdtext, true, 10) == 0)
	{
		MoveObject(gate1,-298.333282, 1507.330078, 76.069191,2.0);
		MoveObject(gate2,-306.222504, 1506.931519, 76.070045,2.0);
		return 1;
	}
	return 0;
}



Re: Admin cmd - oliverrud - 09.07.2010

pawn Код:
PublicOnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/opengates", cmdtext, true, 10) == 0)
    {
            if(PlayerAccount[playerid][Admin] >= 2)
            {
        MoveObject(gate1,-291.833282, 1507.330078, 76.069191,2.0);
        MoveObject(gate2,-312.522491, 1506.881470, 76.070045,2.0);
        return 1;
            }
    }
   
    if (strcmp("/closegates", cmdtext, true, 10) == 0)
    {
            if(PlayerAccount[playerid][Admin] >= 2)
            {
        MoveObject(gate1,-298.333282, 1507.330078, 76.069191,2.0);
        MoveObject(gate2,-306.222504, 1506.931519, 76.070045,2.0);
        return 1;
            }
    }
    return 0;
}
Replace the PlayerAccount[playerid][Admin] with your account system


Re: Admin cmd - RatHack - 09.07.2010

and the where to put? in my FS where i have the cmds?


Re: Admin cmd - oliverrud - 09.07.2010

Oh you got it in a fs? Are you using a account system? If yes is it in the fs?


Re: Admin cmd - Mauzen - 09.07.2010

pawn Код:
Public OnPlayerCommandText(playerid, cmdtext[])
Here, but you left out the space after public. This is the whole callback function, and have to be anywhere in your script.


Re: Admin cmd - RatHack - 09.07.2010

yes, i have the cmds in the fs


Re: Admin cmd - RatHack - 09.07.2010

im using LuxAdmin system


Re: Admin cmd - oliverrud - 09.07.2010

Is it all in same filterscript or seperate?


Re: Admin cmd - willsuckformoney - 09.07.2010

Quote:
Originally Posted by oliverrud
Посмотреть сообщение
pawn Код:
PublicOnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/opengates", cmdtext, true, 10) == 0)
    {
            if(PlayerAccount[playerid][Admin] >= 2)
            {
        MoveObject(gate1,-291.833282, 1507.330078, 76.069191,2.0);
        MoveObject(gate2,-312.522491, 1506.881470, 76.070045,2.0);
        return 1;
            }
    }
   
    if (strcmp("/closegates", cmdtext, true, 10) == 0)
    {
            if(PlayerAccount[playerid][Admin] >= 2)
            {
        MoveObject(gate1,-298.333282, 1507.330078, 76.069191,2.0);
        MoveObject(gate2,-306.222504, 1506.931519, 76.070045,2.0);
        return 1;
            }
    }
    return 0;
}
Replace the PlayerAccount[playerid][Admin] with your account system
do that just change what he said but place the command to move object in what ever script you have just remember to #include what you need and #define to


Re: Admin cmd - RatHack - 10.07.2010

Where to put #define and #include ?