/announce cmd
#1

Can someone show me an example of a /announce command that shows what you type as gametext

e.g.

/announce <text>

then show up as clientmessage and gametext pls help.
Reply
#2

Posting both the methods below. To use this command you will need ZCMD by Zeek and sscanf by ******.
EDIT:

The SendClientMessage one!
pawn Код:
COMMAND:announce(playerid, params[])
    {
        new string[128],msg[128],pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,sizeof(pname));
        if(sscanf(params,"s[128]",msg)) return SendClientMessage(playerid,-1, "USAGE: /ann [Admin Message]");
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1, "You are not authorised to use this command!");
        format(string,sizeof(string),"* [Admin] : %s %s *",pname,msg);
        SendClientMessageToAll(-1,string);
        return 1;
    }
Game Text one!

pawn Код:
COMMAND:announce(playerid, params[])
    {
        new string[128],msg[128],pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,sizeof(pname));
        if(sscanf(params,"s[128]",msg)) return SendClientMessage(playerid,-1, "USAGE: /ann [Admin Message]");
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1, "You are not authorised to use this command!");
        format(string,sizeof(string),"[%s]: %s",pname,msg);
        GameTextForPlayer( playerid, string, 5000, 3 );
        return 1;
    }
Reply
#3

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Posting both the methods below. To use this command you will need ZCMD by Zeek and sscanf by ******.

The SendClientMessage one!
pawn Код:
COMMAND:announce(playerid, params[])
    {
        new string[128],msg[128],pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,sizeof(pname));
        if(sscanf(params,"s[128]",msg)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /ann [Admin Message]");
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_GRAD2, "You are not authorised to use this command!");
        format(string,sizeof(string),"* [Admin] : %s *",msg);
        SendClientMessageToAll(COLOR_DBLUE,string);
        return 1;
    }
Game Text one!

pawn Код:
COMMAND:announce(playerid, params[])
    {
        new string[128],msg[128],pname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pname,sizeof(pname));
        if(sscanf(params,"s[128]",msg)) return SendClientMessage(playerid,COLOR_WHITE, "USAGE: /ann [Admin Message]");
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_GRAD2, "You are not authorised to use this command!");
        format(string,sizeof(string),"Admin: %s",msg);
        GameTextForPlayer( playerid, string, 5000, 3 );
        return 1;
    }
@Ballu - You should be more careful. He will get undefined symbol errors cuz of the colors.
Reply
#4

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
@Ballu - You should be more careful. He will get undefined symbol errors cuz of the colors.
Haha got him this time :P
Reply
#5

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
Haha got him this time :P
Haha True Faisal! You're right this time Haardik. I Edited it.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)