03.01.2012, 07:03
Please help me i get 4 errors...i want to pres numpad 4&6 to change radio stations but it doesent work please help.....
//-------------------------------------------------
// Internet radio example
// © 2011 SA-MP Team
//-------------------------------------------------
#pragma tabsize 0
#include <a_samp>
//-------------------------------------------------
public OnFilterScriptInit()
{
return 1;
}
//-------------------------------------------------
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == KEY_ANALOG_LEFT)
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://www.radiofg.com/streams/fg.pls");
SendClientMessage(i, 0xFF330000, "Now Playing: Radio FG");
}
}
return 1;
}
case 1:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://www.radiofg.com/streams/fgu.pls");
SendClientMessage(i, 0xFF330000, "Now Playing: Underground FG");
}
}
return 1;
}
case 2:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://www.radiofeeds.co.uk/112s.png");
SendClientMessage(i, 0xFF330000, "Now Playing: Kiss 100");
}
}
return 1;
}
}
}
}
return 1;
}
// stop the internet stream
else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
{
StopAudioStreamForPlayer(playerid);
}
return 0;
}
//-------------------------------------------------
public OnPlayerUpdate(playerid)
{
if(!IsPlayerConnected(playerid)) return 0;
if(IsPlayerNPC(playerid)) return 1;
// Handle playing SomaFM at the alhambra
if(GetPlayerInterior(playerid) == 17) {
if(IsPlayerInRangeOfPoint(playerid,70.0,489.5824,-14.7563,1000.6797)) { // alhambra middle
if(!GetPVarInt(playerid,"alhambra")) {
SetPVarInt(playerid,"alhambra",1);
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls",480.9575,-3.5402,1002.0781,40.0,true);
}
}
}
else {
if(GetPVarInt(playerid,"alhambra")) {
DeletePVar(playerid,"alhambra");
StopAudioStreamForPlayer(playerid);
}
}
return 1;
}
//-------------------------------------------------
//-------------------------------------------------
// Internet radio example
// © 2011 SA-MP Team
//-------------------------------------------------
#pragma tabsize 0
#include <a_samp>
//-------------------------------------------------
public OnFilterScriptInit()
{
return 1;
}
//-------------------------------------------------
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == KEY_ANALOG_LEFT)
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://www.radiofg.com/streams/fg.pls");
SendClientMessage(i, 0xFF330000, "Now Playing: Radio FG");
}
}
return 1;
}
case 1:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://www.radiofg.com/streams/fgu.pls");
SendClientMessage(i, 0xFF330000, "Now Playing: Underground FG");
}
}
return 1;
}
case 2:
{
new vehid = GetPlayerVehicleID(playerid);
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInVehicle(i, vehid))
{
PlayAudioStreamForPlayer(i, "http://www.radiofeeds.co.uk/112s.png");
SendClientMessage(i, 0xFF330000, "Now Playing: Kiss 100");
}
}
return 1;
}
}
}
}
return 1;
}
// stop the internet stream
else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
{
StopAudioStreamForPlayer(playerid);
}
return 0;
}
//-------------------------------------------------
public OnPlayerUpdate(playerid)
{
if(!IsPlayerConnected(playerid)) return 0;
if(IsPlayerNPC(playerid)) return 1;
// Handle playing SomaFM at the alhambra
if(GetPlayerInterior(playerid) == 17) {
if(IsPlayerInRangeOfPoint(playerid,70.0,489.5824,-14.7563,1000.6797)) { // alhambra middle
if(!GetPVarInt(playerid,"alhambra")) {
SetPVarInt(playerid,"alhambra",1);
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls",480.9575,-3.5402,1002.0781,40.0,true);
}
}
}
else {
if(GetPVarInt(playerid,"alhambra")) {
DeletePVar(playerid,"alhambra");
StopAudioStreamForPlayer(playerid);
}
}
return 1;
}
//-------------------------------------------------