Small question(s)
#1

1. I am not sure , I didn't used from long time this.

For eg a command.

Код:
	if(strcmp(cmdtext, "/h2", true) == 0)
	{
		MoveObject(GateH,-1770.56152344,984.83020020,25.154365545, 3);
		return 1;
	}
How I make it to be just for RCON admin.

2.Is there on the forum , I didn't saw a normal , like single player clock?

Thanks in advance.
Reply
#2

Change your code to this

pawn Код:
if(strcmp(cmdtext, "/h2", true) == 0)
{
    if(IsPlayerAdmin(playerid))
    {
        MoveObject(GateH,-1770.56152344,984.83020020,25.154365545, 3);
        return 1;
    }
    else
    {
        SendClientMessage(playerid, 0xDEEE20FF, "You must be an admin to use this command");
    }
    return 1;
}
That will make the command work just for an RCON administrator that is Logged in
Reply
#3

1) Add a condition:
pawn Код:
if(IsPlayerAdmin(playerid))
{

}
2) Yes, search.

EDIT: Seems like the poster above me was earlier.
Reply
#4

About the first question:
pawn Код:
if(strcmp(cmdtext, "/h2", true) == 0)
    {
                if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You need to be logged in RCON to perform this command!");
        MoveObject(GateH,-1770.56152344,984.83020020,25.154365545, 3);
        return 1;
    }
About the clock, just search.
I'm sure you are going to find some filterscript that you like.
Reply
#5

EDIT:
Omg 3 guys beat me xD

Use the 'IsPlayerAdmin(playerid)':
pawn Код:
if(strcmp(cmdtext, "/h2", true) == 0)
{
    if(!IsPlayerAdmin(playerid)) return 0; //Return a 'SERVER: Unknown command' (or user defined if you did that) if the player's not an admin
    MoveObject(GateH,-1770.56152344,984.83020020,25.154365545, 3);
    return 1;
}
Single player clock can be turned on/off with TogglePlayerClock(playerid, toggle);
Reply
#6

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
EDIT:
Omg 3 guys beat me xD

Use the 'IsPlayerAdmin(playerid)':
pawn Код:
if(strcmp(cmdtext, "/h2", true) == 0)
{
    if(!IsPlayerAdmin(playerid)) return 0; //Return a 'SERVER: Unknown command' (or user defined if you did that) if the player's not an admin
    MoveObject(GateH,-1770.56152344,984.83020020,25.154365545, 3);
    return 1;
}
Single player clock can be turned on/off with TogglePlayerClock(playerid, toggle);
Lol, I completely forgot about that function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)