/radio command help
#1

How would I make this command ONLY play for people in the car? I do not want anyone to hear this unless they are in the car....

Код:
CMD:radio(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /radio [url]");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You need be on car when you want listen radio");
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You need to be driving a car to use the radio.");
    format(string, sizeof(string), "%s switches the song on their radio to song '%s'.", RPN(playerid), params);
    SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
    format(string,sizeof(string),"http://americanrp.x10.mx/music/%s",params);
    foreach(Player, i)
    {
        PlayAudioStreamForPlayer(i, string);
    }
    return 1;
}
Reply


Messages In This Thread
/radio command help - by MichaelWharton101 - 19.04.2013, 00:07
Re: /radio command help - by Scrillex - 19.04.2013, 00:09
Re: /radio command help - by Giroud12 - 19.04.2013, 00:10
Re: /radio command help - by MichaelWharton101 - 19.04.2013, 00:20
Re: /radio command help - by Jefff - 19.04.2013, 00:23
Re: /radio command help - by Giroud12 - 19.04.2013, 00:24
Re: /radio command help - by MichaelWharton101 - 19.04.2013, 00:24
Re: /radio command help - by Scrillex - 19.04.2013, 00:25
Re: /radio command help - by Giroud12 - 19.04.2013, 00:26

Forum Jump:


Users browsing this thread: 1 Guest(s)