[Tool/Web/Other] Public Address Script
#1

Here is a small public address script that I made.

Description:

You get 2 scripts with it, /sky (which sends a message to all players from a 'voice in the sky' and /head which sends messages from inside their head.
The script also gives detailed instructions on how to make your own.

I hope this helps new players.

pawn Код:
/*
 _____       _               _         _____        ______ _____
|  __ \     | |             | |       |  __ \ /\   |  ____/ ____|
| |__) |___ | |__   ___ _ __| |_ ___  | |__) /  \  | |__ | (___
|  _  // _ \| '_ \ / _ \ '__| __/ __| |  ___/ /\ \ |  __| \___ \
| | \ \ (_) | |_) |  __/ |  | |_\__ \ | |  / ____ \| |    ____) |
|_|  \_\___/|_.__/ \___|_|   \__|___/ |_| /_/    \_\_|   |_____/

This is Robert's Public Address Filterscript, 06leachr's first FS Release.
Credits to Robert Leach (06leachr on SA:MP forums).
Of course you can remove these credits but it would be nice if you didn't.

*/


#include <a_samp> // Insure this line is at the top of your game mode.

// Add the below #defines with the rest of your #defines.

#define GREEN           0x21DD00FF
#define RED             0xE60000FF
#define YELLOW          0xFFFF00FF
#define ORANGE          0xF97804FF
#define LIGHTRED        0xFF8080FF
#define NICESKY         0x00C2ECFF
#define PURPLE          0xB360FDFF
#define BLUE            0x1229FAFF
#define LIGHTGREEN      0x38FF06FF
#define RADIO_CHAT      0xBCC1F3FF
#define DARKPINK        0xE100E1FF
#define DARKGREEN       0x008040FF
#define GREY            0xCECECEFF
#define PINK            0xD52DFFFF
#define DARKGREY        0x626262FF
#define AQUAGREEN       0x03D687FF
#define WHITE           0xFFFFFFFF
#define BLACK           0x000000FF
#define LIGHTBLUE       0x33CCFFAA
#define SACBLUE         0x0086B300

// You can change colours of individual commands by replacing "AQUAGREEN" BELOW with any other colour mentioned above.

// Add these below near to any other command in your gamemode.

public OnPlayerCommandText(playerid, cmdtext[])
{
    if( Player[playerid][AdminLevel] >= 1 && Player[playerid][AdminDuty] > 0 ) // Use this line to make the /sky command admin only.
                                                            //Comment out from "&&" to the ")" if you do not have a AdminDuty system.
    {
    if (strcmp("/sky", cmdtext, true, 10) == 0)
    {
        format( string, sizeof( string ), "Voice from the sky: %s )) ", Player[playerid][AdminName], Announcement );
                SendClientMessageToAll( AQUAGREEN, string );
    }

    return true;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if( Player[playerid][AdminLevel] >= 1 && Player[playerid][AdminDuty] > 0 ) // Use this line to make the /sky command admin only.
                                                            //Comment out from "&&" to the ")" if you do not have a AdminDuty system.
    {
    if (strcmp("/head", cmdtext, true, 10) == 0)
    {
        format( string, sizeof( string ), "Voice inside your head says: %s )) ", Player[playerid][AdminName], Announcement );
                SendClientMessageToAll( AQUAGREEN, string );
    }

    return true;
}


// If you wish to add further commands, uncomment this below then follow the commented instructions.
// To uncomment it, remove the "/*" from the start and end.

/*
public OnPlayerCommandText(playerid, cmdtext[])
{
    if( Player[playerid][AdminLevel] >= 1 && Player[playerid][AdminDuty] > 0 ) // Use this line to make the /sky command admin only.
                                                            //Comment out from "&&" to the ")" if you do not have a AdminDuty system.
    {
    if (strcmp("/head", cmdtext, true, 10) == 0) // Change /head with whatever you want the command to be.
    {
        format( string, sizeof( string ), "Voice inside your head says: %s )) ", Player[playerid][AdminName], Announcement );
                SendClientMessageToAll( AQUAGREEN, string ); // Change "Voice inside your head says: with whatever you want the command
                                                            // to say.
    }

    return true;
} */
I did try to make it as a fs, but I had some problems.
Reply
#2

pawn Код:
format( string, sizeof( string ), "Voice inside your head says: %s )) ", Player[playerid][AdminName], Announcement );

format( string, sizeof( string ), "Voice from the sky: %s )) ", Player[playerid][AdminName], Announcement );
pawn Код:
return true; //at OnPlayerCommandText
I saw mistakes in these already..
Reply
#3

have you tried to compile it?
it should have few erorrs.
Reply
#4

Compiles and works fine for me, i'll look into it.
Reply
#5

Quote:
Originally Posted by 06leachr
Посмотреть сообщение
Compiles and works fine for me, i'll look into it.
It works fine, and the compiler says no bugs, but it's such a messy script. You don't return true at OnPlayerCommandText lol..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)