SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   stream (https://forum.sa-mp.com/showthread.php?t=667532)

zeus99 27/06/2019 09:16 AM

stream
 
Hello everyone i need help in stream script

this is play stream for one player

CMD: ppmp3(playerid, params[])
{
//check if the player is a admin
LevelCheck(playerid, 2);
new id, link[256];
if(sscanf(params, "us[256]", id, link)) return SendClientMessage(playerid, -1, "/ppmp3 [PlayerID] [Link]");

StopAudioStreamForPlayer(id);
PlayAudioStreamForPlayer(id, link);
return 1;
}


how to add show dialog for player [Adminstator audio stream]

><><><><

car play

CMD:cmplay(playerid, params[])
{
foreach(Player, i)
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Usage:: /cmplay [Link]");
if(IsPlayerInAnyVehicle(i))
PlayAudioStreamForPlayer(i, params);
}
return 1;
}


how to play in just one car? /ppmp3 url and play stream just in mycar

><><

or how to playall url stream just in one world?

CMD: playall(playerid, params[])
{
//check if the player is a admin
LevelCheck(playerid, 6);
foreach(Player, i)
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Usage:: /playall [Link]");
PlayAudioStreamForPlayer(i, params);
}
return 1;
}

khRamin78 27/06/2019 10:28 AM

Re: stream
 
i hope it will help you

PHP Code:

/*Global*/
#define DIALOG_AUDIOSHOW 1212
new AudioLinks[5][2][] = {
        {
"Name0","Link0"},
        {
"Name1","Link1"},
        {
"Name2","Link2"},
        {
"Name3","Link3"},
        {
"Name4","Link4"}
};

/*Showing Dialog when player type cmd*/
new string[128];

for(new 
i;i<5/*(This is size of Audiolinks);i++*/)
{
    
strcat(string,AudioLinks[i][0]/*This will include olny name*/);
    
strcat(string,"/n");
}
ShowPlayerDialog(playerid,DIALOG_AUDIOSHOW,"Please choose your station:",string,"OK!","QUIT!");

/*When ever a player respone to dialog > public OnDialogResponse*/

if(dialogid == DIALOG_AUDIOSHOW)
{
    if(
response)
    {
        
StopAudioStreamForPlayer(id);
        
PlayAudioStreamForPlayer(idAudioLinks[listitem][1]/*This will give the link!*/);
    }
}


// For your car problem

CMD:cmplay(playeridparams[])
{
    new 
vehicleid;
    
vehicleid GetPlayerVehicleID(playerid);
    foreach(
Playeri)
    {
        if(
isnull(params)) return SendClientMessage(playeridCOLOR_RED"Usage:: /cmplay [Link]");
        if(
IsPlayerInAnyVehicle(i))
        {
            if(
GetPlayerVehicleID(i) = vehicleid)
            {
                
PlayAudioStreamForPlayer(iparams);
            }
        }
        
    }
    return 
1;
}

// For Your VW Problem

CMDplayall(playeridparams[])
{
    
//check if the player is a admin
    
LevelCheck(playerid6);
    new 
vw;
    
vw GetPlayerVirtualWorld(playerid);
    foreach(
Playeri)
    {
        if(
isnull(params)) return SendClientMessage(playeridCOLOR_RED"Usage:: /playall [Link]");
        if(
GetPlayerVirtualWorld(i) == vw)
        {
            
PlayAudioStreamForPlayer(iparams);
        }
        
    }
    return 
1


zeus99 27/06/2019 11:40 AM

Re: stream
 
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\fixes.inc(4904) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\fixes.inc(6105) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\fixes.inc(6105) : warning 219: local variable "pos" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\sscanf2.inc(305) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\sscanf2.inc(305) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\sscanf2.inc(365) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\sscanf2.inc(365) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\YSI\internal\y_version.inc(2 85) : warning 219: local variable "pos" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\textdraws.inc(40) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\textdraws.inc(55) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\textdraws.inc(104) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\textdraws.inc(135) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\serverlock.inc(27) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\zcmd.inc(90) : warning 219: local variable "pos" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\dutils.inc(16) : warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\dutils.inc(26) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\dutils.inc(142) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\dutils.inc(246) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\dutils.inc(303) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\dutils.inc(365) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\pawno\include\dini.inc(239) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(59) : warning 201: redefinition of constant/macro (symbol "COLOR_ORANGE")
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(60) : warning 201: redefinition of constant/macro (symbol "COLOR_RED")
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(62) : warning 201: redefinition of constant/macro (symbol "COLOR_YELLOW")
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(89) : error 010: invalid function or declaration
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(166) : error 021: symbol already defined: "string"
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(353) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(620) : warning 225: unreachable code
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(697) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(709) : warning 219: local variable "X" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(709) : warning 219: local variable "Y" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(709) : warning 219: local variable "Z" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(808) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(929) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(1038) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(1108) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(1140) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(1244) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(1251) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(1343) : error 017: undefined symbol "id"
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(1344) : error 017: undefined symbol "id"
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(1864) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(1942) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(1975) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(2007) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(2042) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(2051) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(2094) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(2280) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3066) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3101) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3146) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3317) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3419) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3428) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3437) : warning 219: local variable "pos" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3454) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3484) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3505) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3530) : warning 219: local variable "pos" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3547) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3572) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3581) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3591) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3644) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(3992) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(4002) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(4021) : warning 211: possibly unintended assignment
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(4021) : error 022: must be lvalue (non-constant)
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(4021) : warning 215: expression has no effect
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(4021) : error 001: expected token: ";", but found ")"
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(4021) : error 029: invalid expression, assumed zero
C:\Users\chosa\OneDrive\Desktop\Sufr Freeroam Full Package\filterscripts\gadmin.pwn(4021) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.

nbx2000 27/06/2019 08:18 PM

Re: stream
 
you have already defined some variables. change name variable in conflict
string changed to str2[128] example define id example new id ;

zeus99 28/06/2019 07:20 AM

Re: stream
 
bro tnx worked
bun i need to play stream for all players in driver car
and play stream for all players in one vw


All times are GMT. The time now is 10:05 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.