How to make this?
#1

How to do a dialog(input style),that if I enter a word or number it says something(I know how to do it but I don't know what's worng):

pawn Код:
if(!strlen(inputtext))

if(inputtext == 2012)
{
   SendClientMessage(playerid,BLUE,"[I love this forum]");
}
Compiling errors:
D:\Jocuri\GTA\GTA San Andreas\SAMP\samp03csvr_win32\gamemodes\lsdm.pwn(5 06) : error 033: array must be indexed (variable "inputtext")
Reply
#2

pawn Код:
if ( strval( inputtext  ) == number )
{
     //Cody code
}

Remember to make response intern! To check first if it is in the dialog.
Making it outside a dialog check will make it for all the scripts when you press a button.
Reply
#3

Inputtext is a string and you don't use "==". If is a number you can use "strval". Example:

pawn Код:
if(strval(inputtext) == 2012)
{
// Functions
}
If is a string with word you can use "strcmp". Example:

pawn Код:
if(strcmp(inputtext,  "Hello", true) == 0)
{
//Functions
}
Visit this post in Wiki SAMP for strcmp -> https://sampwiki.blast.hk/wiki/Strcmp
Reply
#4

thanks man as I said this forum provides peoples with faster answers possible in the world
Reply
#5

lol thanks. In this forum there are many people of World.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)