SA-MP Forums Archive
Help cmd - 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: Help cmd (/showthread.php?tid=513891)



Help cmd - Shazwan - 18.05.2014

How can i put this in the gamemode?

Код:
#include    <a_samp>
#include    <zcmd>

#define     DIALOG_MUSIC        (100)

COMMAND:playtube(playerid,params[])
        return ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN", "Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel"), 1;

public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{
        if(dialogid == DIALOG_MUSIC)
        {
                if(!response) return 1;
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN", "Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel");
                if(strfind(inputtext,"www.*******.com",true) == -1) return ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN", "Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel");
                new localURL[128];
                strmid(localURL,inputtext,strfind(inputtext, "v=")+2,strfind(inputtext, "v=")+19);
                new localString[128];
                format(localString, 128, "http://mwrserver.com/*******.php?videoid=%s",localURL);
                for(new i; i != MAX_PLAYERS; i++) PlayAudioStreamForPlayer(i,localString);
        }
        return 1;
}



AW: Help cmd - Skimmer - 18.05.2014

Just copy and paste?


Re: Help cmd - rumen98 - 18.05.2014

OMG LOL are you kiddin me?

just copy and paste

PHP код:
#include    <zcmd> 
on top of your gamemode if you dont have it
copy and paste
PHP код:
COMMAND:playtube(playerid,params[])
        return 
ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN""Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel"), 1
somewhere in your gamemode
and copy and paste
PHP код:
       if(dialogid == DIALOG_MUSIC)
        {
                if(!
response) return 1;
                if(!
strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN""Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel");
                if(
strfind(inputtext,"www.*******.com",true) == -1) return ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN""Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel");
                new 
localURL[128];
                
strmid(localURL,inputtext,strfind(inputtext"v=")+2,strfind(inputtext"v=")+19);
                new 
localString[128];
                
format(localString128"http://mwrserver.com/*******.php?videoid=%s",localURL);
                for(new 
i!= MAX_PLAYERSi++) PlayAudioStreamForPlayer(i,localString);
        } 
under
PHP код:
OnDialogResponse 
and you are ready

or just add it like filterscript in your server.cfg


Re: Help cmd - Shazwan - 18.05.2014

umm is their a proper cmd that have { and }? the complile turn out not responding


Код:
COMMAND:playtube(playerid,params[])
        return ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN", "Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel"), 1;



Re: Help cmd - rumen98 - 18.05.2014

Hey here's the release script
https://sampforum.blast.hk/showthread.php?tid=510080
Quote:

Re: Help cmd
umm is their a proper cmd that have { and }? the complile turn out not responding

i think thats will work without { and }

After compile, I get this
PHP код:
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 



Re: Help cmd - Shazwan - 18.05.2014

i know but if i put in a gamemode it give me problem


Re: Help cmd - rumen98 - 18.05.2014

What problem show us errors ?


Re: Help cmd - Shazwan - 18.05.2014

it doest show error it show compile unresponding


Re: Help cmd - Shazwan - 18.05.2014

Or can you help this add

Код:
#include    <a_samp>
#include    <zcmd>

#define     DIALOG_MUSIC        (100)

COMMAND:playtube(playerid,params[])
        return ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN", "Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel"), 1;

public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
{
        if(dialogid == DIALOG_MUSIC)
        {
                if(!response) return 1;
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN", "Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel");
                if(strfind(inputtext,"www.*******.com",true) == -1) return ShowPlayerDialog(playerid,DIALOG_MUSIC,DIALOG_STYLE_INPUT,"PlayTube by iRaiDeN", "Please input the URL of the song you want (Example: wwww.youtube.com/watch?v=VID Change the VID!)","Play","Cancel");
                new localURL[128];
                strmid(localURL,inputtext,strfind(inputtext, "v=")+2,strfind(inputtext, "v=")+19);
                new localString[128];
                format(localString, 128, "http://mwrserver.com/*******.php?videoid=%s",localURL);
                for(new i; i != MAX_PLAYERS; i++) PlayAudioStreamForPlayer(i,localString);
        }
        return 1;
}
inside this http://pastebin.com/hxr4htYj


Re: Help cmd - rumen98 - 18.05.2014

heres simplified version
http://pastebin.com/56PAgruz

try it