How to make this? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make this? (
/showthread.php?tid=249946)
How to make this? -
Cjgogo - 21.04.2011
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")
Re: How to make this? -
Zh3r0 - 21.04.2011
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.
Re: How to make this? -
mitosking - 21.04.2011
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
Re: How to make this? -
Cjgogo - 21.04.2011
thanks man as I said this forum provides peoples with faster answers possible in the world
Re: How to make this? -
mitosking - 21.04.2011
lol
thanks. In this forum there are many people of World.