Even if you dont type anything..
#1

Heres my code:

pawn Код:
if(response)
    {
  switch(dialogid)
  {
        case 1:
     {
       if(!strcmp(inputtext,"2598",true))
       {
       SendClientMessage(playerid,0xFFFFFFFF,"You are being taken to \"Room 2598 - En' Suite\"");
       FadeColorForPlayer(playerid,0,0,0,0,0,0,0,255,15,0);
       SetPlayerInterior(playerid,12);
       SetPlayerPos(playerid,2324.33, -1144.79, 1050.71);
       FadeColorForPlayer(playerid,0,0,0,0,255,255,255,255,15,0);
       }
       else
       {
       SendClientMessage(playerid,0x8F8F8FFF,"Invalid Room Number");
       }
       if(response == 0)
       {
       SendClientMessage(playerid,0x8F8F8FFF,"Rooms");
       return 1;
            }
        }
    }
}
If i leave the box blank and press enter, It still teleports me to room 2598,
And also how would i get it to show another dialog if the player clicks rooms?

ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Sk in","Welcome to Visage Hotel Showroom \nPlease type in a Room Number to visit the room \nNote you cannot buy the rooms \nFor now this hotel is a Showroom","Enter","Rooms");
Reply
#2

add a check to see if they typed anything in.

pawn Код:
if(!inputtext[0])return SendClientMessage(playerid,0xFFFFFFFF,"You didn't type in a room number");
strcmp will return 0 (or pass) when compared with nothing.
Reply
#3

Ok may you check the last post on your Fader FS topic, Thanks
Reply
#4

Also another question:
How would i make it show another dialog if a player clicks Rooms
Reply
#5

make another case in that same dialog and well make it so it open a new dialog with rooms? :P
Reply
#6

Ok also where do i put that code that joe staff gave me
Reply
#7

Quote:
Originally Posted by Torran
Heres my code:

pawn Код:
if(response)
    {
  switch(dialogid)
  {
        case 1:
    {
       if(!strcmp(inputtext,"2598",true))
       {
       SendClientMessage(playerid,0xFFFFFFFF,"You are being taken to \"Room 2598 - En' Suite\"");
       FadeColorForPlayer(playerid,0,0,0,0,0,0,0,255,15,0);
       SetPlayerInterior(playerid,12);
       SetPlayerPos(playerid,2324.33, -1144.79, 1050.71);
       FadeColorForPlayer(playerid,0,0,0,0,255,255,255,255,15,0);
       }
       else if(!inputtext[0])return SendClientMessage(playerid,0xFFFFFFFF,"You didn't type in a room number");
       else (response == 0)
       {
       SendClientMessage(playerid,0x8F8F8FFF,"Rooms");
       return 1;
            }
        }
    }
}
Something like this i think or you can give it a different order its up to you
Reply
#8

Ok can you correct this for me

pawn Код:
if(response)
    {
  switch(dialogid)
  {
        case 1:
     {
       if(!strcmp(inputtext,"2598",true))
       {
       FadeColorForPlayer(playerid,0,0,0,0,0,0,0,255,15,0);
       SetTimerEx("HotelRoom2598", 2000, 0, "i", playerid);
        }
    case 2:
     {
        ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Rooms","2598 - En' Suite","Close","Enter Room");
            }
        }
    }
}
Reply
#9

You have to put the code I gave you BEFORE the strcmp.
Reply
#10

Ok and about the case thing?
And what about if they input a text that is invalid
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)