how to resume audio for player ?
#1

Hi all im making a radio script but i cant figure out how to resume audio stream for player when he exits vehicle and enters again.

I made that when player exits a car his audio stream stops automaticly,
and audio stream works only in car so if someone could help me out i'd be greatfull alot.

Reply
#2

Quote:
Originally Posted by Dude_Lebowski
Посмотреть сообщение
Hi all im making a radio script but i cant figure out how to resume audio stream for player when he exits vehicle and enters again.

I made that when player exits a car his audio stream stops automaticly,
and audio stream works only in car so if someone could help me out i'd be greatfull alot.

Why don't you do something like,

OnPlayerEnterVehicle
if(PlayerInfo[playerid][pRadioResume] == 1) {
PlayAudioForPlayer <<< or whatever.
then

with the CMD:radioon or w/e

do PlayerInfo[playerid][pRadioResume] = 1; so you set it to one?
Reply
#3

Quote:
Originally Posted by Daniel_Davis
Посмотреть сообщение
Why don't you do something like,

OnPlayerEnterVehicle
if(PlayerInfo[playerid][pRadioResume] == 1) {
PlayAudioForPlayer <<< or whatever.
then

with the CMD:radioon or w/e

do PlayerInfo[playerid][pRadioResume] = 1; so you set it to one?
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(102) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(102) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(102) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(102) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(102) : fatal error 107: too many error messages on one line


How can i define it ?
Reply
#4

Quote:
Originally Posted by Dude_Lebowski
Посмотреть сообщение
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(102) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(102) : warning 215: expression has no effect
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(102) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(102) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(102) : fatal error 107: too many error messages on one line


How can i define it ?
PlayerInfo is usually an enumerator, abbreviated as enum in pawno. You need to create an enum called PlayerInfo in your script, before using it in the command.
Reply
#5

holy crap now im lost totally i try to include enum but it keeps showing me undefined simbols things
Reply
#6

Quote:
Originally Posted by Dude_Lebowski
Посмотреть сообщение
holy crap now im lost totally i try to include enum but it keeps showing me undefined simbols things
You need to create an enum, how could you possibly include it ?

Let me show you an example of an enum called Info.

pawn Код:
enum Info
{
   AdminLevel,
}
new PlayerInfo[MAX_PLAYERS][Info];
Reply
#7

Quote:
Originally Posted by Xtreme_playa
Посмотреть сообщение
You need to create an enum, how could you possibly include it ?

Let me show you an example of an enum called Info.

pawn Код:
enum Info
{
   AdminLevel,
}
new PlayerInfo[MAX_PLAYERS][Info];

yeah i saw that too on wiki and created it under a_samp
just like in example.
But:

C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(106) : error 017: undefined symbol "pRadioResume"
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(10 : error 001: expected token: ";", but found "new"
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(185) : error 017: undefined symbol "pRadioResume"
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(186) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(190) : warning 217: loose indentation
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(190) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(190) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(195) : error 030: compound statement not closed at the end of file (started at line 185)

:O im just worring about this undefined symbol "pRadioResume" things idk how to fix them.
Reply
#8

Quote:
Originally Posted by Dude_Lebowski
Посмотреть сообщение
yeah i saw that too on wiki and created it under a_samp
just like in example.
But:

C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(106) : error 017: undefined symbol "pRadioResume"
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(10 : error 001: expected token: ";", but found "new"
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(185) : error 017: undefined symbol "pRadioResume"
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(186) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(190) : warning 217: loose indentation
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(190) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(190) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\Documents and Settings\Admin\Desktop\Server\filterscripts\radio. pwn(195) : error 030: compound statement not closed at the end of file (started at line 185)

:O im just worring about this undefined symbol "pRadioResume" things idk how to fix them.
pawn Код:
new pRadioResume[MAX_PLAYERS][name of your enum here];
Reply
#9

pawn Код:
enum pInfo
{
  RaadioResume
};
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#10

i got no errors but when i exit car it stops sound but it doesent resume it

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)