SendClientMessage --> Only For Admin [HELP]
#1

Hi, i can't find this thing.

So I have /help command in wich normal player (not admin) can see all available commands. I know how to do that.

So it looks like:

pawn Код:
if (strcmp("/pomoc", cmdtext, true, 10) == 0)
        {
            SendClientMessage(playerid, 0xFFFFFFFF, "mycommands  xD");
        }
And now i want to do in next line SendClientMessage wich check if is admin on RCON login. If he is, he can see another line when he type /help like this:
pawn Код:
if (strcmp("/pomoc", cmdtext, true, 10) == 0)
        {
            SendClientMessage(playerid, 0xFFFFFFFF, "mycommands  xD");
            SendClientMessage(playerid, 0xFFFFFFFF, "ADMIN Cmds: i don't know how to do that thing");
        }
So i don't know how to do that second SendClientMessage , and that line must be only visible for RCON admins.
I mean if the player is /rcon login 55555 he can se this second SendClientMessage

Anyone can help me?
Reply
#2

pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, 0xFFFFFFFF, "Administrator commands goes here.");
Reply
#3

Ok, i just tried that but i get few errors and warning :P

Код:
F:\SAMP SERVER\gamemodes\grandlarc.pwn(1975) : error 017: undefined symbol "PlayerInfo"
F:\SAMP SERVER\gamemodes\grandlarc.pwn(1975) : warning 215: expression has no effect
F:\SAMP SERVER\gamemodes\grandlarc.pwn(1975) : error 001: expected token: ";", but found "]"
F:\SAMP SERVER\gamemodes\grandlarc.pwn(1975) : error 029: invalid expression, assumed zero
F:\SAMP SERVER\gamemodes\grandlarc.pwn(1975) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
And what i do with that line is next:

pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, 0xFFFFFFFF, "Admin Komande: {15D4ED}/{8CED15}respawnajvozila");
Hmmm..
Reply
#4

Quote:
Originally Posted by Max_Coldheart
Посмотреть сообщение
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, 0xFFFFFFFF, "Administrator commands goes here.");
Bad, he wants via RCON freak


pawn Код:
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Administrator commands goes here.");
Reply
#5

It compile with no errors BUT...

When I type /pomoc (that's my command) InGame it show me just Admin Commands, and i didn't actually use /rcon login 55555...

And when I login as a RCON admin and when I type /pomoc it just hit me that --> SERVER: Unknown Command...

I think that here is something wrong, here is my command /POMOC ~~>

pawn Код:
if (strcmp("/pomoc", cmdtext, true, 10) == 0)
        {
            SendClientMessage(playerid, 0xFFFFFFFF, "{15D4ED}/{8CED15}vehpopravi  | {15D4ED}/{8CED15}vehokreni  |  {15D4ED}/{8CED15}vehunisti  |  {15D4ED}/{8CED15}kreirajv  |  {15D4ED}/{8CED15}admini");
            if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "Admin Komande: {15D4ED}/{8CED15}respawnajvozila");
            return 1;
        }
Do you know where the problem occurs?
Reply
#6

Here you go.
pawn Код:
if (strcmp("/pomoc", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, 0xFFFFFFFF, "{15D4ED}/{8CED15}vehpopravi  | {15D4ED}/{8CED15}vehokreni  |  {15D4ED}/{8CED15}vehunisti  |  {15D4ED}/{8CED15}kreirajv  |  {15D4ED}/{8CED15}admini");
    if(IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,0xFFFFFFFF,"Admin Komande: {15D4ED}/{8CED15}respawnajvozila");
        //More stuff here if you want to show more admin cmds :)
    }
    return 1;
}
Reply
#7

Heh.. I don't know where the problem is but it won't me to respond on command InGame.

I just typed /pomoc and nothin happens... No SERVER: Unknown Command and nothing from SendClientMessage xD

Hmmm... can you help me? xD
Reply
#8

Quote:
Originally Posted by Max_Coldheart
Посмотреть сообщение
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, 0xFFFFFFFF, "Administrator commands goes here.");
Not everyone uses this method...
Reply
#9

Yea but I use this:

pawn Код:
if (strcmp("/pomoc", cmdtext, true, 10) == 0)
{
    SendClientMessage(playerid, 0xFFFFFFFF, "{15D4ED}/{8CED15}vehpopravi  | {15D4ED}/{8CED15}vehokreni  |  {15D4ED}/{8CED15}vehunisti  |  {15D4ED}/{8CED15}kreirajv  |  {15D4ED}/{8CED15}admini");
    if(IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,0xFFFFFFFF,"Admin Komande: {15D4ED}/{8CED15}respawnajvozila");
        //More stuff here if you want to show more admin cmds :)
    }
    return 1;
}
And it seems to be OK, but it won't work
Reply
#10

pawn Код:
if (strcmp("/pomoc", cmdtext, true, 10) == 0)
{
    if(IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,0xFFFFFFFF,"Admin Komande: {15D4ED}/{8CED15}respawnajvozila");
        //More stuff here if you want to show more admin cmds :)
    }
    else
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "{15D4ED}/{8CED15}vehpopravi  | {15D4ED}/{8CED15}vehokreni  |  {15D4ED}/{8CED15}vehunisti  |  {15D4ED}/{8CED15}kreirajv  |  {15D4ED}/{8CED15}admini");
        //More stuff here if you want to show other cmds :)
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)