16.08.2010, 03:40
Quick Inquiry,
It seems that in your example script
you have the public function OnQueryFinish
It also seems that when I try to compile your example script (all bugs removed)
I cannot fix the following:
Error lines marked:
I could fix it, but I don't know how safe that would be,
any info on this?
It seems that in your example script
you have the public function OnQueryFinish
It also seems that when I try to compile your example script (all bugs removed)
I cannot fix the following:
pawn Код:
(61) : error 017: undefined symbol "playerid"
(62) : error 017: undefined symbol "playerid"
pawn Код:
#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]);
}
any info on this?