PDA

View Full Version : Second Dialog isn't showing up.


Mr.1337
20/06/2012, 04:26 PM
Alright, I've been working really hard on my new radio system, as I've decided to create it as Dialogs, so I created two dialogs (I will show code later) as the first dialog shows, but the second does not show up at all.

Here are the codes.

At the first, I've added this:


// Radio Station
#define RADIOSTATIONMENU 9312
#define MUSICSTATIONS 9313


And then, I've added this command (I'm using ZCMD):

CMD:playradio(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessageEx(playerid, COLOR_GRAD2, " In-case you want to turn the radio on, you have to be in a vehicle!");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
ShowPlayerDialog(playerid, 9312, DIALOG_STYLE_LIST, "Radio Station", "Radio Channels\nTurn the music off", "Select", "Cancel");
}
return 1;
}


And, I've added these too (The dialogs):

if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
return 1;

}
}
}

if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
}
}


I guess there's no errors in them, but when I go ingame, I type the command which is /playradio, the first dialog shows up(9312) as I click on 'Radio Channels' so the the other dialog would show up (9313) as nothing happens when I click on it, I need help ASAP please.

[MM]RoXoR[FS]
20/06/2012, 04:44 PM
Found many problems in {}.. many were unclosed


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
}
return 1;

}
}
if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
}
return 1;
}

Mr.1337
20/06/2012, 04:48 PM
RoXoR[FS];1935172']Found many problems in {}.. many were unclosed


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
}
return 1;

}
}
if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
}
return 1;
}



My pawno crashes when I add your codes.

[MM]RoXoR[FS]
20/06/2012, 05:08 PM
In all your listitem , there is no use of Distance.
Remove it(or comment if for later use).
Also add this at top of your script.#pragma tabsize 0

Here is your code compiling. Enter /radio to listem music.

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#pragma tabsize 0
#define COLOR_WHITE 0xFFFFFF
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/radio", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 9312, DIALOG_STYLE_LIST, "Radio Station", "Radio Channels\nTurn the music off", "Select", "Cancel");
return 1;
}
return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
}
return 1;

}
}
if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
}
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

Mimic
20/06/2012, 05:12 PM
Also, your indentation is killing me. Something like this is much better.


if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
}
if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
}
return 1;
}
}

[MM]RoXoR[FS]
20/06/2012, 05:17 PM
Also, your indentation is killing me. Something like this is much better.


He is right..

Mr.1337
20/06/2012, 05:48 PM
Not working...

Mr.1337
20/06/2012, 06:34 PM
Bump.

Mr.1337
20/06/2012, 09:23 PM
I really apologize for triple posting, as I want this to be fixed ATM..

Mimic
20/06/2012, 09:54 PM
Sorry for my late reply, PM me your team viewer details.

Mr.1337
21/06/2012, 06:41 AM
I don't like someone going into my PC, you can help me without that. Still, waiting for help.

rachit_rocks
21/06/2012, 06:43 AM
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
}
return 1;

}
}
if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
}
return 1;
}

Mr.1337
21/06/2012, 06:48 AM
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
}
return 1;

}
}
if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
}
return 1;
}

My pawno crashed ..

Skaizo
21/06/2012, 07:16 AM
try


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");

}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
}
}
if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
}
}
return 1;
}//callback

Mr.1337
21/06/2012, 07:25 AM
Still.. my pawno crashs.

[MM]RoXoR[FS]
21/06/2012, 07:54 AM
All our codes are correct.
Infact you could have tried compiling my code, and see that it works.

There is some other problem in your code.
Paste the full code.

And add #pragma tabsize 0 to top of your script as you have a lot of loose indentation problem.

Mr.1337
21/06/2012, 08:02 AM
RoXoR[FS];1936561']All our codes are correct.
Infact you could have tried compiling my code, and see that it works.

There is some other problem in your code.
Paste the full code.

And add #pragma tabsize 0 to top of your script as you have a lot of loose indentation problem.

It doesn't crash anymore, as the second dialog doesn't show up.. uhh.

I've thought that it's a filterscript problem, so I've unloaded all of my filterscripts, but sill

[MM]RoXoR[FS]
21/06/2012, 08:19 AM
If you try and compile this code, you will find that your dialogs are fine

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#pragma tabsize 0
#define COLOR_WHITE 0xFFFFFF
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/radio", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 9312, DIALOG_STYLE_LIST, "Radio Station", "Radio Channels\nTurn the music off", "Select", "Cancel");
return 1;
}
return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
}
return 1;

}
}
if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
}
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

Mr.1337
21/06/2012, 08:28 AM
RoXoR[FS];1936588']If you try and compile this code, you will find that your dialogs are fine

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#pragma tabsize 0
#define COLOR_WHITE 0xFFFFFF
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/radio", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 9312, DIALOG_STYLE_LIST, "Radio Station", "Radio Channels\nTurn the music off", "Select", "Cancel");
return 1;
}
return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
}
return 1;

}
}
if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
}
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

True, but when I use this filterscript, none of my gamemode commands work

Zerberus
21/06/2012, 09:08 AM
It is normal, that no gamemode command is working now.
You have all SAMP functions in the filterscript and "return 1;". Remove all function, where no command or line is in it.
For example:
public OnPlayerSpawn(playerid)
{
return 1;
}

You can just remove that from your filterscript.

[A]ndrei
21/06/2012, 09:10 AM
Sorry to inform man but you should update pwn if this is happing to you...

[MM]RoXoR[FS]
21/06/2012, 09:31 AM
Use this code to use it as your filterscript


// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>
#pragma tabsize 0
#define COLOR_WHITE 0xFFFFFF
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

#else

main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}

#endif


public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/radio", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 9312, DIALOG_STYLE_LIST, "Radio Station", "Radio Channels\nTurn the music off", "Select", "Cancel");
return 1;
}
return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
}
return 1;

}
}
if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
}
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}

Zerberus
21/06/2012, 09:35 AM
With this code, you can use the gememode commands too:

// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>
#pragma tabsize 0
#define COLOR_WHITE 0xFFFFFF
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/radio", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 9312, DIALOG_STYLE_LIST, "Radio Station", "Radio Channels\nTurn the music off", "Select", "Cancel");
return 1;
}
return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
}
return 1;

}
}
if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
}
return 1;
}

Mr.1337
21/06/2012, 09:47 AM
With this code, you can use the gememode commands too:

// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>
#pragma tabsize 0
#define COLOR_WHITE 0xFFFFFF
#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/radio", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid, 9312, DIALOG_STYLE_LIST, "Radio Station", "Radio Channels\nTurn the music off", "Select", "Cancel");
return 1;
}
return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9313)
{
if(response)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 1)
{
new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 2)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 3)
{
new Float:X, Float:Y, Float:Z;// Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 4)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 5)
{
new Float:X, Float:Y, Float:Z;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 6)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 7)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 8)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 9)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 10)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 11)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 12)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 13)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 14)
{
new Float:X, Float:Y, Float:Z ;//Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 15)
{
new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
return 1;
}
if(listitem == 16)
{
new Float:X, Float:Y, Float:Z;//, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessage(playerid, COLOR_WHITE, "Music started!");
}
return 1;

}
}
if(dialogid == 9312)
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
}
if(listitem == 1)
{
StopAudioStreamForPlayer(playerid);
}
return 1;
}
}
return 1;
}


Thanks alot! (REP+)

jessejanssen
21/06/2012, 10:06 AM
I hadn't seen your issue was already solved so I made a code, but quickly looking over all the given codes mine will be "faster" processed and will have less timeloss by reading unneccesary coding.

switch(dialogid)
{
case 9313:
{
if(response)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 10.0;
GetPlayerPos(playerid, X, Y, Z);
switch(listitem)
{
case 0:
{
PlayAudioStreamForPlayer(playerid, "http://205.188.215.230:8002/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 1:
{
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8004/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 2:
{
PlayAudioStreamForPlayer(playerid, "http://205.188.215.228:8002/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 3:
{
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8006/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 4:
{
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8042/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 5:
{
PlayAudioStreamForPlayer(playerid, "http://205.188.215.225:8022/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 6:
{
PlayAudioStreamForPlayer(playerid, "http://205.188.215.229:8040/listen.pls");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 7:
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=357703");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 8:
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1026951");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 9:
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=2057543");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 10:
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1543115");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 11:
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=616366");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 12:
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283516");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 13:
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=737152");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 14:
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=259629");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 15:
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1193516");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
return 1;
}
case 16:
{
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1878");
SendClientMessageEx(playerid, COLOR_WHITE, "Music started!");
}
}
return 1;
}
}
case 9312:
{
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 9313, DIALOG_STYLE_LIST, "Choose the channel you would like to listen!", "977 The Hitz Channel\n977 The 80s Channel\n181.FM - POWER 181\n1POWER\n108.FM - THE HITLIST\nChroniX Metal\nHOT 108 JAMZ\nSpart FM Tupac Channel\nAlex Jones FM\nFrench Kiss FM\nBlackBeat FM\nDEFJAY\nPower Hitz\nSky FM\nOld School 99\nTrance Channel\nIbiza Sonica", "Select", "Cancel");
return 1;
}
case 1:
{
StopAudioStreamForPlayer(playerid);
return 1;
}
}
return 1;
}
}
}

Best regards,
Jesse

[MM]RoXoR[FS]
21/06/2012, 10:12 AM
With this code, you can use the gememode commands too:

:clucker:
And this guy copied my code . >:(
/me runs

Zerberus
21/06/2012, 10:52 AM
RoXoR[FS];1936702']:clucker:
And this guy copied my code . >:(
/me runs

And what's your problem? I just showed him what he wants, so calm down. ;)