SA-MP Forums Archive
MySql help need! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySql help need! (/showthread.php?tid=221583)



MySql help need! - brightas - 05.02.2011

Hello my friends..! I have problem with mysql. I need to remake this script to dini, from mysql:

Код:
mysql_fetch_field("Troskulys",sql); SetPVarFloat(playerid, "Troskulys", floatstr(sql));
And i don't know how..
Can u help me ?!


Re: MySql help need! - CJ101 - 05.02.2011

Did you run a query and store the result?


Re: MySql help need! - brightas - 05.02.2011

Yes.


Re: MySql help need! - brightas - 06.02.2011

Quote:
Originally Posted by cj101
Посмотреть сообщение
Did you run a query and store the result?
This is for loading.

Код:
stock Load(playerid)
{
	format(query,1024,"SELECT * FROM "SQL_TABLE" WHERE vardas = '%s'", PlayerName(playerid));
	mysql_query(query);
	mysql_store_result();
	mysql_fetch_row(sqlline);

	new Float:Pos[3];
	
	mysql_fetch_field("Strimeles",sql); SetPVarFloat(playerid, "Strimeles", floatstr(sql));
	mysql_fetch_field("Menkes",sql); SetPVarFloat(playerid, "Menkes", floatstr(sql));
	mysql_fetch_field("Pleksnes",sql); SetPVarFloat(playerid, "Pleksnes", floatstr(sql));
	mysql_fetch_field("Uotai",sql); SetPVarFloat(playerid, "Uotai", floatstr(sql));
	mysql_fetch_field("Lasisos",sql); SetPVarFloat(playerid, "Lasisos", floatstr(sql));
	mysql_fetch_field("Ziobriai",sql); SetPVarFloat(playerid, "Ziobriai", floatstr(sql));
    mysql_fetch_field("Pinigai",sql); SetPlayerCash(playerid,strval(sql));
    mysql_fetch_field("Apranga",sql); SetPlayerSkin(playerid,strval(sql));
    mysql_fetch_field("Drabuziai1",sql); pInfo[playerid][Skin1] = strval(sql);
    mysql_fetch_field("Drabuziai2",sql); pInfo[playerid][Skin2] = strval(sql);
    mysql_fetch_field("Drabuziai3",sql); pInfo[playerid][Skin3] = strval(sql);
    mysql_fetch_field("Drabuziai4",sql); pInfo[playerid][Skin4] = strval(sql);
    mysql_fetch_field("Drabuziai5",sql); pInfo[playerid][Skin5] = strval(sql);
    mysql_fetch_field("Zaidejo_Lygis",sql); SetPlayerScore(playerid,strval(sql));
    mysql_fetch_field("Ieskomumo_Lygis",sql); SetPlayerWantedLevel(playerid,strval(sql));
    mysql_fetch_field("Sarvai",sql); SetPlayerArmour(playerid,floatstr(sql));
    mysql_fetch_field("Kovos_Stilius",sql); SetPlayerFightingStyle(playerid,strval(sql));
	mysql_fetch_field("Admin",sql); pInfo[playerid][Admin] = strval(sql);
	mysql_fetch_field("TeisesA",sql); pInfo[playerid][TeisesA] = strval(sql);
	mysql_fetch_field("TeisesB",sql); pInfo[playerid][TeisesB] = strval(sql);
    mysql_fetch_field("TeisesC",sql); pInfo[playerid][TeisesC] = strval(sql);
    mysql_fetch_field("TeisesD",sql); pInfo[playerid][TeisesD] = strval(sql);
    mysql_fetch_field("TeisesE",sql); pInfo[playerid][TeisesE] = strval(sql);
    mysql_fetch_field("Darbas",sql); pInfo[playerid][Darbas] = strval(sql);
    mysql_fetch_field("Bankas",sql); pInfo[playerid][Bankas] = strval(sql);
    mysql_fetch_field("Policininkas",sql); pInfo[playerid][Policininkas] = strval(sql);
    mysql_fetch_field("Lytis",sql); SetPVarInt(playerid, "Lytis", strval(sql));
    mysql_fetch_field("Cigaretes",sql); SetPVarInt(playerid, "Cigaretes", strval(sql));
    mysql_fetch_field("Myzalai",sql); SetPVarFloat(playerid, "Myzalai", floatstr(sql));
    mysql_fetch_field("Alkis",sql); SetPVarFloat(playerid, "Alkis", floatstr(sql));
    mysql_fetch_field("Troskulys",sql); SetPVarFloat(playerid, "Troskulys", floatstr(sql));
    mysql_fetch_field("Nuovargis",sql); SetPVarFloat(playerid, "Nuovargis", floatstr(sql));
    mysql_fetch_field("XP",sql); pInfo[playerid][XP] = strval(sql);
    mysql_fetch_field("Numeris",sql); pInfo[playerid][Numeris] = strval(sql);
    mysql_fetch_field("DPinigai",sql); pInfo[playerid][DPinigai] = strval(sql);
    mysql_fetch_field("VIP",sql);if(strval(sql) == 1){pInfo[playerid][VIP] = true;}else{pInfo[playerid][VIP] = false;}
    mysql_fetch_field("Banko_Saskaita",sql);if(strval(sql) == 1){pInfo[playerid][BSaskaita] = true;}else{pInfo[playerid][BSaskaita] = false;}
    mysql_fetch_field("Ginklo_Licenzija",sql);if(strval(sql) == 1){pInfo[playerid][GLicenzija] = true;}else{pInfo[playerid][GLicenzija] = false;}
I need tu remake to dini only this!