Event on responding?
#1

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

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

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

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

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

your string is inputtext so replace all ename to inputtext without strcmp
Reply
#7

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

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

Код:
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);
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)