PDA

View Full Version : [URGENT] How can i make AdmWarnings when someone uses /rcon say


D3vin
05/05/2014, 03:41 PM
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
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.

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

Eth
05/05/2014, 03:57 PM
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;
}

D3vin
05/05/2014, 04:07 PM
thanks i'll check it out now

D3vin
05/05/2014, 04:10 PM
Still not working i GMX'd and relogged , still same , didn't get a warning when i did /rcon say Hi

Eth
05/05/2014, 04:12 PM
where is the error line?
edit oh, sorry my bad:

if(strcmp(cmd, "safegmx", true) == 0)
{
if(!IsPlayerAdmin(sendername)) return SendClientMessage(playerid,-1,"You are not admin to use this command");
GameModeInitExitFunc();
return 1;
}

D3vin
05/05/2014, 04:14 PM
undefined playerid
after idefined it i had Prototype error or some shit like that

Eth
05/05/2014, 04:16 PM
if(strcmp(cmd, "safegmx", true) == 0)
{
if(!IsPlayerAdmin(sendername)) return SendClientMessage(playerid,-1,"You are not admin to use this command");
GameModeInitExitFunc();
return 1;
}

D3vin
05/05/2014, 04:23 PM
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(64588) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Administrateur\Bureau\SA-MRP - v0.3z (V2)\gamemodes\SA-MRP.pwn(64588) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Eth
05/05/2014, 04:26 PM
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;
}

Konstantinos
05/05/2014, 04:39 PM
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:

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

D3vin
05/05/2014, 04:55 PM
Well i don't know how xD , can anyone show me?