- 0
eroare fs radio 0.3d
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
gabbii
Am luat acest fs cu radio dp http://forum.sa-mp.com/showthread.php?t=279953
am bagat posturile de radio pe care le vreau dar imi da eroare, ce pot face?
uitati eroare
uitati tot scriptul..
[pawn]#include <a_samp>
#undef MAX_PLAYERS
#define MAX_PLAYERS 25
forward PlayVehicleRadioForPlayer(playerid,online);
forward NonChangeRadio(playerid);
forward IsAVel(vehicleid);
forward HideStationTitle(playerid,numberid);
new VehRadio[MAX_VEHICLES];
new PassengerInCar[MAX_VEHICLES][8];
new bool:WaitForBuf[MAX_PLAYERS];
new PassengerSeat[MAX_PLAYERS];
new OldCar[MAX_PLAYERS];
enum params
{
Float:X,Float:Y,Title[64],URL[64]
};
new RadioParams[7][params] = {
{205.0,20.0,"Kiss FM: Asculti doar hituri!","http://ro-life.tk/music/radio/kissfm.m3u"}, // 1
{200.0,20.0,"Radio21 FM: Hit dupa Hit","http://ro-life.tk/music/radio/Radio21.m3u"}, //2
{220.0,20.0,"Europa FM: Cea mai buna muzica din 8 pana azi!","http://ro-life.tk/music/radio/europafm.m3u"}, //3
{260.0,20.0,"Pro FM: Lega lize JOY","http://ro-life.tk/music/radio/profm.m3u"}, //4
{205.0,20.0,"RadioZu FM: Hiturile se asculta la Zu","http://ro-life.tk/music/radio/radiozu.m3u"}, //5
{235.0,20.0,"Vibe FM: DanceFloor radio","http://ro-life.tk/music/radio/vibefm.pls"}, // 6
{270.0,20.0,"Radio Off","none"} //7
};
new Text:StationText[7];
public OnFilterScriptInit()
{
print("----------------------------------");
print("FS Online Radio In Vehicles Loaded");
print("Author: SDraw");
print("----------------------------------");
for(new i = 0; i < MAX_VEHICLES; i++)
{
VehRadio = 2;
for(new s = 1; s < 8; s++) PassengerInCar = INVALID_PLAYER_ID;
}
for(new t = 0; t < sizeof(StationText); t++)
{
StationText[t] = TextDrawCreate(RadioParams[t][X],RadioParams[t][Y],RadioParams[t][Title]);
TextDrawAlignment(StationText[t],0);
TextDrawBackgroundColor(StationText[t],0x000000ff);
TextDrawFont(StationText[t],2);
TextDrawLetterSize(StationText[t],0.4,1.6);
TextDrawColor(StationText[t],0x906010ff);
TextDrawSetOutline(StationText[t],1);
TextDrawSetProportional(StationText[t],2);
TextDrawSetShadow(StationText[t],1);
}
return 1;
}
public OnFilterScriptExit()
{
for(new t = 0; t < sizeof(StationText); t++) TextDrawDestroy(StationText[t]);
return 1;
}
public OnPlayerConnect(playerid)
{
WaitForBuf[playerid] = false;
OldCar[playerid] = INVALID_VEHICLE_ID;
PassengerSeat[playerid] = 0;
return 0;
}
public OnPlayerDisconnect(playerid)
{
if(OldCar[playerid] != INVALID_VEHICLE_ID) PassengerInCar[OldCar[playerid]][PassengerSeat[playerid]] = INVALID_PLAYER_ID;
return 0;
}
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
new veh = GetPlayerVehicleID(playerid);
if(IsAVel(veh)) return 0;
new seat = GetPlayerVehicleSeat(playerid);
if(seat != 0)
{
PassengerInCar[veh][seat] = playerid;
PassengerSeat[playerid] = seat;
OldCar[playerid] = veh;
}
PlayVehicleRadioForPlayer(playerid,VehRadio[veh]);
}
if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
{
new veh = GetPlayerVehicleID(playerid);
if(IsAVel(veh)) return 0;
StopAudioStreamForPlayer(playerid);
if(OldCar[playerid] != INVALID_VEHICLE_ID)
{
PassengerInCar[OldCar[playerid]][PassengerSeat[playerid]] = INVALID_PLAYER_ID;
OldCar[playerid] = INVALID_VEHICLE_ID;
}
}
return 0;
}
public PlayVehicleRadioForPlayer(playerid,online)
{
if(online == 0)
{
StopAudioStreamForPlayer(playerid);
TextDrawShowForPlayer(playerid,StationText[7]);
WaitForBuf[playerid] = true;
SetTimerEx("NonChangeRadio",5000,false,"i",playerid);
SetTimerEx("HideStationTitle",3500,false,"id",playerid,16);
return 1;
}
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid,RadioParams[online - 1]);
TextDrawShowForPlayer(playerid,StationText[online - 1]);
WaitForBuf[playerid] = true;
SetTimerEx("NonChangeRadio",5000,false,"i",playerid);
SetTimerEx("HideStationTitle",3500,false,"id",playerid,online - 1);
return 1;
}
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
{
if(newkeys == KEY_ACTION)
{
if(!IsPlayerInAnyVehicle(playerid)) return 0;
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 0;
new veh = GetPlayerVehicleID(playerid);
if(IsAVel(veh)) return 0;
if(WaitForBuf[playerid]) return SendClientMessage(playerid,0xFF0000FF,"* You can't change radio. Wait for 5 seconds.");
VehRadio[veh]++;
if(VehRadio[veh] == 7) VehRadio[veh] = 0;
PlayVehicleRadioForPlayer(playerid,VehRadio[veh]);
for(new s = 1; s < 8; s++)
{
if(PassengerInCar[veh] != INVALID_PLAYER_ID) PlayVehicleRadioForPlayer(PassengerInCar[veh],VehRadio[veh]);
}
}
if(newkeys == 132)
{
if(!IsPlayerInAnyVehicle(playerid)) return 0;
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 0;
new veh = GetPlayerVehicleID(playerid);
if(IsAVel(veh)) return 0;
if(WaitForBuf[playerid]) return SendClientMessage(playerid,0xFF0000FF,"* You can't change radio. Wait for 5 seconds.");
VehRadio[veh]--;
if(VehRadio[veh] == -1) VehRadio[veh] = 16;
PlayVehicleRadioForPlayer(playerid,VehRadio[veh]);
for(new s = 1; s < 8; s++)
{
if(PassengerInCar[veh] != INVALID_PLAYER_ID) PlayVehicleRadioForPlayer(PassengerInCar[veh],VehRadio[veh]);
}
}
return 0;
}
public NonChangeRadio(playerid) return WaitForBuf[playerid] = false;
public HideStationTitle(playerid,numberid) return TextDrawHideForPlayer(playerid,StationText[numberid]);
public IsAVel(vehicleid)
{
new model = GetVehicleModel(vehicleid);
if(model == 481 || model == 509 || model == 510) return 1;
return 0;
}[/pawn]
uitati si linia 112
[pawn]TextDrawShowForPlayer(playerid,StationText[7]);[/pawn]
2 answers to this question
Recommended Posts