Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************Police Panel v1.0 by ArenaGames Roleplay*****************
- * *
- *Scriptat de amaru de pe sa-mp.ro *
- *Credite la: Geso de pe sa-mp.com pentru cop tools *
- * Steven Paul de pe sa-mp.com pentru Police Panel *
- *Am combinat scripturile, luand ce am nevoie si a iesit asta. *
- *In viitor o sa mai adaug la script si alte functii interesante. *
- * *
- * *
- ****************************************************************************
- */
- #include <a_samp>
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_BLUE 0x2641FEAA
- #define TEAM_HIT_COLOR 0xFFFFFF00
- #define TEAM_BLUE_COLOR 0x8D8DFF00
- #define COLOR_DARKNICERED 0x9D000096
- #define COLOR_GREY 0xAFAFAFAA
- #pragma tabsize 0
- new reqbackup[MAX_PLAYERS];
- forward BackupClear(playerid, calledbytimer);
- public BackupClear(playerid, calledbytimer)
- {
- if(IsPlayerConnected(playerid))
- {
- if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288 || GetPlayerSkin(playerid) == 284)
- {
- if (reqbackup[playerid] = 1)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288 || GetPlayerSkin(playerid) == 284)
- {
- SetPlayerMarkerForPlayer(i, playerid, TEAM_HIT_COLOR);
- }
- }
- }
- if (calledbytimer != 1)
- {
- SendClientMessage(playerid, TEAM_BLUE_COLOR, "Cererea ta de ajutor a fost stearsa.");
- }
- else
- {
- SendClientMessage(playerid, TEAM_BLUE_COLOR, "Cererea ta de ajutor a fost stearsa automat.");
- }
- reqbackup[playerid] = 0;
- }
- else
- {
- if (calledbytimer != 1)
- {
- SendClientMessage(playerid, COLOR_DARKNICERED, "Nu ai o cerere activa!");
- }
- }
- }
- else
- {
- if (calledbytimer != 1)
- {
- SendClientMessage(playerid, COLOR_GREY, "Nu esti politist!");
- }
- }
- }
- return 1;
- }
- PutRiotShieldOnBack(playerid)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
- SetPlayerAttachedObject(playerid, 1 , 18637, 1, 0, -0.1, 0.18, 90, 0, 272, 1, 1, 1);
- }
- PutRiotShieldOnArm(playerid)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
- SetPlayerAttachedObject(playerid, 1, 18637, 4, 0.3, 0, 0, 0, 170, 270, 1, 1, 1);
- }
- GiveFlashLight(playerid)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
- SetPlayerAttachedObject(playerid, 2,18641, 5, 0.1, 0.02, -0.05, 0, 0, 0, 1, 1, 1);
- }
- GiveTazer(playerid)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
- SetPlayerAttachedObject(playerid, 2,18642, 5, 0.12, 0.02, -0.05, 0, 0, 45,1,1,1);
- }
- public OnFilterScriptInit()
- {
- print("\n");
- print("----Police Panel by ArenaGames Roleplay---");
- print("Scriptat de amaru de pe sa-mp.ro");
- print("Credite pentru: Geso de pe sa-mp.com pentru cop tools");
- print("Steven Paul de pe sa-mp.com pentru Police Panel");
- print("\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, COLOR_WHITE, "This server is using amaru's police panel.");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/panel", cmdtext, true, 10) == 0)
- {
- if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 288 || GetPlayerSkin(playerid) == 284)
- {
- ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "{00CED1}Police Panel","Air Support\nWater Support\nBackup\nClear Backup\nAnnounce\nItems","Select","Cancel");
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "Nu esti politist");
- }
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- new string[128];
- if(response)
- {
- if(dialogid == 8)
- {
- if(listitem == 0)
- {
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if (reqbackup[playerid] != 1)
- {
- format(string, sizeof(string), "Catre toate unitatile: %s are nevoie de suport aerian. A fost marcat pe GPS", sendername);
- reqbackup[playerid] = 1;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerSkin(i) == 280 || GetPlayerSkin(i) == 281 || GetPlayerSkin(i) == 282 || GetPlayerSkin(i) == 283 || GetPlayerSkin(i) == 288 || GetPlayerSkin(i) == 284)
- {
- SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
- SendClientMessage(i, TEAM_BLUE_COLOR, string);
- }
- }
- }
- SetTimerEx("BackupClear", 180000, false, "ii", playerid, 1);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Deja ai o cerere activa!");
- }
- }
- if(listitem == 1)
- {
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if (reqbackup[playerid] != 1)
- {
- format(string, sizeof(string), "Catre toate unitatile: %s are nevoie de suport acvatic. A fost marcat pe GPS", sendername);
- reqbackup[playerid] = 1;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(i) == 281 || GetPlayerSkin(i) == 282 || GetPlayerSkin(i) == 283 || GetPlayerSkin(i) == 288 || GetPlayerSkin(i) == 284)
- {
- SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
- SendClientMessage(i, TEAM_BLUE_COLOR, string);
- }
- }
- }
- SetTimerEx("BackupClear", 180000, false, "ii", playerid, 1);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Deja ai o cerere activa!");
- }
- }
- if(listitem == 2)
- {
- if (reqbackup[playerid] != 1)
- {
- new sendername[MAX_PLAYERS];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "Catre toate unitatile: %s are nevoie de ajutor. A fost marcat pe GPS", sendername);
- reqbackup[playerid] = 1;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerSkin(i) == 280 || GetPlayerSkin(i) == 281 || GetPlayerSkin(i) == 282 || GetPlayerSkin(i) == 283 || GetPlayerSkin(i) == 288 || GetPlayerSkin(i) == 284)
- {
- SetPlayerMarkerForPlayer(i, playerid, 0xFF0000FF);
- SendClientMessage(i, TEAM_BLUE_COLOR, string);
- }
- }
- }
- SetTimerEx("BackupClear", 180000, false, "ii", playerid, 1);
- }
- else
- {
- SendClientMessage(playerid, COLOR_GREY, "Deja ai o cerere activa!");
- }
- }
- if(listitem == 3)
- {
- BackupClear(playerid, 0);
- }
- if(listitem == 4)
- {
- ShowPlayerDialog(playerid, 115, DIALOG_STYLE_INPUT, "Anunt", "Scrie anuntul aici.", "SEND", "CLOSE");
- }
- if(listitem == 5)
- {
- ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST,"{00CED1}Items menu","Scut (mana)\nScut (spate)\nLanterna\nTazer\nScoate elemente","Select", "Cancel");
- }
- }
- if(dialogid == 9)
- {
- if(listitem == 0)
- {
- PutRiotShieldOnArm(playerid);
- }
- if(listitem == 1)
- {
- PutRiotShieldOnBack(playerid);
- }
- if(listitem == 2)
- {
- GiveFlashLight(playerid);
- }
- if(listitem == 3)
- {
- GiveTazer(playerid);
- }
- if(listitem == 4)
- {
- if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
- if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
- }
- }
- if(dialogid == 115) //<<< NEW >>>//
- {
- new idx;
- new sendername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- new length = strlen(inputtext);
- while ((idx < length) && (inputtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[64];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = inputtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- SendClientMessageToAll(COLOR_WHITE, "|___________ Cop Announcement ___________|");
- format(string, sizeof(string), "Officer %s: %s", sendername, result);
- SendClientMessageToAll(COLOR_BLUE, string);
- return false;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement