SA-MP Forums Archive
SendRconCommand! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SendRconCommand! (/showthread.php?tid=522922)



SendRconCommand! - Juvanii - 29.06.2014

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;
}



Re : SendRconCommand! - Clad - 29.06.2014

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



Re: SendRconCommand! - -=Dar[K]Lord=- - 29.06.2014

Код:
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 .


Re: SendRconCommand! - Juvanii - 29.06.2014

Thanks! :)


Re: SendRconCommand! - Threshold - 30.06.2014

You don't need sscanf for the above code.


Re: SendRconCommand! - Juvanii - 30.06.2014

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.


Re: SendRconCommand! - Threshold - 30.06.2014

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.