SA-MP Forums Archive
Define - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Define (/showthread.php?tid=334261)



Define - 3RoR - 14.04.2012

how to define this ?
Код:
if(strcmp(cmd,"/radio", true) == 0)
{
            ShowPlayerDialog(playerid, 102, DIALOG_STYLE_INPUT, "Radio System by GBLTeam","{FFFFFF}Write the {009BFF}URL{FFFFFF} from Radio Station:", "Okay", "Exit");
            return 1;
    }
Код:
	if(dialogid == 102) //
	{
      if(response)
		 {
      for(new i=0; i<250; i++)
     {
       if(IsPlayerConnected(i))
      {
           PlayAudioStreamForPlayer(i, inputtext);
         }
      }
    }
}



Re: Define - .FuneraL. - 14.04.2012

pawn Код:
#define DIALOGRADIO 1000

if(strcmp(cmd,"/radio", true) == 0)
{
            ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_INPUT, "Radio System by GBLTeam","{FFFFFF}Write the {009BFF}URL{FFFFFF} from Radio Station:", "Okay", "Exit");
}

------------------------------------------------------------------------------------------------------------

    if(dialogid == DIALOGRADIO) //
    {
      if(response)
         {
      for(new i=0; i<250; i++)
     {
       if(IsPlayerConnected(i))
      {
           PlayAudioStreamForPlayer(i, inputtext);
         }
      }
    }
}
            return 1;
    }
That's what you were looking for?


Re: Define - Shetch - 14.04.2012

Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
pawn Код:
#define DIALOGRADIO

if(strcmp(cmd,"/radio", true) == 0)
{
            ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_INPUT, "Radio System by GBLTeam","{FFFFFF}Write the {009BFF}URL{FFFFFF} from Radio Station:", "Okay", "Exit");
}

------------------------------------------------------------------------------------------------------------

    if(dialogid == DIALOGRADIO) //
    {
      if(response)
         {
      for(new i=0; i<250; i++)
     {
       if(IsPlayerConnected(i))
      {
           PlayAudioStreamForPlayer(i, inputtext);
         }
      }
    }
}
            return 1;
    }
That's what you were looking for?
I think it's supose to be like this:

Код:
#define DIALOGRADIO 102



Re: Define - .FuneraL. - 14.04.2012

Quote:
Originally Posted by Shetch
Посмотреть сообщение
I think it's supose to be like this:

Код:
#define DIALOGRADIO 102
is correct, I forgot to put the number after the name defined


Re: Define - park4bmx - 14.04.2012

no underscore needed !! how u defined it thats how it should be !
pawn Код:
#define RADIODIALOG 84555

if(strcmp(cmd,"/radio", true) == 0)
{
            ShowPlayerDialog(playerid, RADIODIALOG , DIALOG_STYLE_INPUT, "Radio System by GBLTeam","{FFFFFF}Write the {009BFF}URL{FFFFFF} from Radio Station:", "Okay", "Exit");
}

if(dialogid == RADIODIALOG ) //
{
//rest of code...
return 1;
}



Re: Define - 3RoR - 14.04.2012

Thanks, LOCK !


Re: Define - 3RoR - 14.04.2012

I Put it in GameMod, AND ISN't WORKING :@@@@@@@@@


Re: Define - park4bmx - 14.04.2012

Quote:
Originally Posted by 3RoR
Посмотреть сообщение
I Put it in GameMod, AND ISN't WORKING :@@@@@@@@@
what exactly and how exactly did you put it ?


Re: Define - 3RoR - 14.04.2012

Quote:

if(strcmp(cmd,"/radio", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameShark] >= 1)
{
ShowPlayerDialog(playerid, RADIODIALOG , DIALOG_STYLE_INPUT, "Muzika","{FFFFFF}Vnesete go {009BFF}Linkot{FFFFFF} od radio stanicata:", "Ok", "Izlezi");
}
else
{
SendClientMessage(playerid,COLOR_WHITE,"{FF4040}GR ESKA:{FFFFFF}Ne ste Ovlasteni za Ovaa Komanda.");
}
return 1;
}

The Command
Quote:

if(dialogid == RADIODIALOG) //
{
if(response)
{
if(IsPlayerConnected(playerid))
{
PlayAudioStreamForPlayer(playerid, inputtext);
}
return 1;
}
}

the public and on the top defined !


Re: Define - park4bmx - 14.04.2012

what do you mean The Command you didt put that code under a command did u ?
it suppost to go likes this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == RADIODIALOG) //
    {
        if(response)
        {
            if(IsPlayerConnected(playerid))PlayAudioStreamForPlayer(playerid, inputtext);
        }
     }
}
EDIT for that small amount of code to save lines use this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == RADIODIALOG && response) PlayAudioStreamForPlayer(playerid,inputtext);
}
i dont think u need to check if the players is connect,becouse if he isnt then the callback would call anyway