Commands for rcon admin
#1

Hi!


How can I make so just rcon admins can use some commands?..

1 one Msn told me 1 time but I forgot :/ thanks.
Reply
#2

check
Код:
if(!IsPlayerAdmin(playerid)) return 0;
Reply
#3

Thanks alot! and for fast reply!!.. But I mean something to put the cmds under some script line and the accounts must
have rcon acces...
Sorry for bad explain but hard to explain.. Btw it maybe work with that u said..
Reply
#4

I think that would work, it checks to see if the player is an administrator, RCON in this case.
Reply
#5

if(IsPlayerAdmin(playerid)) returns 1 if the player is logged into the RCON.

so just ask

Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFF, "** You are not logged into the RCON. You can't use this command.");
Reply
#6

Quote:
Originally Posted by TheDominator
Посмотреть сообщение
I think that would work, it checks to see if the player is an administrator, RCON in this case.
Yes I would edit but u came to fast but np!! .
But I should say like this:

if(!IsPlayerAdmin(playerid))
{
GivePlayerWeapon

Don't complain about if there are errors in my example because just example and didn't check for errors etc..
Reply
#7

pawn Код:
CMD:command(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You are not logged into Rcon"); // Sends client message that he is not logged into rcon
GivePlayerWeapon(playerid,38,500); // Gives player weapon if he is logged into RCON
return 1;
}
Reply
#8

Yes you must always use
pawn Код:
if(!IsPlayerAdmin(playerid))
before anything else or it would load the code first and then check if your RCON.
Reply
#9

Okay thanks alot!.
Reply
#10

Quote:
Originally Posted by TheDominator
Посмотреть сообщение
Yes you must always use
pawn Код:
if(!IsPlayerAdmin(playerid))
before anything else or it would load the code first and then check if your RCON.
The ! returns No
Reply
#11

Where should I put commands? Because I'm making a fs..
I mean how can I make so I'm not got weapon directly when I login.. Just get them with
a command.. Hmm I think how..


Does it works with this:

pawn Код:
public OnFilterScriptInit()
{

    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}
    public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/weapon", cmdtext, true, 10) == 0)
    {
        CMD:command(playerid,params[])  if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You are not logged into Rcon"); // Sends client message that he is not logged into rcon
        GivePlayerWeapon(playerid,38,500); // Gives player weapon if he is logged into RCON
    }
    return 0;
}
public OnFilterScriptExit()
{
    return 0;
}

#else
#endif
But I don't get any weapon... Idk if it will work like that my first FS xD..
Reply
#12

It seems as if your using strcmp and Zcmd to use for commands which isn't possible, what you should try is:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/weapon", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid,-1,"You are not logged into Rcon"); //    Sends client message that he     is not logged into rcon
        GivePlayerWeapon(playerid,38,500); // Gives player weapon if he is logged into RCON
        return 1;
    }
    return 0;
}
I am sorry if it doesn't work but at the moment I am unable to test it due to the fact that my GTA_SA has suddenly decided it wants to crash.
Reply
#13

Quote:
Originally Posted by TheDominator
Посмотреть сообщение
It seems as if your using strcmp and Zcmd to use for commands which isn't possible, what you should try is:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/weapon", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerAdmin(playerid))
        return SendClientMessage(playerid,-1,"You are not logged into Rcon"); //    Sends client message that he     is not logged into rcon
        GivePlayerWeapon(playerid,38,500); // Gives player weapon if he is logged into RCON
        return 1;
    }
    return 0;
}
I am sorry if it doesn't work but at the moment I am unable to test it due to the fact that my GTA_SA has suddenly decided it wants to crash.
Okay thanks alot!! . I hope it will help.

Edit didn't workt .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)