Admin cmd
#1

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;
}
Reply
#2

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
Reply
#3

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

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

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.
Reply
#6

yes, i have the cmds in the fs
Reply
#7

im using LuxAdmin system
Reply
#8

Is it all in same filterscript or seperate?
Reply
#9

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
Reply
#10

Where to put #define and #include ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)