Add mysql save to plugin, Compile errors
[IMG]http://img46.**************/img46/6941/zmiana.png[/IMG]
Line 2987: Code:
format(szTemp,charsmax(szTemp),"UPDATE `cod_stats` SET `doswiadczenie` = '%i', `poziom` = '%i', `inteligencja` = '%i', `zdrowie` = '%i', `wytrzymalosc` = '%i', `kondycja` = '%i', `wytrzymaloscitemu` = '%i' WHERE `cod_stats`.`nazwa` = '%s', `klasa` = '%s';", doswiadczenie_gracza[id], poziom_gracza[id], inteligencja_gracza[id], zdrowie_gracza[id], wytrzymalosc_gracza[id], kondycja_gracza[id], wytrzymaloscitemu_gracza[id]), nazwa_gracza[id], klasa_gracza[id]); |
Re: Add mysql save to plugin, Compile errors
try this:
Code:
format(szTemp,charsmax(szTemp),"UPDATE `cod_stats` SET `doswiadczenie` = '%i', `poziom` = '%i', `inteligencja` = '%i', `zdrowie` = '%i', `wytrzymalosc` = '%i', `kondycja` = '%i', `wytrzymaloscitemu` = '%i' WHERE `cod_stats`.`nazwa` = '%s', `klasa` = '%s';", doswiadczenie_gracza[id], poziom_gracza[id], inteligencja_gracza[id], zdrowie_gracza[id], wytrzymalosc_gracza[id], kondycja_gracza[id], wytrzymaloscitemu_gracza[id], nazwa_gracza[id], klasa_gracza[id]); |
Re: Add mysql save to plugin, Compile errors
Works.
But is not saving. Can u check Table is created Code:
public MySql_Init()Code:
public ZapiszDane(id)Code:
public WczytajDane(id, klasa) |
Re: Add mysql save to plugin, Compile errors
What a mess...
Create table: PHP Code:
PHP Code:
PHP Code:
|
Re: Add mysql save to plugin, Compile errors
It should be
Code:
REPLACE INTO cod_stats Code:
UPDATE cod_stats Because all is saving for one map. Or maybe it should be Code:
format(szTemp,charsmax(szTemp),"REPLACE INTO cod_stats (doswiadczenie, poziom, inteligencja, zdrowie, wytrzymalosc, kondycja, wytrzymaloscitemu) VALUES ('%s','%s','%d','%d','%d','%d','%d','%d','%d') WHERE (nazwa='%s', klasa='%s');",doswiadczenie_gracza[id], poziom_gracza[id], inteligencja_gracza[id], zdrowie_gracza[id], wytrzymalosc_gracza[id], kondycja_gracza[id], wytrzymaloscitemu_gracza[id], nazwa_gracza[id], klasa_gracza[id],)If u need something ask on steam, pimp517pl. |
Re: Add mysql save to plugin, Compile errors
If it saves your stats and you can see them in mysql database, but then it resets them when you connect again, then it means that there is a problem with loading, not saving. It's not hard to fix such problem.
I'm not sure if it's the cause but try to change: PHP Code:
PHP Code:
|
Re: Add mysql save to plugin, Compile errors
And why is saving row "klasa" with somthign like that .
|
Re: Add mysql save to plugin, Compile errors
How should I know? You can't tell what is causing that problem with only those fragments of code.
|
Re: Add mysql save to plugin, Compile errors
1 Attachment(s)
Can u check please. In row 'klasa' is repleacing every map this with after with after ....
|
Re: Add mysql save to plugin, Compile errors
1 Attachment(s)
I think I fixed it (not tested). You need to drop cod_stats table and let the plugin create it again.
|
| All times are GMT -4. The time now is 01:57. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.