radio will stop when you get out from the car
#1

This is the radio commands
Код:
    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;
	}
This is the public :
Код:
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;
}
The if
Код:
	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;
	}
Doesnt working...
Its not close the radio and dont write the text..

Someone can help me to fix that
When you get our from the car the radio will stop and its will write to you.
But if the radio = 0 its not write to you nothing
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)