Hi,
I'm new on amxx scripting so please don't laugh ;)
Here is a code:
Code:
new qcolAuth = SQL_FieldNameToNum(Query, "user")
new qcolPass = SQL_FieldNameToNum(Query, "password")
new qcolAccess = SQL_FieldNameToNum(Query, "access")
new qcolPoints = SQL_FieldNameToNum(Query, "points")
new AuthData[44]
new Password[44]
new Access[32]
new Float:Points
SQL_ReadResult(Query, qcolAuth, AuthData, sizeof(AuthData)-1)
SQL_ReadResult(Query, qcolPass, Password, sizeof(Password)-1)
SQL_ReadResult(Query, qcolAccess, Access, sizeof(Access)-1)
SQL_ReadResult(Query, qcolPoints, Points,0)
get_user_info(id, "_pw", pass, 31)
// netinka pass
if (!equal(Password,pass)) {
server_cmd("kick #%d Wrong pass", get_user_userid(id))
}
// Registruotas
else {
PlayerXP[id] = Points
PlayerCon[id] = true
log_amx("SELECT * FROM %s WHERE `user`='%s'",SQL_TABLE,name)
log_amx("%s points: %i",AuthData,Points)
}
Everything looks working, but
Points all the time I get
0. In DB i write for example: 15, but after this I still get 0. No errors, no warnings don't get.
Sorry for bad english...