Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************** - [Random Messages by: Pooh7] - ********************************************/
- /* P-Messages */
- /* You don't have permission to DELETE or CHANGE credits. */
- /* You don't have permission to EDIT my FS, and UPLOAD it as yours. */
- /* You don't have permission to publish it on your BLOGS or WEBSITES. */
- /* If you want that, send me E-mail or PM on sa-mp.com forum */
- /* My E-mail is [email protected], and name is Pooh7 */
- /* www.sa-mp.com | www.balkan-samp.com */
- /* */
- /* Credits to: Zeex - ZCMD Command processor */
- /* Credits to: Pooh7 - P-Messages */
- /************************************************************************************************************************/
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- new rmessages;
- new bool:RandomMessages;
- forward Messages();
- new PMessages[][] =
- {
- "Random Message no.1",
- "Random Message no.2",
- "Random Message no.3",
- "Random Message no.4",
- "Random Message no.5",
- "Random Message no.6",
- "Random Message no.7",
- "Random Message no.8",
- "Random Message no.9",
- "Random Message no.10"
- };
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Filterscript [P-Messages] LOADED");
- print("--------------------------------------\n");
- RandomMessages = true;
- rmessages = SetTimer("Messages", 600000, true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" Filterscript [P-Messages] UNLOADED");
- print("--------------------------------------\n");
- KillTimer(rmessages);
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" This server use [P-Messages] FS");
- print("----------------------------------\n");
- }
- #endif
- public Messages()
- {
- if(RandomMessages == true)
- {
- new string[128];
- new mess = random(sizeof(PMessages));
- format(string, sizeof(string), "[Server Message]: %s", PMessages[mess]);
- SendClientMessageToAll(0xFFFF00AA, string);
- }
- return 1;
- }
- command(pmessages, playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- new string[64];
- new ime[20];
- GetPlayerName(playerid, ime, sizeof(ime));
- if(RandomMessages == true)
- {
- format(string, sizeof(string), "P-Messages turned off by an admin: %s", ime);
- SendClientMessageToAll(0xFF8000FF, string);
- RandomMessages = false;
- return 1;
- }
- if(RandomMessages == false)
- {
- format(string, sizeof(string), "P-Messages turned on by an admin: %s", ime);
- SendClientMessageToAll(0xFF8000FF, string);
- RandomMessages = true;
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, 0xC0C0C0FF, " you don't have permission to use this command!");
- return 1;
- }
- return 1;
- }
- command(forcemessage, playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- Messages();
- }
- else
- {
- SendClientMessage(playerid, 0xC0C0C0FF, "you don't have permission to use this command!");
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment