Help cmd
#1

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;
}
Reply
#2

Just copy and paste?
Reply
#3

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
Reply
#4

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;
Reply
#5

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 
Reply
#6

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

What problem show us errors ?
Reply
#8

it doest show error it show compile unresponding
Reply
#9

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
Reply
#10

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

try it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)