23.12.2015, 15:49
Hello everyone, Im trying to make /radio command for example:
/radio [0-20]
I try to do like /radio 0 is turning off radio
/radio 1 is playing 1 radio station and i want to add another of course, like /radio 2, /radio 3... etc
Radio must work only in motor vehicle (not bike for example) but somehow its not working
i think its problem with those params, changing 0-20 is not good
/radio [0-20]
I try to do like /radio 0 is turning off radio
/radio 1 is playing 1 radio station and i want to add another of course, like /radio 2, /radio 3... etc
Radio must work only in motor vehicle (not bike for example) but somehow its not working
i think its problem with those params, changing 0-20 is not good
Код:
YCMD:radio(playerid, params[], help) //Komanda za radio { #pragma unused help new x_nr[128]; new hID; hID = GetPlayerVehicleID(playerid); if(IsPlayerConnected(playerid) && gPlayerLogged[playerid] == 0) return LOGINGRESKA if(PlayerInfo[playerid][pSpawn] == 5) return AREAGRESKA if(IsBike(hID)) return BIKEGRESKARADIO if(IsPlayerInVehicle(playerid, hID)) { if(sscanf(params, "{u}", x_nr)) return SCM(playerid, C_KORISTENJE, "[UPUTA]: /radio [0-20]"); if(strcmp(x_nr, "0", true) == 0){ StopAudioStreamForPlayer(playerid); PlayerRadio[playerid]=0; new stringgh[512]; format(stringgh, sizeof(stringgh), "RADIO: ~w~%d", PlayerRadio[playerid]); PlayerTextDrawSetString(playerid, Brzinomjer[4][playerid], stringgh); }else if(strcmp(x_nr, "1", true) == 0){ PlayAudioStreamForPlayer(playerid, "http://80.237.157.49:8070/"); PlayerRadio[playerid]=1; new stringgh[512]; format(stringgh, sizeof(stringgh), "RADIO: ~w~%d", PlayerRadio[playerid]); PlayerTextDrawSetString(playerid, Brzinomjer[4][playerid], stringgh); } } return 1; }