Need help with command (with 1 param) /radio
#5

Quote:
Originally Posted by [ND]xXZeusXx.
Посмотреть сообщение
What?
if he want to use integer he can use parameter named x_nr

if(x_nr == 1) --- radio 1
if(x_nr == 2) -- radio 2
No reason to string compare to convert the parametre from a string when you can set it as integer.
PHP код:
YCMD:radio(playeridparams[], help//Komanda za radio 

     
#pragma unused help 
     
new x_nr
     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(playeridhID)) 
     { 
         if(
sscanf(params"d"x_nr)) return SCM(playeridC_KORISTENJE"[UPUTA]: /radio [0-20]"); 
         if(
x_nr == 0
         { 
            
StopAudioStreamForPlayer(playerid); 
            
PlayerRadio[playerid]=0
            new 
stringgh[512]; 
            
format(stringghsizeof(stringgh), "RADIO: ~w~%d"PlayerRadio[playerid]); 
            
PlayerTextDrawSetString(playeridBrzinomjer[4][playerid], stringgh); 
         } 
         else if(
x_nr == 1
         { 
                
PlayAudioStreamForPlayer(playerid"http://80.237.157.49:8070/"); 
                
PlayerRadio[playerid]=1
                new 
stringgh[512]; 
                
format(stringghsizeof(stringgh), "RADIO: ~w~%d"PlayerRadio[playerid]); 
                
PlayerTextDrawSetString(playeridBrzinomjer[4][playerid], stringgh); 
         }
     }
     return 
1

It is more simple like that i guess. Correct me if i am wrong please.
Now lets check what you ask about.
Reply


Messages In This Thread
Need help with command (with 1 param) /radio - by Saddin - 23.12.2015, 15:49
Re: Need help with command (with 1 param) /radio - by vassilis - 23.12.2015, 15:55
Re: Need help with command (with 1 param) /radio - by Saddin - 23.12.2015, 16:13
Re: Need help with command (with 1 param) /radio - by Ritzy2K - 23.12.2015, 16:17
Re: Need help with command (with 1 param) /radio - by vassilis - 23.12.2015, 16:42

Forum Jump:


Users browsing this thread: 1 Guest(s)