05.04.2012, 21:16
Hello,
I followed this tutorial:
https://sampforum.blast.hk/showthread.php?tid=327345
but I get these errors
I followed this tutorial:
https://sampforum.blast.hk/showthread.php?tid=327345
but I get these errors
Код:
(49) : error 017: undefined symbol "mysql_init" (286) : error 035: argument type mismatch (argument 3) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
Код:
public OnGameModeInit() { mysql_init(); // line 49 mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB); SetGameModeText("Blank Script"); AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); return 1; }
Код:
stock LoginPlayer(playerid, pass[]) { new query[1000]; format(query, sizeof(query),"SELECT * FROM serverdb WHERE username = '%s' AND password = md5('%s')",serverdb[playerid][username],pass); mysql_query(query); mysql_store_result(); if(mysql_num_rows() != 0) { if(mysql_fetch_row(query, "|")) // line 286 { sscanf(query,"e<p<|>s[24]s[32]iii>", serverdb[playerid]); new str[80]; format(str, sizeof(str),"Welcome %s, you have been logged to your account",serverdb[playerid][username]); SendClientMessage(playerid, COLOR_BLUE, str); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); SetPlayerScore(playerid, serverdb[playerid][score]); GivePlayerMoney(playerid, serverdb[playerid][money]); SpawnPlayer(playerid); serverdb[playerid][logged] = 1; // set player logged variable true } } else { ShowPlayerDialog(playerid,LOGIN_DIALOG,DIALOG_STYLE_PASSWORD,"Login to Account.","Wrong password:","Login","Cancel"); } }