if(!strcmp(cmdtext,"/vhradio",true)) { new list[520]; if(!IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in a vehicle !"); return 1; } for(new i,s=sizeof(radiolist); i <= s; i++) { if(i == s) format(list,520,"%s\n \n{FF0000}You stopped the radio",list); else format(list,520,"%s\n{FAFAFA}%02d) {FF9900}%s",list,i+1,radiolist[i][1]); } ShowPlayerDialog(playerid,DEIALOG_ID,DIALOG_STYLE_LIST,"{00C8C8}Choose station",list,"choose","exit"); format(string, sizeof(string), "* %s Turn on the radio", sendername); ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); return 1; } if(!strcmp(cmdtext,"/vhallradiooff",true) && IsPlayerAdmin(playerid)) { for(new i,m=GetMaxPlayers(); i < m; i++) if(IsPlayerConnected(i) && Radio[i]) StopAudioStreamForPlayer(i),Radio[i] = false; return 1; } if(!strcmp(cmdtext,"/vhradioff",true)) { if(!IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_LIGHTRED, "You are not in a vehicle !"); return 1; } StopAudioStreamForPlayer(playerid); Radio[playerid] = false; SendClientMessage(playerid, COLOR_WHITE, "You stopped the radio stream !"); format(string, sizeof(string), "* %s Turn off the radio", sendername); ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); return 1; }
public OnPlayerExitVehicle(playerid, vehicleid) { if (GetPlayerState(playerid) == 1) { return 1; } if(dying[playerid] == 1){TogglePlayerControllable(playerid, 0); ApplyAnimation(playerid,"PED","KO_skid_front",4.1,0,1,1,1,0);} AffectVehicleDamageToPlayer(playerid,vehicleid,0); if(IsAHarvest(vehicleid)) { if(FarmerVar[playerid] == 1) { SetTimer("FarmerExit", 7000, 0); GameTextForPlayer(playerid, "~n~~w~You have ~r~7~w~ seconds~n~to get back on a harvest", 5000, 3); } } /*if(Radio[playerid]==true) { new string[256]; StopAudioStreamForPlayer(playerid); Radio[playerid] = false; format(string, sizeof(string), "* %s stopped the radio station and get out from the car", GetPlayerNameEx(playerid)); ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); //return 1; }*/ if(IsADrugHarvest(vehicleid)) { if(DrugFarmerVar[playerid] == 1) { SetTimer("DrugFarmerExit", 7000, 0); GameTextForPlayer(playerid, "~n~~w~You have ~b~7~w~ seconds~n~to get back on a harvest", 5000, 3); } } if(IsADmv(vehicleid)) { } if(IsASmuggleCar(vehicleid)) { if(SmugglerWork[playerid] == 1) { SetTimer("SmugglerExit", 7000, 0); GameTextForPlayer(playerid, "~n~~w~You have ~r~7~w~ seconds~n~to get back in car", 5000, 3); } } if(gGas[playerid] == 1) { GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~Left car", 500, 3); } if (BusrouteEast[playerid][0] != 0 || BusrouteWest[playerid][0] != 0) { BusrouteEnd(playerid, vehicleid); } if (IsABus(vehicleid)) { for (new i=0; i<=PLAYERS; i++) { if (IsPlayerConnected(i)) { if (BusrouteEast[i][0] != 0 && BusrouteEast[i][1] == vehicleid) { //BusrouteEast[i][2] --; GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~g~Passenger Left The Bus", 5000, 3); } else if (BusrouteWest[i][0] != 0 && BusrouteWest[i][1] == vehicleid) { //BusrouteWest[i][2] --; GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~g~Passenger Left The Bus", 5000, 3); } } } } if(SeatBelt[playerid]==true) { new string[256]; SeatBelt[playerid]=false; format(string, sizeof(string), "* %s unbuckles his/her seat belt", GetPlayerNameEx(playerid)); ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } return 1; }
if(Radio[playerid]==true) { new string[256]; StopAudioStreamForPlayer(playerid); Radio[playerid] = false; format(string, sizeof(string), "* %s stopped the radio station and get out from the car", GetPlayerNameEx(playerid)); ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); //return 1; }
/*if(Radio[playerid]==true) { new string[256]; StopAudioStreamForPlayer(playerid); Radio[playerid] = false; format(string, sizeof(string), "* %s stopped the radio station and get out from the car", GetPlayerNameEx(playerid)); ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); //return 1; }*/
Код:
/*if(Radio[playerid]==true) { new string[256]; StopAudioStreamForPlayer(playerid); Radio[playerid] = false; format(string, sizeof(string), "* %s stopped the radio station and get out from the car", GetPlayerNameEx(playerid)); ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); //return 1; }*/ |
for(new i,m=GetMaxPlayers(); i < m; i++) if(IsPlayerConnected(i) && Radio[i]) StopAudioStreamForPlayer(i),Radio[i] = false;
format(string, sizeof(string), "* %s turns off the radio.", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
Under OnPlayerExitVehicle
pawn Код:
|
public OnPlayerExitVehicle(playerid, vehicleid)
{
for(new i,m=GetMaxPlayers(); i < m; i++)
{
if(IsPlayerConnected(i) && Radio[i])
{
new string[128],
pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
StopAudioStreamForPlayer(i);
Radio[i] = false;
format(string, sizeof(string), "* %s turns off the radio.", pName);
ProxDetector(15.0, playerid, string,
COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
return 1;
}
this should work
pawn Код:
|
for(new i,m=GetMaxPlayers(); i < m; i++)
{
if(IsPlayerConnected(i
Why ..
pawn Код:
|
You should ask yourself that
I actually copied it from your code (look above) |
if(Radio[playerid]==true)
{
new string[256];
StopAudioStreamForPlayer(playerid);
Radio[playerid] = false;
format(string, sizeof(string), "* %s stopped the radio station and get out from the car", GetPlayerNameEx(playerid));
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
//return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate != PLAYER_STATE_DRIVER && Radio[playerid])
{
new string[128];
Radio[playerid] = false;
format(string, sizeof(string), "* %s stopped the radio station and get out from the car", GetPlayerNameEx(playerid));
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
StopAudioStreamForPlayer(playerid);
}
return 1;
}