SendRconCommand!
#1

Does Rcon Commands which has parameters work on SendRconCommand? just like "rcon say [text]"
If 'yes' ..can somebody tell me what's wrong in this? it doesn't send any rcon command!
pawn Код:
CMD:say(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] == 0) return 0;
    SendRconCommand("say");
    return 1;
}
Reply
#2

pawn Код:
public OnRconCommand(cmd[])
{
    if(!strcmp(cmd, "say", true))
    {
Reply
#3

Код:
CMD:say(playerid, params[])
{  
    if(PlayerInfo[playerid][pAdmin] == 0) return 0;   
    if(sscanf(params,"c",params)) return SendClientMessage(playerid,0xFF0000FF,"/say <text>");
    new str[256];
    format(str,sizeof(str),"say %s",params);
   SendRconCommand(str);    
   return 1;
}
Use sscanf plugin and include for this cmd to run .
Reply
#4

Thanks! :)
Reply
#5

You don't need sscanf for the above code.
Reply
#6

Quote:
Originally Posted by Threshold
Посмотреть сообщение
You don't need sscanf for the above code.
without it, if you type /say it will send message to all just like *Admin: with an empty text.
Reply
#7

pawn Код:
CMD:say(playerid, params[])
{  
    if(!PlayerInfo[playerid][pAdmin]) return 0;
    if(params[0] == '\0') return SendClientMessage(playerid, 0xFF0000FF, "Usage: /say [text]");
    new str[135];
    format(str, sizeof(str), "say %s", params);
    SendRconCommand(str);
    return 1;
}
Still don't need sscanf.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)