[Solved] Small command problem.
#1

well i hope its a simple problem...

Let me explain what is going on,

I want a command that is like "/rcon say [text]" but without using rcon
(EXAMPLE) Admin Announcement: text comes here
long story short... i dont want to show any names whilest someone uses this command
(Because if use it now it says "Admin Announcement: playername, text")

let me place the code here for the person that can help me out !

pawn Код:
CMD:achat(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You must be level 2 admin and up to use this command.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /achat [text]");
    if(AntiAdv(playerid, params)) return 1;
    if(PlayerInfo[playerid][pAdmin]) format(string, sizeof(string), "* Admin Accouncement: %s %s *", RPN(playerid), params);
    else format(string, sizeof(string), "*Admin Announcement: %s %s *", RPN(playerid), params);
    SendClientMessageToAll(COLOR_CYAN, string);
    return 1;
}
I hope i have explained what im trying to do here well enough
so someone can help me

if i didn't, please let me know so i can explain what i actually mean ghehehe

Thanks alot for reading already and hopefully someone brings a solution
Reply
#2

If this is what I think you're asking for.. this should work.

Код:
CMD:achat(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You must be level 2 admin and up to use this command.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /achat [text]");
    if(AntiAdv(playerid, params)) return 1;
    format(string, sizeof(string), "*Admin Announcement: %s *", params); // REMOVED  RPN(playerid) and the %s.
    SendClientMessageToAll(COLOR_CYAN, string);
    return 1;
}
Reply
#3

Quote:
Originally Posted by Peach
Посмотреть сообщение
If this is what I think you're asking for.. this should work.

Код:
CMD:achat(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "You must be level 2 admin and up to use this command.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /achat [text]");
    if(AntiAdv(playerid, params)) return 1;
    format(string, sizeof(string), "*Admin Announcement: %s *", params); // REMOVED  RPN(playerid) and the %s.
    SendClientMessageToAll(COLOR_CYAN, string);
    return 1;
}
Compiled, tested and....
That's exactly what i wanted
Thank you very much for the fast reply.

!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)