21.09.2014, 22:19
iReacher take a look at this thread and last post:
https://sampforum.blast.hk/showthread.php?tid=354068&page=2
https://sampforum.blast.hk/showthread.php?tid=354068&page=2
F:\COD\gamemodes\v5.8(mysql).pwn(1350) : warning 206: redundant test: constant expression is non-zero
F:\COD\gamemodes\v5.8(mysql).pwn(1350) : warning 215: expression has no effect
F:\COD\gamemodes\v5.8(mysql).pwn(1351) : error 035: argument type mismatch (argument 1)
F:\COD\gamemodes\v5.8(mysql).pwn(1352) : error 035: argument type mismatch (argument 1)
F:\COD\gamemodes\v5.8(mysql).pwn(1355) : error 035: argument type mismatch (argument 1)
F:\COD\gamemodes\v5.8(mysql).pwn(13930) : warning 213: tag mismatch
F:\COD\gamemodes\v5.8(mysql).pwn(13933) : warning 213: tag mismatch
F:\COD\gamemodes\v5.8(mysql).pwn(14062) : error 075: input line too long (after substitutions)
F:\COD\gamemodes\v5.8(mysql).pwn(14282) : error 035: argument type mismatch (argument 1)
F:\COD\gamemodes\v5.8(mysql).pwn(14284) : error 017: undefined symbol "mysql_store_result"
F:\COD\gamemodes\v5.8(mysql).pwn(14285) : error 017: undefined symbol "mysql_num_rows"
F:\COD\gamemodes\v5.8(mysql).pwn(14292) : error 035: argument type mismatch (argument 1)
F:\COD\gamemodes\v5.8(mysql).pwn(21238) : warning 213: tag mismatch
F:\COD\gamemodes\v5.8(mysql).pwn(21259) : warning 213: tag mismatch
F:\COD\gamemodes\v5.8(mysql).pwn(21260) : warning 213: tag mismatch
F:\COD\gamemodes\v5.8(mysql).pwn(32781) : error 035: argument type mismatch (argument 1)
F:\COD\gamemodes\v5.8(mysql).pwn(32782) : error 017: undefined symbol "mysql_store_result"
F:\COD\gamemodes\v5.8(mysql).pwn(32784) : error 017: undefined symbol "mysql_num_rows"
F:\COD\gamemodes\v5.8(mysql).pwn(32787) : error 017: undefined symbol "mysql_fetch_row_format"
F:\COD\gamemodes\v5.8(mysql).pwn(32789) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32790) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32791) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32792) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32793) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32794) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32795) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32796) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32797) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32798) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32799) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32800) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32801) : error 017: undefined symbol "mysql_fetch_field_row"
F:\COD\gamemodes\v5.8(mysql).pwn(32802) : error 017: undefined symbol "mysql_fetch_field_row"
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
26 Errors.
mysql_connect(CLANHOST,CLANUSER,CLANDB,CLANPASS);
mysql_debug(1);
mysql_query("CREATE TABLE IF NOT EXISTS clans(clanname VARCHAR(30), clantag VARCHAR(5), clanpass VARCHAR(10), clandes VARCHAR(100), clanmotd VARCHAR(50), weap1 INT(3), weap2 INT(3), weap3 INT(3))");
mysql_query("CREATE TABLE IF NOT EXISTS members(clanname VARCHAR(30), playername VARCHAR(30), playerclanrank INT(5), isinclan INT(2))");
strcat(tQuery, "CREATE TABLE IF NOT EXISTS Inventory(AccID INT(10) NOT NULL AUTO_INCREMENT,Username VARCHAR(24),Slot0 INT(10),Slot1 INT(10),Slot2 INT(10),Slot3 INT(10),Slot4 INT(10),Slot5 INT(10),Slot6 INT(10),Slot7 INT(10),Slot8 INT(10),Slot9 INT(10)");
strcat(tQuery, ",Slot10 INT(10),Slot11 INT(10),Slot12 INT(10),Slot13 INT(10),Slot14 INT(10),Slot15 INT(10),Slot16 INT(10),Slot17 INT(10),Slot18 INT(10),Slot19 INT(10), PRIMARY KEY (AccID,Username))");
mysql_query(tQuery);
public OnAccountCheck(playerid)
{
new rows, fields; //a variable that will be used to retrieve rows and fields in the database.
cache_get_data(rows, fields, mysql);//let's get the rows and fields from the database.
if(rows) //if there is row
{//then
cache_get_field_content(0, "PASS", PlayerInfo[playerid][Password], mysql, 129);
//we will load player's password into pInfo[playerid][Password] to be used in logging in
PlayerInfo[playerid][ID] = cache_get_field_content_int(0, "ID"); //now let's load player's ID into pInfo[playerid][ID] so we can use it later
printf("%s", PlayerInfo[playerid][Password]); //OPTIONAL: Just for debugging. If it didn't show your password, then there must be something wrong while getting player's password
ShowPlayerDialog(playerid, dlogin, DIALOG_STYLE_INPUT, "Login", "In order to play, you need to login", "Login", "Quit"); //And since we found a result from the database, which means, there is an account; we will show a login dialog
}
else //if we didn't find any rows from the database, that means, no accounts were found
{
ShowPlayerDialog(playerid, dregister, DIALOG_STYLE_INPUT, "Login", "Please Login Again For Security Purpose", "Login", "Quit");
//So we show them a dialog register
}
return 1;
}
new query[128]; //query[128] is for formatting our query and Float:pos[3] is for getting and saving player's position
mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `Level`=%d, `VIP`=%d, `Money`=%d, `Kills`=%d, `Deaths`=%d, `Banned`=%d, `Gift`=%d, `VIP`=%d, `ClanSkin`=%d, `Navy`=%d, `hkick`=%d, `Operator`=%d WHERE `ID`=%d",PlayerInfo[playerid][Level], PlayerInfo[playerid][dRank], GetPlayerMoney(playerid), PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Banned], PlayerInfo[playerid][Gift], PlayerInfo[playerid][dRank], PlayerInfo[playerid][ClanSkin], PlayerInfo[playerid][Navy], PlayerInfo[playerid][hkick], PlayerInfo[playerid][Helper], PlayerInfo[playerid][ID]);
//We update the table(`players`) by getting player's admin level, vip level, money, and positions and save them in the database
mysql_tquery(mysql, query, "", "");
//let's execute the query.
if(GetPVarInt(playerid,"INVLoaded") == 0)
{
new lQuery[128],query[350];
format(lQuery,sizeof(lQuery),"SELECT * FROM Inventory WHERE Username='%s' LIMIT 1",GetName(playerid));
mysql_query(lQuery);
mysql_store_result();
if(mysql_num_rows() != 0)
{
LoadInventory(playerid);
}
else
{
format(query,sizeof query,"INSERT INTO Inventory (Username,Slot0,Slot1,Slot2,Slot3,Slot4,Slot5,Slot6,Slot7,Slot8,Slot9,Slot10,Slot11,Slot12,Slot13,Slot14,Slot15,Slot16,Slot17,Slot18,Slot19) VALUES ('%s',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)",GetName(playerid));
mysql_query(query);
SendClientMessage(playerid,-1,"Inventory Created!!");
SetPVarInt(playerid,"INVLoaded",1);
}
}
stock LoadInventory(playerid)
{
new lQuery[500];
format(lQuery,sizeof(lQuery),"SELECT * FROM Inventory WHERE Username='%s'",GetName(playerid));
mysql_query(lQuery);
mysql_store_result();
if(mysql_num_rows() != 0)
{
new savingstring[259];
while(mysql_fetch_row_format(lQuery,"|"))
{
mysql_fetch_field_row(savingstring, "Slot0"); InvInfo[playerid][iSlot][0] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot1"); InvInfo[playerid][iSlot][1] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot2"); InvInfo[playerid][iSlot][2] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot3"); InvInfo[playerid][iSlot][3] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot4"); InvInfo[playerid][iSlot][4] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot5"); InvInfo[playerid][iSlot][5] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot6"); InvInfo[playerid][iSlot][6] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot7"); InvInfo[playerid][iSlot][7] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot8"); InvInfo[playerid][iSlot][8] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot9"); InvInfo[playerid][iSlot][9] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot10"); InvInfo[playerid][iSlot][10] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot11"); InvInfo[playerid][iSlot][11] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot12"); InvInfo[playerid][iSlot][12] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot13"); InvInfo[playerid][iSlot][13] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot14"); InvInfo[playerid][iSlot][14] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot15"); InvInfo[playerid][iSlot][15] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot16"); InvInfo[playerid][iSlot][16] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot17"); InvInfo[playerid][iSlot][17] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot18"); InvInfo[playerid][iSlot][18] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Slot19"); InvInfo[playerid][iSlot][19] = strval(savingstring);
}
mysql_free_result();
SetPVarInt(playerid,"INVLoaded",1); //you can use this for checking Inventory is loaded or not.
SendClientMessage(playerid,-1,"Inventory Successfully Loaded!");
}
return 1;
}
stock SaveInventory(playerid)
{
new Query[350];
strcat(Query,"UPDATE Inventory SET Slot0=%i,Slot1=%i,Slot2=%i,Slot3=%i,Slot4=%i,Slot5=%i,Slot6=%i,Slot7=%i,Slot8=%i,Slot9=%i,Slot10=%i,Slot11=%i,Slot12=%i,Slot13=%i,Slot14=%i,Slot15=%i");
strcat(Query,",Slot16=%i,Slot17=%i,Slot18=%i,Slot19=%i WHERE Username='%s'");
format(Query,sizeof(Query),Query,
InvInfo[playerid][iSlot][0],
InvInfo[playerid][iSlot][1],
InvInfo[playerid][iSlot][2],
InvInfo[playerid][iSlot][3],
InvInfo[playerid][iSlot][4],
InvInfo[playerid][iSlot][5],
InvInfo[playerid][iSlot][6],
InvInfo[playerid][iSlot][7],
InvInfo[playerid][iSlot][8],
InvInfo[playerid][iSlot][9],
InvInfo[playerid][iSlot][10],
InvInfo[playerid][iSlot][11],
InvInfo[playerid][iSlot][12],
InvInfo[playerid][iSlot][13],
InvInfo[playerid][iSlot][14],
InvInfo[playerid][iSlot][15],
InvInfo[playerid][iSlot][16],
InvInfo[playerid][iSlot][17],
InvInfo[playerid][iSlot][18],
InvInfo[playerid][iSlot][19],
GetName(playerid));
mysql_query(Query);
return 1;
}
forward OnPlayerUpdateSQL(playerid);
public OnPlayerUpdateSQL(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pReg] == 0)
{
return 1;
}
if(joueurconnecte[playerid] == 1)
{
new query[1024];
mysql_format(mysql, query, 1024, "UPDATE srp_players_stats SET Armure='%f', PlayerLevel=%d, AdminLevel=%d, Registered=%d, Sex=%d, Blanc=%d, Origin=%d, Money=%d, Bank=%d, SuspendedTime=%d, Job=%d, Jailed=%d, JailTime=%d, Member=%d, Rank=%d, Chara=%d, pHealth='%f', Inte=%d, Model=%d, PhoneNr=%d WHERE id=%d",
PlayerInfo[playerid][pArmure],
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pReg],
PlayerInfo[playerid][pSex],
PlayerInfo[playerid][pBlanc],
PlayerInfo[playerid][pOrigin],
PlayerInfo[playerid][pCash],
PlayerInfo[playerid][pAccount],
PlayerInfo[playerid][pSuspendedTime],
PlayerInfo[playerid][pJob],
PlayerInfo[playerid][pJailed],
PlayerInfo[playerid][pJailTime],
PlayerInfo[playerid][pMember],
PlayerInfo[playerid][pRank],
PlayerInfo[playerid][pChar],
PlayerInfo[playerid][pHealth],
PlayerInfo[playerid][pInt],
PlayerInfo[playerid][pModel],
PlayerInfo[playerid][pPnumber],
PlayerInfo[playerid][pSQLID]);
mysql_tquery(mysql, query);
// ...
}
}
return 1;
}
If those of you who want to open a server are really motivated to open it, you would do at least the small work to update the Gamemode to the newest MySQL plugin version (adapting some natives parameters is VERY EASILY doable using macros) !
|
Hi, I have a problem when starting the server.
I refered to the FAQ, but it did not solve my problem. I've installed Redistribuables (x86), and Framework 4.5.1 I'm on Window 7 Family Prenium Edition, 64 bits. This problem is really annoying, how to fix it once and for all? I've picture of my installation : http://image.noelshack.com/fichiers/...rror-mysql.png Please, help me. |