[URGENT] How can i make AdmWarnings when someone uses /rcon say
#1

Well i need some warnings for admins rank 100001 only who can see it cause someone is using /rcon Say i don't even know if it's /asay or /rcon say please help
i made this
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
        format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s has attempted to login on the Rcon.",sendername);
        ABroadCast(COLOR_WHITE,string,100001);
}
worked fine but when i made this but dont get any warnings like Name is using Rcon say.
pawn Код:
public OnRconCommand(cmd[])
{
    if(strcmp(cmd, "safegmx", true) == 0)
    {
        GameModeInitExitFunc();
        return 1;
    }
    if(strcmp(cmd, "say", true) == 0)
    {
        format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s is using Rcon SAY to chat" .",sendername);
        ABroadCast(COLOR_WHITE,string,100001);
        return 1;
    }
    return 0;
}
didn't get any errors but the warning isn't working when i /rcon say Hi
btw that safegmx i didn't make it i found it there but didn't really work so it's useless
Reply
#2

pawn Код:
public OnRconCommand(cmd[])
{
    if(strcmp(cmd, "safegmx", true) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You are not admin to use this command");
        GameModeInitExitFunc();
        return 1;
    }
    if(strcmp(cmd, "say", true) == 0)
    {
        if(!IsPlayerAdmin(sendername)) return SendClientMessage(playerid,-1,"You are not admin to use this command");
        format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s is using Rcon SAY to chat" .",sendername);
        ABroadCast(COLOR_WHITE,string,100001);
        return 1;
    }
    return 0;
}
Reply
#3

thanks i'll check it out now
Reply
#4

Still not working i GMX'd and relogged , still same , didn't get a warning when i did /rcon say Hi
Reply
#5

where is the error line?
edit oh, sorry my bad:
pawn Код:
if(strcmp(cmd, "safegmx", true) == 0)
    {
        if(!IsPlayerAdmin(sendername)) return SendClientMessage(playerid,-1,"You are not admin to use this command");
        GameModeInitExitFunc();
        return 1;
    }
Reply
#6

undefined playerid
after idefined it i had Prototype error or some shit like that
Reply
#7

pawn Код:
if(strcmp(cmd, "safegmx", true) == 0)
    {
        if(!IsPlayerAdmin(sendername)) return SendClientMessage(playerid,-1,"You are not admin to use this command");
        GameModeInitExitFunc();
        return 1;
    }
Reply
#8

C:\Documents and Settings\Administrateur\Bureau\SA-MRP - v0.3z (V2)\gamemodes\SA-MRP.pwn(64582) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Administrateur\Bureau\SA-MRP - v0.3z (V2)\gamemodes\SA-MRP.pwn(64582) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Administrateur\Bureau\SA-MRP - v0.3z (V2)\gamemodes\SA-MRP.pwn(6458 : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Administrateur\Bureau\SA-MRP - v0.3z (V2)\gamemodes\SA-MRP.pwn(6458 : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#9

pawn Код:
public OnRconCommand(cmd[])
{
    if(strcmp(cmd, "safegmx", true) == 0)
    {
        if(IsPlayerAdmin(sendername) == 0)) return SendClientMessage(playerid,-1,"You are not admin to use this command");
        GameModeInitExitFunc();
        return 1;
    }
    if(strcmp(cmd, "say", true) == 0)
    {
        if(IsPlayerAdmin(sendername) == 0)) return SendClientMessage(playerid,-1,"You are not admin to use this command");
        format(string, sizeof(string), "{FF0000}AdmWarning{FFFF00}: %s is using Rcon SAY to chat" .",sendername);
        ABroadCast(COLOR_WHITE,string,100001);
        return 1;
    }
    return 0;
}
Reply
#10

OnRconCommand has only one parameter and that's "cmd". "playerid" is indeed undefined so you cannot use SendClientMessage function there as it requires a player's ID.

Also:
Quote:
Important note: You will need to include this callback in a loaded filterscript for it to work in the gamemode!

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)