04-24-2008, 12:13 AM
this section is nice 
Errr... i have a problem idk how 2 send a pm to a player from rcon. this is the code for that:
it may be a small error

Errr... i have a problem idk how 2 send a pm to a player from rcon. this is the code for that:
Code:
public OnRconCommand(cmd[])
{
if (strlen(cmd) > 50){
print("Invalid command length (exceeding 50 characters)");
return true;
}
if(!strcmp(cmd, "pm", .length = 2)){
new arg_1 = argpos(cmd),
arg_2 = argpos(cmd, arg_1),
targetid = strval(cmd[arg_1]),
message[128];
if ( !cmd[arg_1] || cmd[arg_1] < '0' || cmd[arg_1] > '9' || targetid > max_playerid || targetid < 0 || !cmd[arg_2])
printf("Usage: \"pm <playerid(0-%d)> <message>\"",max_playerid);
else if ( !IsPlayerConnected(targetid) )
print("This player is not connected!");
else{
format(message, sizeof(message), "[RCON] PM from an admin: %s", cmd[arg_2]);
SendClientMessage(targetid, 0xFFFFFFFF, message);
}
return true;
}
return 0;
}it may be a small error