Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Nachtclub by varreZ.de - 19.11.2013 */
- #include <a_samp>
- #include <ocmd>
- #define DIALOG_DJ 9990
- #define DIALOG_SENDER 9991
- #define DIALOG_DIREKT 9992
- #define COLOR_WHITE 0xFFFFFFFFF
- new IsDJ[MAX_PLAYERS] = 0;
- new DJObjects[4][MAX_PLAYERS];
- new bool:DJcp[MAX_PLAYERS];
- enum Nachtclubs {
- Float:nX, //EingangX
- Float:nY, //EingangY
- Float:nZ, //EingangZ
- Float:nAX, //AusgangX
- Float:nAY, //AusgangY
- Float:nAZ, //AusgangZ
- Float:nDX, //DutyPunktX
- Float:nDY, //DutyPunktY
- Float:nDZ, //DutyPunktZ
- nInt, //Interior
- nVWorld, //VirtualWorld
- nTitle[128], //Nachtclub Name
- nPreis //Nachtclub Eintrittspreis
- }
- new nClub[0][Nachtclubs] = {
- {1022.4595,-1122.6289,23.8709,493.390991,-22.722799,1000.679687,495.9022,-3.9414,1002.0781,17,0,"Nachtclub",500}
- };
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Nachtclub by varreZ (varrez.de) geladen!");
- print("--------------------------------------\n");
- for(new nc = 0; nc <sizeof(nClub); nc++){
- new icon[64];
- CreatePickup(1239, 23, nClub[nc][nX], nClub[nc][nY], nClub[nc][nZ]);
- Create3DTextLabel("Taste 'Enter' um als DJ aufzulegen!", COLOR_WHITE, nClub[nc][nDX], nClub[nc][nDY], nClub[nc][nDZ], 5.0, 0);
- CreatePickup(1239, 23, nClub[nc][nDX], nClub[nc][nDY], nClub[nc][nDZ]);
- format(icon, sizeof(icon), "%s\nEintritt: %d\nZum Betreten: [ Enter ]", nClub[nc][nTitle], nClub[nc][nPreis]);
- Create3DTextLabel(icon, COLOR_WHITE, nClub[nc][nX], nClub[nc][nY], nClub[nc][nZ], 5.0, 0);
- }
- return 1;
- }
- public OnFilterScriptExit(){
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
- if(newkeys & 16){
- for(new i = 0; i < sizeof(nClub); i++){
- if(IsPlayerInRangeOfPoint(playerid,3.0,nClub[i][nX],nClub[i][nY],nClub[i][nZ])){
- SetPlayerVirtualWorld(playerid, nClub[i][nVWorld]);
- SetPlayerInterior(playerid, nClub[i][nInt]);
- SetPlayerPos(playerid, nClub[i][nAX], nClub[i][nAY], nClub[i][nAZ]);
- GivePlayerMoney(playerid, -nClub[i][nPreis]);
- }
- if(IsPlayerInRangeOfPoint(playerid,3.0,nClub[i][nAX], nClub[i][nAY], nClub[i][nAZ]) && GetPlayerVirtualWorld(playerid) == nClub[i][nVWorld]){
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, nClub[i][nX],nClub[i][nY],nClub[i][nZ]);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3.0, nClub[i][nDX], nClub[i][nDY], nClub[i][nDZ])){
- for(new p = 0; p<MAX_PLAYERS; p++){
- if(IsDJ[p] == 1 && GetPlayerVirtualWorld(p) == nClub[i][nVWorld]){
- SendClientMessage(p, COLOR_WHITE, "Hier ist aktuell schon ein DJ am auflegen!");
- }
- }
- if(IsDJ[playerid] == 0 && GetPlayerVirtualWorld(playerid) == nClub[i][nVWorld]){
- DJObjects[0][playerid] = CreateObject(3383, 487.5, -2.7999999523163, 1001.4000244141, 0, 0, 0);
- DJObjects[1][playerid] = CreateObject(1954, 486.29998779297, -2.9000000953674, 1002.5999755859, 0, 0, 0);
- DJObjects[2][playerid] = CreateObject(14820, 487.89999389648, -2.5, 1002.5999755859, 0, 0, 0);
- DJObjects[3][playerid] = CreateObject(14820, 487.89999389648, -3.2000000476837, 1002.5999755859, 0, 0, 0);
- SendClientMessage(playerid, COLOR_WHITE, "Du bist nun DJ in diesem Nachtclub! Laufe zum Roten Checkpoint.");
- SetPlayerCheckpoint(playerid, 487.3483,-1.6183,1002.3828,3.0);
- DJcp[playerid] = true;
- IsDJ[playerid] = 1;
- }
- else {
- DestroyObject(DJObjects[0][playerid]);
- DestroyObject(DJObjects[1][playerid]);
- DestroyObject(DJObjects[2][playerid]);
- DestroyObject(DJObjects[3][playerid]);
- SendClientMessage(playerid, COLOR_WHITE, "Du hast dein Eqiupment abgebaut.");
- IsDJ[playerid] = 0;
- }
- }
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
- switch(dialogid){
- case DIALOG_DJ: {
- if(response == 0) {}
- if(response == 1) {
- switch(listitem){
- case 0: {
- ShowPlayerDialog(playerid, DIALOG_SENDER, DIALOG_STYLE_LIST, "Senden wählen", "Sender1\nSender2\nSender3", "Wählen", "Zurück");
- }
- case 1: { ShowPlayerDialog(playerid, DIALOG_DIREKT, DIALOG_STYLE_INPUT, "Direkt Link", "Hinweiß: Der Link muss direkt auf eine Audio Datei leiten:", "Starten", "Zurück"); }
- case 2: {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- for(new i = 0; i<MAX_PLAYERS; i++) {
- if(IsPlayerInRangeOfPoint(i, 100.0, x, y, z)) return StopAudioStreamForPlayer(i);
- }
- }
- case 3: {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- for(new i = 0; i<MAX_PLAYERS; i++) {
- if(IsPlayerInRangeOfPoint(i, 100.0, x, y, z)) return PlayAudioStreamForPlayer(i, "http://radiosendereintragen.de/listen.mp3", x, y, z, 5.0, 1);
- }
- }
- }
- }
- }
- case DIALOG_SENDER: {
- if(response == 0) { ShowPlayerDialog(playerid, DIALOG_DJ, DIALOG_STYLE_LIST, "DJ Aktionen","Sender wählen\nDirekt Link\nAusschalten\nAnschalten","Wählen","Schließen"); }
- if(response == 1) {
- switch(listitem) {
- case 0: { //Radio Sender 1
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- for(new i = 0; i<MAX_PLAYERS; i++) {
- if(IsPlayerInRangeOfPoint(i, 100.0, x, y, z)) return PlayAudioStreamForPlayer(i, "http://radiosendereintragen.de/listen.mp3", x, y, z, 5.0, 1);
- }
- }
- case 1: { //Radio Sender 2
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- for(new i = 0; i<MAX_PLAYERS; i++) {
- if(IsPlayerInRangeOfPoint(i, 100.0, x, y, z)) return PlayAudioStreamForPlayer(i, "http://radiosendereintragen.de/listen.mp3", x, y, z, 5.0, 1);
- }
- }
- case 2: { //Radio Sender 3
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- for(new i = 0; i<MAX_PLAYERS; i++) {
- if(IsPlayerInRangeOfPoint(i, 100.0, x, y, z)) return PlayAudioStreamForPlayer(i, "http://radiosendereintragen.de/listen.mp3", x, y, z, 5.0, 1);
- }
- }
- }
- }
- }
- case DIALOG_DIREKT: {
- if(response == 0) { ShowPlayerDialog(playerid, DIALOG_DJ, DIALOG_STYLE_LIST, "DJ Aktionen","Sender wählen\nDirekt Link\nAusschalten\nAnschalten","Wählen","Schließen"); }
- if(response == 1) {
- if(strfind(inputtext, "http://", true) != -1 || strfind(inputtext, "www.", true) != -1){
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- for(new i = 0; i<MAX_PLAYERS; i++) {
- if(IsPlayerInRangeOfPoint(i, 100.0, x, y, z)) return PlayAudioStreamForPlayer(i, inputtext, x, y, z, 5.0, 1);
- }
- }
- else {
- SendClientMessage(playerid, COLOR_WHITE, "Der Direkt-Link muss 'http://' sowie 'www.' beinhalten!");
- ShowPlayerDialog(playerid, DIALOG_DIREKT, DIALOG_STYLE_INPUT, "Direkt Link", "Hinweiß: Der Link muss direkt auf eine Audio Datei leiten:", "Starten", "Zurück");
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid){
- if(DJcp[playerid] == true) {
- DJcp[playerid] = false;
- SendClientMessage(playerid, COLOR_WHITE, "Nutze '/dj' für weitere Funktionen.");
- }
- DisablePlayerCheckpoint(playerid);
- return 1;
- }
- ocmd:dj(playerid){
- if(IsDJ[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "Du bist nicht als DJ Aktiv!");
- ShowPlayerDialog(playerid, DIALOG_DJ, DIALOG_STYLE_LIST, "DJ Aktionen","Sender wählen\nDirekt Link\nAusschalten\nAnschalten","Wählen","Schließen");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment