Plz help me
#1

can anybody tell me how to make a /announce cmd.i also want to make the text bigger and colorful while i put /announce In-game
Reply
#2

plz guys?
Reply
#3

pawn Код:
CMD:announce(playerid,params[])
{
    if(!strlen(params)) return 0;
    GameTextForAll(params,4000,3); //change this to whatever
    return 1;
}
Reply
#4

Код:
if(!strcmp(cmdtext, "/ann", true, 4))
{
        new str[128];

        if(cmdtext[4] == 0) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ann [message]");

        format(str, sizeof(str)," %s %s", str, cmdtext[5]);
        SendClientMessageToAll(COLOR_ORANGE, "---------------------------------------------------");
        SendClientMessageToAll(COLOR_YELLOW, str);
        SendClientMessageToAll(COLOR_ORANGE, "---------------------------------------------------");

return 1;
}
might be something like this.
Reply
#5

pawn Код:
dcmd_announce(playerid,params[])
{
    if(AccInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid))
    {
        if(!strlen(params)) return
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /announce [Text]") &&
        SendClientMessage(playerid, orange, "Function: Will Announce the specified Message in screen");
        SendCommandToAdmins(playerid,"Announce");
        return GameTextForAll(params,4000,3);
    }
    else return ErrorMessages(playerid, 7);
}
Copied from LuxAdmin

If you want to make it for a normal admin system

pawn Код:
dcmd_announce(playerid,params[])
{
    IsPlayerAdmin(playerid))
    {
        if(!strlen(params)) return
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /announce [Text]") &&
        SendClientMessage(playerid, orange, "Function: Will Announce the specified Message in screen");
        SendCommandToAdmins(playerid,"Announce");
        return GameTextForAll(params,4000,3);
    }
    else return ErrorMessages(playerid, 7);
}
Reply
#6

Quote:
Originally Posted by Ehab1911
Посмотреть сообщение
pawn Код:
dcmd_announce(playerid,params[])
{
    IsPlayerAdmin(playerid))
    {
        if(!strlen(params)) return
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /announce [Text]") &&
        SendClientMessage(playerid, orange, "Function: Will Announce the specified Message in screen");
        SendCommandToAdmins(playerid,"Announce");
        return GameTextForAll(params,4000,3);
    }
    else return ErrorMessages(playerid, 7);
}
Actually, that command won't work either. See if you can figure it out...
Reply
#7

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
Actually, that command won't work either. See if you can figure it out...
You high rollers are really annoying, why don't you help him out instead of making useless posts.

pawn Код:
dcmd_gametextall(playerid, cmdtext[])
   {
   new tmp[256], index;  
   tmp = strrest(cmdtext, index);
   if (!strlen(tmp))
   return SendClientMessage(0xFF444499, playerid, "/ann <message>");     
   if (strlen(tmp) > 25)
   return SendClientMessage(0xFF444499, playerid, "Your announce message is too long");  
   GameTextForAll(tmp, 4000, 5);
   return 1;
}
Reply
#8

Quote:
Originally Posted by dr.pepper
Посмотреть сообщение
You high rollers are really annoying, why don't you help him out instead of making useless posts.

pawn Код:
dcmd_gametextall(playerid, cmdtext[])
{
   new tmp[256], index;  
   tmp = strrest(cmdtext, index);
   if (!strlen(tmp))
   return SendClientMessage(0xFF444499, playerid, "/announce <message>");    
   if (strlen(tmp) > 25)
   return SendClientMessage(0xFF444499, playerid, "Your announce message is too long");  
   GameTextForAll(tmp, 4000, 5);
   return 1;
}
can u plz also tell me do i add it under playeroncommandtext?and also how do i make it on rcon login only?but i haven't tested it yet.
Reply
#9

Quote:
Originally Posted by dr.pepper
Посмотреть сообщение
You high rollers are really annoying, why don't you help him out instead of making useless posts.

pawn Код:
if(!strcmp(cmdtext, "/ann", true, 3))
{
   new tmp[256], index;  
   tmp = strrest(cmdtext, index);
   if (!strlen(tmp))
   return SendClientMessage(0xFF444499, playerid, "/ann <message>");     
   if (strlen(tmp) > 25)
   return SendClientMessage(0xFF444499, playerid, "Your announce message is too long");  
   GameTextForAll(tmp, 4000, 5);
   return 1;
}
I love how people think my forum rank means anything... Your command is very inefficient too.
Reply
#10

Quote:
Originally Posted by jot16
Посмотреть сообщение
can u plz also tell me do i add it under playeroncommandtext?and also how do i make it on rcon login only?
Try this: bad post before

pawn Код:
if(!strcmp(cmdtext, "/gametextall", true, 11))
{
if(IsPlayerAdmin(playerid))
{
new tmp[256], index;  
tmp = strrest(cmdtext, index);
if (!strlen(tmp))
return SendClientMessage(0xFF444499, playerid, "/gametextall <message>");    
if (strlen(tmp) > 25)
return SendClientMessage(0xFF444499, playerid, "Your announce message is too long");  
GameTextForAll(tmp, 4000, 5);
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)