How to compare input text? - 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: How to compare input text? (
/showthread.php?tid=350619)
How to compare input text? -
(ETR)Geto244 - 13.06.2012
Hello!
Im making new gm and im having problem to compare input text.
I want to make, when player file dosnґt exist, than he must put server password before he can continue registration.
I have made:
Код:
#define ServeriParool "prooviparool" // defined server password
public OnPlayerConnect(playerid) // When player connects
{
if (PlayerFile_Load(playerid) == 1) // Is player file exist
{
ShowPlayerDialog(playerid, Dialoog_Sisselogimine, DIALOG_STYLE_PASSWORD, "Tere tulemast tagasi", "Sisesta parool et laadida enda kasutaja", "Logi Sisse", "Loobu"); // Show player login dialog
}
else // else if player file dont exist
ShowPlayerDialog(playerid, Dialoog_RegFoorumistLoetud, DIALOG_STYLE_INPUT, "TERE TULEMAST MEIE SERVERISSE!", "Sisesta serveri parool", "Jдtka", "Loobu"); // Show player dialog server password
return 1;
}
// In dialog response
case Dialoog_RegFoorumistLoetud: // dialog server password
{
switch (response)
{
case 1:
{
if(strlen(inputtext) == ServeriParool) // If input text and server password is true
{
ShowPlayerDialog(playerid, Dialoog_RegFoorumistLoetudOk, DIALOG_STYLE_MSGBOX,"PAROOL ХIGE", "TUBLI! OLED ILUSASTI FOORUMIST KХIK LДBI LUGENUD JA NХUSTUNUD TINGIMUSTEGA. \n\ JДTKAME NЬЬD REGISTREERIMISEGA", "JДTKA"}; // When password is ok, show next dialog
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "Et jдtkata registreerumist mine loe foorumist reeglite kohta ja saad parooli mida siia sisestama pead");
Kick(playerid); // Else send client message to player that he/she must go to forum and get the server password
}
}
}
}
i got error:
Код:
C:\Users\Geto244\Desktop\MyGm\gamemodes\MyGM.pwn(330) : error 033: array must be indexed (variable "-unknown-")
I dont understand how i must put it that it compare input text and server password
Re: How to compare input text? -
JhnzRep - 13.06.2012
pawn Код:
if(strcmp(inputtext, ServeriParool))
{
//blah blah
}
Re: How to compare input text? -
(ETR)Geto244 - 13.06.2012
Tnx, it worked