ocmd:carradio(playerid, params[])
{
new query [512];
if(GetPlayerVehicleSeat(playerid) != 1 && GetPlayerVehicleSeat(playerid) != 0)return SendClientMessage(playerid, 0xAFAFAFFF, "Du bist kein Fahrer oder Beifahrer eines Fahrzeuges!");
format(query, sizeof(query), "SELECT * FROM radiostations WHERE radio_active='1'", Spielername(playerid));
new rows, fields;
cache_get_data(rows, fields);
if(!rows)return SendClientMessage(playerid, 0xAFAFAFFF, "Es sind keine Radiosender vorhanden.");
new radios, dstring[1028];
while(radios < rows) {
new temp[512];
cache_get_field_content(radios, "radio_name", temp);
format(dstring, sizeof dstring, "%s%s\n", dstring, temp);
radios++;
}
ShowPlayerDialog(playerid, DIALOG_CARMENU_RADIO, DIALOG_STYLE_LIST, "Radiosender", dstring, "Einschalten", "Ausschalten");
return 1;
}
ocmd:listradios(playerid, params[])
{
new query [512];
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, 0xAFAFAFFF, "Du bist kein Administrator.");
format(query, sizeof(query), "SELECT * FROM radiostations WHERE radio_active='1'", Spielername(playerid));
new rows, fields;
cache_get_data(rows, fields);
if(!rows)return ShowPlayerDialog(playerid, DIALOG_RADIO_MANAGE_LIST, DIALOG_STYLE_LIST, "Radiosender", "Es sind keine Radiosender vorhanden", "Hinzufügen", "");
new radios, dstring[1028];
while(radios < rows) {
new temp[512];
cache_get_field_content(radios, "radio_name", temp);
format(dstring, sizeof dstring, "%s[%i] %s\n", cache_get_field_content_int(radios, "id"), dstring, temp);
radios++;
}
ShowPlayerDialog(playerid, DIALOG_RADIO_MANAGE_LIST, DIALOG_STYLE_LIST, "Radiosender", dstring, "Hinzufügen", "Löschen");
return 1;
}
Jemand eine Ahnung warum dies so ist ?