Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Filterscript obsahuje:
- 1) /carmenu - Spawn auta přes dialog s ochranou proti spamu
- 2) /neon - Nainstalování neonu do auta
- 3) /setskin - Nastavení skinu
- 4) /opravauto - Oprava auta s časovou ochranou proti spamu
- 5) /zivoty - Doplnění full životů s časovou ochranou proti spamu
- 6) /radio - Spuštění radia
- 7) /mute a /unmute - Umlčení a odmlčení hráče
- 8) /barvy - Výběr barevného nicku
- 9) /chatcolor - Výber barvy pro barevné psaní do chatu
- +BONUS - Náhodné soutěže v chatu s výhrou zbraní*/
- #include <a_samp>
- //#include <servermsg>
- ////////////////////////////////////////////////////////////////////////////////
- #define DIALOG_CARMENU 21000
- #define DIALOG_CHATCOLORS 21001
- #define DIALOG_RADIO 21002
- #define DIALOG_NICKCOLORS 21003
- #define DIALOG_NEON 21004
- #define EVENT_TEXT_LEN 10
- #define EVENTTIME (300000+random(180000))
- #define VEHCREATE_DISTANCE 4.0
- ////////////////////////////////////////////////////////////////////////////////
- enum VEHICLENAMES_ARRAY
- {
- Name[32],
- Modelid
- }
- new VehicleNames[][VEHICLENAMES_ARRAY] =
- {
- {"Landstalker", 400},
- {"Bravura", 401},
- {"Buffalo", 402},
- {"Linerunner", 403},
- {"Pereniel", 404},
- {"Sentinel", 405},
- {"Dumper", 406},
- {"Firetruck", 407},
- {"Trashmaster", 408},
- {"Stretch", 409},
- {"Manana", 410},
- {"Infernus", 411},
- {"Voodoo", 412},
- {"Pony", 413},
- {"Mule", 414},
- {"Cheetah", 415},
- {"Ambulance", 416},
- {"Leviathan", 417},
- {"Moonbeam", 418},
- {"Esperanto", 419},
- {"Taxi", 420},
- {"Washington", 421},
- {"Bobcat", 422},
- {"Mr Whoopee", 423},
- {"BF Injection", 424},
- {"Hunter", 425},
- {"Premier", 426},
- {"Enforcer", 427},
- {"Securicar", 428},
- {"Banshee", 429},
- {"Predator", 430},
- {"Bus", 431},
- {"Barracks", 433},
- {"Hotknife", 434},
- {"Previon", 436},
- {"Coach", 437},
- {"Cabbie", 438},
- {"Stallion", 439},
- {"Rumpo", 440},
- {"Romero", 442},
- {"Packer", 443},
- {"Monster Truck", 444},
- {"Admiral", 445},
- {"Squalo", 446},
- {"Seasparrow", 447},
- {"Pizzaboy", 448},
- {"Turismo", 451},
- {"Speeder", 452},
- {"Reefer", 453},
- {"Tropic", 454},
- {"Flatbed", 455},
- {"Yankee", 456},
- {"Caddy", 457},
- {"Solair", 458},
- {"Berkley's RC Van", 459},
- {"Skimmer", 460},
- {"PCJ-600", 461},
- {"Faggio", 462},
- {"Freeway", 463},
- {"Glendale", 466},
- {"Oceanic", 467},
- {"Sanchez", 468},
- {"Sparrow", 469},
- {"Patriot", 470},
- {"Quad", 471},
- {"Coastguard", 472},
- {"Dinghy", 473},
- {"Hermes", 474},
- {"Sabre", 475},
- {"Rustler", 476},
- {"ZR-350", 477},
- {"Walton", 478},
- {"Regina", 479},
- {"Comet", 480},
- {"BMX", 481},
- {"Burrito", 482},
- {"Camper", 483},
- {"Marquis", 484},
- {"Baggage", 485},
- {"Dozer", 486},
- {"Maverick", 487},
- {"News Chopper", 488},
- {"Rancher", 489},
- {"FBI Rancher", 490},
- {"Virgo", 491},
- {"Greenwood", 492},
- {"Jetmax", 493},
- {"Hotring", 494},
- {"Sandking", 495},
- {"Blista Compact", 496},
- {"Police Maverick", 497},
- {"Boxville", 498},
- {"Benson", 499},
- {"Mesa", 500},
- {"Hotring Racer", 502},
- {"Hotring Racer", 503},
- {"Bloodring Banger", 504},
- {"Rancher", 505},
- {"Super GT", 506},
- {"Elegant", 507},
- {"Journey", 508},
- {"Bike", 509},
- {"Mountain Bike", 510},
- {"Beagle", 511},
- {"Cropdust", 512},
- {"Stunt", 513},
- {"Tanker", 514},
- {"RoadTrain", 515},
- {"Nebula", 516},
- {"Majestic", 517},
- {"Buccaneer", 518},
- {"Shamal", 519},
- {"Hydra", 520},
- {"FCR-900", 521},
- {"NRG-500", 522},
- {"HPV1000", 523},
- {"Cement Truck", 524},
- {"Tow Truck", 525},
- {"Fortune", 526},
- {"Cadrona", 527},
- {"FBI Truck", 528},
- {"Willard", 529},
- {"Forklift", 530},
- {"Tractor", 531},
- {"Combine", 532},
- {"Feltzer", 533},
- {"Remington", 534},
- {"Slamvan", 535},
- {"Blade", 536},
- {"Vortex", 539},
- {"Vincent", 540},
- {"Bullet", 541},
- {"Clover", 542},
- {"Sadler", 543},
- {"Firetruck", 544},
- {"Hustler", 545},
- {"Intruder", 546},
- {"Primo", 547},
- {"Cargobob", 548},
- {"Tampa", 549},
- {"Sunrise", 550},
- {"Merit", 551},
- {"Utility", 552},
- {"Nevada", 553},
- {"Yosemite", 554},
- {"Windsor", 555},
- {"Monster Truck", 556},
- {"Monster Truck", 557},
- {"Uranus", 558},
- {"Jester", 559},
- {"Sultan", 560},
- {"Stratum", 561},
- {"Elegy", 562},
- {"Raindance", 563},
- {"Flash", 565},
- {"Tahoma", 566},
- {"Savanna", 567},
- {"Bandito", 568},
- {"Kart", 571},
- {"Mower", 572},
- {"Duneride", 573},
- {"Sweeper", 574},
- {"Broadway", 575},
- {"Tornado", 576},
- {"AT-400", 577},
- {"DFT-30", 578},
- {"Huntley", 579},
- {"Stafford", 580},
- {"BF-400", 581},
- {"Newsvan", 582},
- {"Tug", 583},
- {"Emperor", 585},
- {"Wayfarer", 586},
- {"Euros", 587},
- {"Hotdog", 588},
- {"Club", 589},
- {"Andromada", 592},
- {"Dodo", 593},
- {"Launch", 595},
- {"Police Car (LS)", 596},
- {"Police Car (SF)", 597},
- {"Police Car (LV)", 598},
- {"Police Ranger", 599},
- {"Picador", 600},
- {"S.W.A.T. Van", 601},
- {"Alpha", 602},
- {"Phoenix", 603},
- {"Glendale", 604},
- {"Sadler", 605},
- {"Boxville", 609}
- };
- enum CHATCOLORS_ARRAY
- {
- Color,
- Name[32]
- }
- new Chatcolors[][CHATCOLORS_ARRAY] =
- {
- {0xFFFF00FF, "Žlutá"},
- {0xFF0000FF, "Červená"},
- {0x009900FF, "Zelená"},
- {0xFFFFFFFF, "Bílá"},
- {0xEE44EEFF, "Růžová"},
- {0x000088FF, "Tmavě modrá"},
- {0xFF7700FF, "Oranžová"},
- {0x845422FF, "Hnědá"},
- {0x8888FFFF, "Světle modrá"}
- };
- enum NICKCOLORS_ARRAY
- {
- Color,
- Name[32]
- }
- new Nickcolors[][NICKCOLORS_ARRAY] =
- {
- {0xFFFF00FF, "Žlutá"},
- {0xFF0000FF, "Červená"},
- {0x009900FF, "Zelená"},
- {0xFFFFFFFF, "Bílá"},
- {0xEE44EEFF, "Růžová"},
- {0x000088FF, "Tmavě modrá"},
- {0xFF7700FF, "Oranžová"},
- {0x845422FF, "Hnědá"},
- {0x8888FFFF, "Světle modrá"}
- };
- new PVehicle[MAX_PLAYERS] = {-1, ...};
- new carmenuString[2048];
- new bool:Muted[MAX_PLAYERS];
- new Chatcolor[MAX_PLAYERS];
- new EventText[EVENT_TEXT_LEN+1] = {0, ...};
- new EventTimer = -1;
- new bool:EventState = false;
- new OpravautoTC[MAX_PLAYERS];
- new ZivotyTC[MAX_PLAYERS];
- new NeonObject[MAX_PLAYERS][2];
- ////////////////////////////////////////////////////////////////////////////////
- stock PlayerName(playerid)
- {
- new name[24];
- GetPlayerName(playerid, name, 24);
- return name;
- }
- stock EventRandomChar()
- {
- if(random(36) < 26) return 'A' + random(26);
- else return '0' + random(10);
- }
- ////////////////////////////////////////////////////////////////////////////////
- forward ChatEvent();
- public ChatEvent()
- {
- EventState = true;
- for(new i=0; i<EVENT_TEXT_LEN; i++) EventText[i] = EventRandomChar();
- new string[128];
- format(string, 128, "{33CCFF}[ Soutěž ] Kdo jako první napíše do chatu {FFFF00}%s{33CCFF} vyhraje balík zbraní!", EventText);
- SendClientMessageToAll(0xFFFFFFFF, string);
- EventTimer = SetTimer("ChatEvent", EVENTTIME, 0);
- return 1;
- }
- public OnFilterScriptInit()
- {
- for(new i=0; i<sizeof(VehicleNames); i++)
- {
- strcat(carmenuString, VehicleNames[i][Name]);
- strcat(carmenuString, "\n");
- }
- strcat(carmenuString, "{ff0000}Zničit");
- for(new i=0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i)) OnPlayerConnect(i);
- EventTimer = SetTimer("ChatEvent", EVENTTIME, 0);
- return printf("FILTERSCRIPT LOADED");
- }
- public OnFilterScriptExit()
- {
- for(new i=0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i)) OnPlayerDisconnect(i, -1);
- KillTimer(EventTimer);
- return printf("FILTERSCRIPT UNLOADED");
- }
- public OnPlayerConnect(playerid)
- {
- PVehicle[playerid] = -1;
- Muted[playerid] = false;
- Chatcolor[playerid] = 0xFFFFFFFF;
- OpravautoTC[playerid] = 0;
- ZivotyTC[playerid] = 0;
- NeonObject[playerid][0] = -1;
- NeonObject[playerid][1] = -1;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(PVehicle[playerid] != -1) DestroyVehicle(PVehicle[playerid]), PVehicle[playerid] = -1;
- if(NeonObject[playerid][0] != -1) DestroyObject(NeonObject[playerid][0]), NeonObject[playerid][0] = -1;
- if(NeonObject[playerid][1] != -1) DestroyObject(NeonObject[playerid][1]), NeonObject[playerid][1] = -1;
- StopAudioStreamForPlayer(playerid);
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(!IsPlayerNPC(playerid))
- {
- if(Muted[playerid] == true)
- {
- SendClientMessage(playerid, 0xFF0000FF, "Jsi umlčený, nemůžeš psát!");
- }
- else
- {
- new string[144];
- format(string, 144, "%s [ID:%d]: {%06x}%s", PlayerName(playerid), playerid, Chatcolor[playerid] >>> 8, text);
- SendClientMessageToAll(GetPlayerColor(playerid), string);
- }
- if(EventState == true)
- {
- if(strfind(text, EventText, true) != -1)
- {
- new string[128];
- format(string, 128, "{33CCFF}[ Soutěž ] Hráč {FFFF00}%s (%d){33CCFF} vyhrál soutěž!", PlayerName(playerid), playerid);
- SendClientMessageToAll(0xFFFFFFFF, string);
- EventState = false;
- GivePlayerWeapon (playerid,24,1000); // deagle
- GivePlayerWeapon (playerid,29,2000); // SMG
- GivePlayerWeapon (playerid,31,2000); // M4
- GivePlayerWeapon (playerid,31,2000); // Uzi
- GivePlayerWeapon (playerid,16,30); // Granát
- }
- }
- return 0;
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!IsPlayerNPC(playerid))
- {
- if(strcmp(cmdtext, "/opravauto", true) == 0)
- {
- if(GetPlayerVehicleID(playerid) == 0) return SendClientMessage(playerid, 0xFF0000FF, "Musíš byt v aute!");
- if(GetTickCount() < OpravautoTC[playerid])
- {
- new string[128];
- format(string, 128, "Tento příkaz můžeš znovu použít až za %d:%02d !", (OpravautoTC[playerid] - GetTickCount())/60000, ((OpravautoTC[playerid] - GetTickCount())%60000)/1000);
- return SendClientMessage(playerid, 0xFF0000FF, string);
- }
- SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
- RepairVehicle(GetPlayerVehicleID(playerid));
- OpravautoTC[playerid] = GetTickCount() + 120000;
- PlayerPlaySound(playerid, 1057, 0, 0, 0);
- SendClientMessage(playerid, 0xFFFFFFFF, "Opravil jsi si auto!");
- return 1;
- }
- //------------------------
- if(strcmp(cmdtext, "/radio", true) == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_LIST, "{ffff77}Rádio", "Evropa 2 CZ\nEurópa 2 SK\nImpuls\nFajn Radio\nDance Radio\nClub Radio\nExpres SK\n{ff0000}Stop", "OK", "Cancel");
- return 1;
- }
- //------------------------
- if(strcmp(cmdtext, "/zivoty", true) == 0)
- {
- if(GetTickCount() < ZivotyTC[playerid])
- {
- new string[128];
- format(string, 128, "Tento příkaz můžeš znovu použít až za %d:%02d !", (ZivotyTC[playerid] - GetTickCount())/60000, ((ZivotyTC[playerid] - GetTickCount())%60000)/1000);
- return SendClientMessage(playerid, 0xFF0000FF, string);
- }
- SetPlayerHealth(playerid, 100.0);
- ZivotyTC[playerid] = GetTickCount() + 300000;
- PlayerPlaySound(playerid, 1057, 0, 0, 0);
- SendClientMessage(playerid, 0xFFFFFFFF, "Vylečil jsi se!");
- return 1;
- }
- //------------------------
- if(strcmp(cmdtext, "/carmenu", true) == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_CARMENU, DIALOG_STYLE_LIST, "{ffff77}Carmenu", carmenuString, "OK", "Cancel");
- return 1;
- }
- //------------------------
- if(strcmp(cmdtext, "/neon", true) == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_NEON, DIALOG_STYLE_LIST, "{ffff77}Neon", "Červená\nModrá\nZelená\nŽlutá\nRůžová\nBílá\n{ff0000}Smazat neony", "OK", "Cancel");
- return 1;
- }
- //------------------------
- if(strcmp(cmdtext, "/chatcolor", true) == 0)
- {
- new string[512];
- for(new i=0; i<sizeof(Chatcolors); i++) format(string, sizeof(string), "%s{%06x}%s\n", string, Chatcolors[i][Color] >>> 8, Chatcolors[i][Name]);
- ShowPlayerDialog(playerid, DIALOG_CHATCOLORS, DIALOG_STYLE_LIST, "{ffff77}Chatcolors", string, "OK", "Cancel");
- return 1;
- }
- //------------------------
- if(strcmp(cmdtext, "/barvy", true) == 0)
- {
- new string[512];
- for(new i=0; i<sizeof(Nickcolors); i++) format(string, sizeof(string), "%s{%06x}%s\n", string, Nickcolors[i][Color] >>> 8, Nickcolors[i][Name]);
- ShowPlayerDialog(playerid, DIALOG_NICKCOLORS, DIALOG_STYLE_LIST, "{ffff77}Nickcolors", string, "OK", "Cancel");
- return 1;
- }
- //------------------------
- if(strcmp(cmdtext, "/mute", true, 5) == 0)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "Musíš byt RCON Admin !");
- if(strlen(cmdtext) < 7) return SendClientMessage(playerid, 0xFF0000FF, "Použij: /mute [ ID ]");
- new id = strval(cmdtext[6]);
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "Tento hráč není připojený !");
- if(IsPlayerNPC(id)) return SendClientMessage(playerid, 0xFF0000FF, "Toto je NPC!");
- if(Muted[id] == true) return SendClientMessage(playerid, 0xFF0000FF, "Tento hráč už je umlčený!");
- Muted[id] = true;
- new string[128];
- format(string, 128, "Byl si umlčený administrátorem %s (%d).", PlayerName(playerid), playerid);
- SendClientMessage(id, 0xFFFF77FF, string);
- format(string, 128, "Umlčel jsi hráče %s (%d).", PlayerName(id), id);
- SendClientMessage(playerid, 0xFFFF77FF, string);
- return 1;
- }
- //------------------------
- if(strcmp(cmdtext, "/unmute", true, 7) == 0)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "Musíš byt RCON Admin !");
- if(strlen(cmdtext) < 9) return SendClientMessage(playerid, 0xFF0000FF, "Použij: /unmute [ ID ]");
- new id = strval(cmdtext[8]);
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "Tento hráč není připojený !");
- if(IsPlayerNPC(id)) return SendClientMessage(playerid, 0xFF0000FF, "Toto je NPC !");
- if(Muted[id] == false) return SendClientMessage(playerid, 0xFF0000FF, "Tento není umlčený !");
- Muted[id] = false;
- new string[128];
- format(string, 128, "Byl si odmlčený administrátorem %s (%d).", PlayerName(playerid), playerid);
- SendClientMessage(id, 0xFFFF77FF, string);
- format(string, 128, "Odmlčel jsi hráče %s (%d).", PlayerName(id), id);
- SendClientMessage(playerid, 0xFFFF77FF, string);
- return 1;
- }
- //------------------------
- if(strcmp(cmdtext, "/setskin", true, 8) == 0)
- {
- if(strlen(cmdtext) < 10) return SendClientMessage(playerid, 0xFF0000FF, "Použij: /setskin [ ID ]");
- new id = strval(cmdtext[9]);
- if(!(0 <= id <= 299)) return SendClientMessage(playerid, 0xFF0000FF, "Použij: /setskin [ 0-299 ]");
- PlayerPlaySound(playerid, 1057, 0, 0, 0);
- SetPlayerSkin(playerid, id);
- return 1;
- }
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_CARMENU)
- {
- if(response)
- {
- if(PVehicle[playerid] != -1)
- {
- if(listitem == sizeof(VehicleNames)) PlayerPlaySound(playerid, 1057, 0, 0, 0);
- DestroyVehicle(PVehicle[playerid]), PVehicle[playerid] = -1;
- }
- else if(listitem == sizeof(VehicleNames)) PlayerPlaySound(playerid, 1053, 0, 0, 0);
- if(listitem != sizeof(VehicleNames)) // != zničit
- {
- new Float:x, Float:y, Float:z, Float:a;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, a);
- PVehicle[playerid] = CreateVehicle(VehicleNames[listitem][Modelid], x + floatmul(VEHCREATE_DISTANCE, floatsin(-a, degrees)), y + floatmul(VEHCREATE_DISTANCE, floatcos(-a, degrees)), z + 1.5, a + 90.0, random(128), random(128), 999999);
- PlayerPlaySound(playerid, 1057, 0, 0, 0);
- }
- }
- }
- //---------------------------
- else if(dialogid == DIALOG_CHATCOLORS)
- {
- if(response)
- {
- Chatcolor[playerid] = Chatcolors[listitem][Color];
- PlayerPlaySound(playerid, 1057, 0, 0, 0);
- new string[128];
- format(string, 128, "Nová barva písma v chate: {%06x}%s", Chatcolors[listitem][Color] >>> 8, Chatcolors[listitem][Name]);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- }
- }
- //---------------------------
- else if(dialogid == DIALOG_NICKCOLORS)
- {
- if(response)
- {
- SetPlayerColor(playerid, Nickcolors[listitem][Color]);
- PlayerPlaySound(playerid, 1057, 0, 0, 0);
- new string[128];
- format(string, 128, "Tvoje nová barva: {%06x}%s", Nickcolors[listitem][Color] >>> 8, Nickcolors[listitem][Name]);
- SendClientMessage(playerid, 0xFFFFFFFF, string);
- }
- }
- //---------------------------
- else if(dialogid == DIALOG_RADIO)
- {
- if(response)
- {
- if(listitem == 0) PlayAudioStreamForPlayer(playerid, "http://icecast3.play.cz/evropa2-128.mp3.m3u");
- else if(listitem == 1) PlayAudioStreamForPlayer(playerid, "http://ice2.europa2.sk/fm-europa2sk-128");
- else if(listitem == 2) PlayAudioStreamForPlayer(playerid, "http://icecast5.play.cz/impuls128.mp3.m3u");
- else if(listitem == 3) PlayAudioStreamForPlayer(playerid, "http://ice.abradio.cz:8000/fajn128.mp3");
- else if(listitem == 4) PlayAudioStreamForPlayer(playerid, "http://www.play.cz/radio/danceradio192.mp3.m3u");
- else if(listitem == 5) PlayAudioStreamForPlayer(playerid, "http://radio.ipip.cz:7996/listen.pls");
- else if(listitem == 6) PlayAudioStreamForPlayer(playerid, "http://static.expres.sk/public/data/Playlist/stream/mp3_high.pls");
- else StopAudioStreamForPlayer(playerid);
- PlayerPlaySound(playerid, 1057, 0, 0, 0);
- }
- }
- //---------------------------
- else if(dialogid == DIALOG_NEON)
- {
- if(response)
- {
- if(NeonObject[playerid][0] != -1) DestroyObject(NeonObject[playerid][0]), NeonObject[playerid][0] = -1;
- if(NeonObject[playerid][1] != -1) DestroyObject(NeonObject[playerid][1]), NeonObject[playerid][1] = -1;
- new modelid = 0;
- if(listitem == 0) modelid = 18647;
- else if(listitem == 1) modelid = 18648;
- else if(listitem == 2) modelid = 18649;
- else if(listitem == 3) modelid = 18650;
- else if(listitem == 4) modelid = 18651;
- else if(listitem == 5) modelid = 18652;
- if(modelid != 0)
- {
- if(GetPlayerVehicleID(playerid) == 0) return SendClientMessage(playerid, 0xFF0000FF, "Musíš být ve vozidle !");
- NeonObject[playerid][0] = CreateObject(modelid, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- NeonObject[playerid][1] = CreateObject(modelid, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- AttachObjectToVehicle(NeonObject[playerid][0], GetPlayerVehicleID(playerid), -0.68, 0.04, -0.48, 0.00, 0.00, 0.00);
- AttachObjectToVehicle(NeonObject[playerid][1], GetPlayerVehicleID(playerid), 0.68, 0.04, -0.48, 0.00, 0.00, 0.00);
- }
- PlayerPlaySound(playerid, 1057, 0, 0, 0);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement