How to make a simple announce command ?
#1

Hey, I want to know how to make a simple announce command like when i make /a [Text]

It shows to all players a text on their screen

Like /a Hello.

It will show them Hello.
Reply
#2

pawn Код:
dcmd_a(playerid,params[])
{
    new string[128];
    if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /a [Text]";)
        return 1;
    }
    format(string,sizeof(string),"%s",params);
    GameTextForAll(string,7000,3);
    return 1;
}
Reply
#3

Quote:
Originally Posted by rakshith122
Посмотреть сообщение
pawn Код:
dcmd_a(playerid,params[])
{
    new string[128];
    if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /a) [Text]";)
        return 1;
    }
    format(string,sizeof(string),"%s",params);
    GameTextForAll(string,7000,3);
    return 1;
}
Won't this only catch the first word after /a?
Reply
#4

oops, Looks like I added an ")".
Edited, Thanks.
Reply
#5

Can i make it for only 1 Score players ? How can i edit the score though
Reply
#6

It can be slightly improved.
pawn Код:
CMD:a(playerid, params[])
{
    if (!IsPlayerAdmin(playerid)) return 1;
    if (isnull(params)) return SendClientMessage(playerid, -1, "Usage: /a <text>");
    GameTextForAll(params, 4000, 4);
    return 1;
}
Quote:
Originally Posted by Le3aT
Посмотреть сообщение
Can i make it for only 1 Score players ? How can i edit the score though
I don't get what you mean.
Reply
#7

Thanks
Reply
#8

You want when the player is Score 1 and above can do it? or only score 1?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)