Admin Gametext
#1

Heey Scripters
I want to make a command sort of announce but then you dont need to fill timer and style!
Example: /(command) (text) //not the ()

Thanks admigo
Reply
#2

I have one in my Admin FS (download in signature)
pawn Код:
//sscanf+zcmd /announce by Seven_of_Nine
COMMAND:announce(playerid,params[]) {
    new
        poster[40],
        mess[128];
    if(PlayerInfo[playerid][pAdminLevel] >= 3) {
        if(sscanf(params,"s",mess))
            return SendClientMessage(playerid,red,"USAGE: /announce [message]");
        if(!isnull(mess)) {
            new text[128];
            GetPlayerName(playerid,poster,sizeof(poster));
            format(text,sizeof(text),"[Announce] | Administrator \"%s\" has announced his message. (%s)",poster,mess);
            SendClientMessageToAll(COLOR_LIGHTBLUE,text);
            GameTextForAll(mess,5000,3);
        } else {
            return SendClientMessage(playerid,red,"USAGE: /announce [message], and all players will see this message on-screen.");
        }
    } else {
        return SendClientMessage(playerid,red,"Only lvl3 admins can use this command. Looking for a way to announce? Try /message!");
    }
    return 1;
}
:]
Reply
#3

I have announce to but i dont want to fill in style and timmer every time!
Reply
#4

It doesn't need to. This a version like /announce [message]. Test it for yourself. It's working.
Reply
#5

Really long code & Messy code Seven

A shorter & better

pawn Код:
COMMAND:command(playerid, params[])
{
    new string[128], pName[MAX_PLAYER_NAME];
    if(sscanf(params,"s[128]", params)) return SendClientMessage(playerid, -1, "Usage: /command <text>");
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string, sizeof string, "Adminstrator %s: %s", pName params);
    SendClientMessageToAll(-1, string);
    return 1;
}
He says he doesn't want in style & the timing, I think he means just normal chat
Reply
#6

Quote:
Originally Posted by xir
Посмотреть сообщение
Really long code & Messy code Seven

A shorter & better

pawn Код:
COMMAND:command(playerid, params[])
{
    new string[128], pName[MAX_PLAYER_NAME];
    if(sscanf(params,"s[128]", params)) return SendClientMessage(playerid, -1, "Usage: /command <text>");
    GetPlayerName(playerid,pName,sizeof(pName));
    format(string, sizeof string, "Adminstrator %s: %s", pName params);
    SendClientMessageToAll(-1, string);
    return 1;
}
He says he doesn't want in style & the timing, I think he means just normal chat
How can i put this command in GM Because i use if (strcmp("/command", cmdtext, true, 10) == 0) this.
Reply
#7

that willl require strtok & I can't simply figure that out, sorry, only sscanf

You should consider switching all your current strmcp cmds to zcmd & sscanf.

Strtok & strcmp is old shit & outdated.
Reply
#8

Quote:
Originally Posted by xir
Посмотреть сообщение
that willl require strtok & I can't simply figure that out, sorry, only sscanf

You should consider switching all your current strmcp cmds to zcmd & sscanf.

Strtok & strcmp is old shit & outdated.
Sorry i dont understand because i am beginner lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)