16.08.2010, 00:07
Ye but what change in SA:MP??
(61) : error 017: undefined symbol "playerid"
(62) : error 017: undefined symbol "playerid"
#include <a_samp>
#include <a_mysql>
#include <zcmd>
#include <sscanf2>
#include <C-MySQL>
new MyMoney[MAX_PLAYERS], MyKills[MAX_PLAYERS];
stock GetUserName(playerid) {
new name[24];
GetPlayerName(playerid, name, 24); return name;
}
CMD:register(playerid, params[]) {
if(CMySQL_Exists(GetUserName(playerid)))
return SendClientMessage(playerid, 0xFFFFFFA, "<> Your account exists already!");
new password[32];
if(sscanf(params, "s[32]", password))
return SendClientMessage(playerid, 0xFFFFFFA, "<> /register <password>");
if(strlen(password) > 32)
return SendClientMessage(playerid, 0xFFFFFFA, "<> Your password must be 32 characters or less.");
CMySQL_Create(GetUserName(playerid), password);
}
CMD:login(playerid, params[]) {
if(!CMySQL_Exists(GetUserName(playerid)))
return SendClientMessage(playerid, 0xFFFFFFA, "<> Your account doesn't exist!");
new password[32];
if(sscanf(params, "s[32]", password))
return SendClientMessage(playerid, 0xFFFFFFA, "<> /login <password>");
if(strlen(password) > 32)
return SendClientMessage(playerid, 0xFFFFFFA, "<> Your password must be 32 characters or less.");
new Passwordz[32];
CMySQL_Get(GetUserName(playerid), "Password", Passwordz, true);
if(!strcmp(Passwordz, password, true)) {
SendClientMessage(playerid, 0xFFFFFFA, "<> You're now logged.");
CMySQL_Load(GetUserName(playerid), 1, playerid);
}
}
stock GetMyAdminLevel(Username[]) {
return CMySQL_Int(Username, "AdminLevel");
}
public OnPlayerDisconnect(playerid, reason) {
new string[128];
format(string, 128, "Money = %i, MyKills = %i", GetPlayerMoney(playerid), GetPlayerScore(playerid));
CMySQL_CustomDataSet(GetUserName(playerid), string);
}
public OnQueryFinish( query[], resultid, extraid, connectionHandle ) {
mysql_store_result();
new Data[128];
mysql_fetch_row_format(Data, "|");
--> sscanf(Data, "p<|>ii", MyMoney[playerid], MyKills[playerid]);
--> GivePlayerMoney(playerid, MyMoney[playerid]);
}
public OnQueryFinish( query[], resultid, extraid, connectionHandle ) {
mysql_store_result();
new Data[128];
mysql_fetch_row_format(Data, "|");
sscanf(Data, "p<|>ii", MyMoney[extraid], MyKills[extraid]);
GivePlayerMoney(playerid, MyMoney[extraid]);
}
format(SQLEscapeX[5], 128, "SELECT %s FROM %s WHERE %s = '%s'", SQLEscapeX[3], SQLEscapeX[0], SQLEscapeX[1], SQLEscapeX[2]);
format(SQLEscapeX[5], 128, "SELECT %s FROM %s WHERE %s = '%s'", SQLEscapeX[1], SQLEscapeX[0], SQLEscapeX[1], SQLEscapeX[2]);
I think CMySQL_Float is bugged. It can't read find the field.
Shouldn't there be pawn Код:
pawn Код:
|
Hi guys, anyone still have download link? Because i dont see any.
|