SA-MP Forums Archive
Event on responding? - 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: Event on responding? (/showthread.php?tid=561224)



Event on responding? - vassilis - 01.02.2015

Hello guys i am making an event system
here is the dialog where you put the name to start event if you choose the name then it should procceed but it doesnt show game textforall :O its actually not starting the event!!
pawn Код:
case DIALOG_EVENTNAME:
    {
        if(response)
        {
            new ename[50],string[100];
            if(strcmp(ename,"%s",true))
            {
                playerid = adminevent[playerid];
                eventteleports = 1;
                eventon = 1;
                if(eventamount == 1)
                {
                    format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~10,000~n~~w~type ~r~ /yes~w~ to join!",ename);
                    GameTextForAll(string,3000,5);
                }
                if(eventamount == 2)
                {
                    format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~100,000~n~~w~type ~r~ /yes~w~ to join!",ename);
                    GameTextForAll(string,3000,5);
                }
                if(eventamount == 3)
                {
                    format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~500,000~n~~w~type ~r~ /yes~w~ to join!",ename);
                    GameTextForAll(string,3000,5);
                }
                if(eventamount == 1)
                {
                    format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~1,000,000~n~~w~type ~r~ /yes~w~ to join!",ename);
                    GameTextForAll(string,3000,5);
                }
           }
        }



Re: Event on responding? - Matess - 01.02.2015

PHP код:
case DIALOG_EVENTNAME:
    {
        if(
response)
        {
            new 
ename[50],string[100];
            if(
strcmp(ename,"%s",true))//check this
            
{
                
playerid adminevent[playerid];
                
eventteleports 1;
                
eventon 1;
                if(
eventamount == 1)
                {
                    
format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~10,000~n~~w~type ~r~ /yes~w~ to join!",ename);
                    
GameTextForAll(string,3000,5);
                }
                if(
eventamount == 2)
                {
                    
format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~100,000~n~~w~type ~r~ /yes~w~ to join!",ename);
                    
GameTextForAll(string,3000,5);
                }
                if(
eventamount == 3)
                {
                    
format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~500,000~n~~w~type ~r~ /yes~w~ to join!",ename);
                    
GameTextForAll(string,3000,5);
                }
                if(
eventamount == 1)
                {
                    
format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~1,000,000~n~~w~type ~r~ /yes~w~ to join!",ename);
                    
GameTextForAll(string,3000,5);
                }
           }
        } 



Re: Event on responding? - Vince - 01.02.2015

Quote:
pawn Код:
if(strcmp(ename,"%s",true))
What the hell is this even?

Also you should really just assign the reward to another variable so you'll only have to format and send the message once.


Re: Event on responding? - ExtremeReality - 01.02.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
What the hell is this even?

Also you should really just assign the reward to another variable so you'll only have to format and send the message once.
As vince mentioned that example didn't make sense, unless you intentionally want to compare the string to %s, which I don't think the intention is to do.


Re: Event on responding? - vassilis - 01.02.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
What the hell is this even?

Also you should really just assign the reward to another variable so you'll only have to format and send the message once.
https://sampforum.blast.hk/showthread.php?tid=561170
Vince i am trying to get the text the player input on dialog... but i didnt really get how to make it and noone replied so i came in a conclusion but didn't actually work properly..
How i could actually get the string that it is inserted to Dialog ?


Re: Event on responding? - Jefff - 01.02.2015

your string is inputtext so replace all ename to inputtext without strcmp


Re: Event on responding? - vassilis - 01.02.2015

Quote:
Originally Posted by Jefff
Посмотреть сообщение
your string is inputtext so replace all ename to inputtext without strcmp
Could you show me an example?


Re: Event on responding? - Jefff - 01.02.2015

pawn Код:
case DIALOG_EVENTNAME:
{
    if(response)
    {
        new string[100];
        playerid = adminevent[playerid];
        eventteleports = 1;
        eventon = 1;
        if(eventamount == 1)
        {
            format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~10,000~n~~w~type ~r~ /yes~w~ to join!",inputtext);
            GameTextForAll(string,3000,5);
        }
        if(eventamount == 2)
        {
            format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~100,000~n~~w~type ~r~ /yes~w~ to join!",inputtext);
            GameTextForAll(string,3000,5);
        }
        if(eventamount == 3)
        {
            format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~500,000~n~~w~type ~r~ /yes~w~ to join!",inputtext);
            GameTextForAll(string,3000,5);
        }
        if(eventamount == 1)
        {
            format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~1,000,000~n~~w~type ~r~ /yes~w~ to join!",inputtext);
            GameTextForAll(string,3000,5);
        }
    }



Re: Event on responding? - F1re - 01.02.2015

Код:
case DIALOG_EVENTNAME:
{
    if(response)
    {
        new string[128];
        playerid = adminevent[playerid];
        eventteleports = 1;
        eventon = 1;
	switch(eventamount)
        {
            case 1: format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~10,000~n~~w~type ~r~ /yes~w~ to join!",inputtext);
            case 2: format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~100,000~n~~w~type ~r~ /yes~w~ to join!",inputtext);
            case 3: format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~500,000~n~~w~type ~r~ /yes~w~ to join!",inputtext);
            case 4: format(string,sizeof(string),"~b~ %s~w~ has started! price : ~g~$~w~1,000,000~n~~w~type ~r~ /yes~w~ to join!",inputtext);
        }
        GameTextForAll(string,3000,5);
    }
}