#1

Код:
CMD:buyradio(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid, 7.0, 1211.3070,-916.5763,43.0241))
	{
	    PlayerInfo[playerid][pRadio] = 1;
       	GivePlayerCash(playerid, -250);
		SendClientMessage( playerid, COLOR_YELLOW, "Du hast dir einen Radio gekauft! Du kannst es mit /radio verwenden." );
		SavePlayer(playerid);
	}
	else SendClientMessage( playerid, COLOR_GREY, "Du bist nicht beim BSN!" );
	return 1;
}
Problems
1) If i buy the radio i still can't use /radio
2) It doesn't change in the users file from Radio=0 to Radio=1

Here the radio command
Код:
CMD:radio(playerid)
{
	if(IsPlayerInAnyVehicle(playerid))
	{
	    if(PlayerInfo[playerid][pRadio] == 1)
    	{
        	ShowPlayerDialog(playerid,14147,DIALOG_STYLE_LIST,"{B89200}Wдhle einen Song aus den du dir anhцren willst:",songstr,"Einschalten","Ausschalten");
		}
		else
		{
			SendClientMessage(playerid,COLOR_GREY,"Du hast keinen Radio! Du kannst dir eins beim BSN kaufen.");
		}
		return 1;
	}
	else
	{
		SendClientMessage(playerid,COLOR_GREY,"Du kannst nur im Fahrzeug den Radio verwenden!");
	}
	return 1;
}
Reply
#2

@1
pawn Код:
CMD:radio(playerid)
{
    while(PlayerInfo[playerid][pRadio] != 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            ShowPlayerDialog(playerid,14147,DIALOG_STYLE_LIST,"{B89200}Wдhle einen Song aus den du dir anhцren willst:",songstr,"Einschalten","Ausschalten");
        }
        else if(!IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid,COLOR_GREY,"Du kannst nur im Fahrzeug den Radio verwenden!");
        }
        return 1;
    }
   
    if(PlayerInfo[playerid][pRadio] == 0)
    {
        SendClientMessage(playerid,COLOR_GREY,"Du hast keinen Radio! Du kannst dir eins beim BSN kaufen.");
        return 1;
    }
}
The code looks weirdly, but it should work (aint tested it btw)

@2. Is there any function which will write into file the new value of "Radio"?
Reply
#3

Nvm i already got it working now, i will give you +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)