inputtext or something...
#1

Hi sa-mp forum!

I have problem with inputtext or something!

I don't know how to explain this...

pawn Код:
AccountData[playerid][szEmail] == inputtext;
Код:
C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\freeroam.pwn(237) : error 033: array must be indexed (variable "inputtext")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
And then i want
pawn Код:
format(szQuery, sizeof(szQuery), "INSERT INTO `accounts` (email) VALUES ('%s')", AccountData[playerid][szEmail]);
mysql_function_query(MainPipeline, szQuery, true, "OnQueryFinish", "ii", THREAD_NO_RESULT, playerid);
How to get this work?
Reply
#2

AccountData[playerid][szEmail][STRING-SIZE-FOR-THIS] = inputtext[SAME-STRING-SIZE];
Reply
#3

You can use
variable = something;
for integers and floats, for strings you have to use format:

format(AccountData[playerid][szEmail],sizeof(AccountData[playerid][szEmail]),"%s",inputtext);
Reply
#4

Quote:
Originally Posted by zaibaslr2
Посмотреть сообщение
You can use
variable = something;
for integers and floats, for strings you have to use format:

format(AccountData[playerid][szEmail],sizeof(AccountData[playerid][szEmail]),"%s",inputtext);
I get errors:
Код:
C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\efs.pwn(237) : error 001: expected token: "]", but found "-identifier-"
C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\efs.pwn(237) : warning 215: expression has no effect
C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\efs.pwn(237) : error 001: expected token: ";", but found "]"
C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\efs.pwn(237) : error 029: invalid expression, assumed zero
C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\efs.pwn(237) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
I don't understand how i can save email in to database...

I can do like this if i want and it works:
pawn Код:
format(szQuery, sizeof(szQuery), "INSERT INTO `accounts` (email) VALUES ('%s')", inputtext);
mysql_function_query(MainPipeline, szQuery, true, "OnQueryFinish", "ii", THREAD_NO_RESULT, playerid);
But i don't want that.
Reply
#5

Quote:
Originally Posted by finelaq
Посмотреть сообщение
I get errors:
Код:
C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\efs.pwn(237) : error 001: expected token: "]", but found "-identifier-"
C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\efs.pwn(237) : warning 215: expression has no effect
C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\efs.pwn(237) : error 001: expected token: ";", but found "]"
C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\efs.pwn(237) : error 029: invalid expression, assumed zero
C:\Users\Monster\Desktop\samp03z_svr_R1_win32\gamemodes\efs.pwn(237) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
I don't understand how i can save email in to database...

I can do like this if i want and it works:
pawn Код:
format(szQuery, sizeof(szQuery), "INSERT INTO `accounts` (email) VALUES ('%s')", inputtext);
mysql_function_query(MainPipeline, szQuery, true, "OnQueryFinish", "ii", THREAD_NO_RESULT, playerid);
But i don't want that.
Please try

Код:
format(AccountData[playerid][szEmail],100,"%s",inputtext);
Reply
#6

AccountData[playerid][szEmail] == inputtext;

== is for check.
= is to set.

pawn Код:
format ( AccountData[playerid][szEmail], sizeof ( AccountData[playerid][szEmail] ), "%s", inputtext);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)