SA-MP Forums Archive
Plz help me - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Plz help me (/showthread.php?tid=261740)



Plz help me - jot16 - 14.06.2011

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


Re: Plz help me - jot16 - 14.06.2011

plz guys?


Re: Plz help me - Snipa - 14.06.2011

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



Re: Plz help me - RoCK'N'Rolla - 14.06.2011

Код:
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.


Re: Plz help me - Ehab1911 - 15.06.2011

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);
}



Re: Plz help me - Scenario - 15.06.2011

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...


Re: Plz help me - dr.pepper - 15.06.2011

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;
}



Re: Plz help me - jot16 - 15.06.2011

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.


Re: Plz help me - Scenario - 15.06.2011

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.


Re: Plz help me - dr.pepper - 15.06.2011

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;
}