Jump to content
  • 0

pomoc Rádio v hre


xMontyx

Dotaz

Zdravím, potrebujem poradiť vypisuje mi to errory a warningy. Ako to mám opraviť?

 

Kód:

 

#include <a_samp>
#pragma tabsize 0
#define DEIALOG_ID 7777
new radiolist[][][] =
{
{"http://icecast3.play.cz/evropa2-128.mp3","Evropa2"},
{"http://icecast2.play.cz:8000/HipHopStage128.mp3","HipHopStage"},
{"http://icecast5.play.cz:8000/expres128mp3","ExpresRadio"},
{"http://ice-01.lagardere.cz/web-80.m3u","frekrence1 80"},
{"http://icecast7.play.cz:443/cro1-128.mp3","Radiožurnál"},
{"http://ice-01.lagardere.cz/web-e2-retro.m3u","Evropa2 RETRO"},
{"http://mp3stream4.abradio.cz:8000/fajnblack128.mp3","Fajn Rádio Black"},
{"http://stream.funradio.sk:8000/fun128.mp3.m3u","Fun Radio"},
{"http://81.218.219.203:8000","Pulse Israel"},
{"http://icecast.clickfm.co.il:8002/click2dance","Dance"}
};
new bool:Radio[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/pradio",true))
{
	 new list[500];
	 for(new i; i <= sizeof(radiolist); i++)
	 {
if(i == sizeof(radiolist)) format(list,500,"%s\n \n{FF0000}Vypnout!!",list);
else format(list,500,"%s\n{FAFAFA}%02d) {FF9900}%s",list,i+1,radiolist[i][1]);
	 }
ShowPlayerDialog(playerid,DEIALOG_ID,DIALOG_STYLE_LIST,"{00C8C8}Prosím vyberte stanici",list,"Pustit","Zavřít");
	 return 1;
}
if(!strcmp(cmdtext,"/music-all-off",true) && IsPlayerAdmin(playerid))
{
	 for(new i,m=GetMaxPlayers(); i < m; i++) if(IsPlayerConnected(i) && Radio[i]) StopAudioStreamForPlayer(i),Radio[i] = false;
	 return 1;
}
if(!strcmp(cmdtext,"/minfo",true)) return SendClientMessage(playerid,0xFFFFFFAA,"
if(!strcmp(cmdtext,"/moff",true))
{
StopAudioStreamForPlayer(playerid);
Radio[playerid] = false;
return 1;
}
return 0;
}
public OnPlayerConnect(playerid) Radio[playerid] = false;
public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{
if(!response) return 1;
if(dialogid == DEIALOG_ID)
{
	 if(listitem == sizeof(radiolist)) return OnPlayerCommandText(playerid,"/pradio");
if(listitem == sizeof(radiolist)+1) return StopAudioStreamForPlayer(playerid),Radio[playerid] = false;
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid,radiolist[listitem][0]);
new str[50]; format(str,50,"Pustil jsis radio \"%s\"...",radiolist[listitem][1]);
SendClientMessage(playerid,0x33CCFFAA,str);
SendClientMessage(playerid,0xFFFFFFAA,"vypneš rádio: /MOFF");
Radio[playerid] = true;
return 1;
}
return 0;
}

 

Chyby:

 

E:\Users\Monty\Desktop\radio.pwn(28) : error 017: undefined symbol "ShowPlayerDialog"
E:\Users\Monty\Desktop\radio.pwn(33) : error 017: undefined symbol "StopAudioStreamForPlayer"
E:\Users\Monty\Desktop\radio.pwn(36) : error 037: invalid string (possibly non-terminated string)
E:\Users\Monty\Desktop\radio.pwn(36 -- 38) : error 001: expected token: ",", but found "if"
E:\Users\Monty\Desktop\radio.pwn(40) : error 017: undefined symbol "StopAudioStreamForPlayer"
E:\Users\Monty\Desktop\radio.pwn(47) : warning 235: public function lacks forward declaration (symbol "OnDialogResponse")
E:\Users\Monty\Desktop\radio.pwn(53) : error 017: undefined symbol "StopAudioStreamForPlayer"
E:\Users\Monty\Desktop\radio.pwn(54) : error 017: undefined symbol "StopAudioStreamForPlayer"
E:\Users\Monty\Desktop\radio.pwn(55) : error 017: undefined symbol "PlayAudioStreamForPlayer"
Pawn compiler 3.2.3664	 Copyright (c) 1997-2006, ITB CompuPhase

8 Errors.

Link to comment
Share on other sites

6 odpovědí na tuto otázku

Recommended Posts

  • 0

if(!strcmp(cmdtext,"/minfo",true)) return SendClientMessage(playerid,0xFFFFFFAA,"

 

Nemáš uzavřenou funkci. Ty uvozovky tam dělají bordel.

Link to comment
Share on other sites

  • 0

Takto to má vyzerať?

 

if(!strcmp(cmdtext,"/minfo",true))
}
return SendClientMessage(playerid,0xFFFFFFAA,"

 

Píše chyby:

 

E:\Users\Monty\Desktop\radio.pwn(28) : error 017: undefined symbol "ShowPlayerDialog"
E:\Users\Monty\Desktop\radio.pwn(33) : error 017: undefined symbol "StopAudioStreamForPlayer"
E:\Users\Monty\Desktop\radio.pwn(37) : error 029: invalid expression, assumed zero
E:\Users\Monty\Desktop\radio.pwn(37 -- 38) : warning 215: expression has no effect
E:\Users\Monty\Desktop\radio.pwn(38) : error 001: expected token: ";", but found "return"
E:\Users\Monty\Desktop\radio.pwn(38) : error 037: invalid string (possibly non-terminated string)
E:\Users\Monty\Desktop\radio.pwn(38) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664	 Copyright (c) 1997-2006, ITB CompuPhase

6 Errors.

Link to comment
Share on other sites

  • 0

Ne. Říkám, že nemáš uzavřenou funkci.

Takže:

 

if(!strcmp(cmdtext,"/minfo",true)) return SendClientMessage(playerid,0xFFFFFFAA,"text");

 

A navíc, k čemu ti ten příkaz vůbec je? Jestli chceš přes něj něco vypsat do chatu, tak takto se ti to sice vypíše, ale k tomu se ti tam dodá, že jsi zadal neplatný příkaz.

Takhle by to mělo vypadat:

 

if(!strcmp(cmdtext,"/minfo",true)) {
SendClientMessage(playerid,0xFFFFFFAA,"text");
return 1;
}

Link to comment
Share on other sites

  • 0

Stále vypisuje chyby:

 

E:\Users\Monty\Desktop\radio.pwn(28) : error 017: undefined symbol "ShowPlayerDialog"
E:\Users\Monty\Desktop\radio.pwn(33) : error 017: undefined symbol "StopAudioStreamForPlayer"
E:\Users\Monty\Desktop\radio.pwn(43) : error 017: undefined symbol "StopAudioStreamForPlayer"
E:\Users\Monty\Desktop\radio.pwn(50) : warning 235: public function lacks forward declaration (symbol "OnDialogResponse")
E:\Users\Monty\Desktop\radio.pwn(56) : error 017: undefined symbol "StopAudioStreamForPlayer"
E:\Users\Monty\Desktop\radio.pwn(57) : error 017: undefined symbol "StopAudioStreamForPlayer"
E:\Users\Monty\Desktop\radio.pwn(58) : error 017: undefined symbol "PlayAudioStreamForPlayer"
Pawn compiler 3.2.3664	 Copyright (c) 1997-2006, ITB CompuPhase

6 Errors.

Link to comment
Share on other sites

  • 0

Nemáš staré includy? Odkud jsi stahoval pawno a kdy?

 

Stáhni si novou verzi SAMP Serveru ZDE

 

V něm najdeš nové includy pro pawno

  • Líbí se mi to! (+1) 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...