Hallo,
Ich habe versucht mein Script auf MySQL umzuschreiben, doch leider speichert es die Daten einfach nicht.
Unter phpmyadmin bekomme ich immer ein leeres Resultat zurück.
Ich benutze das R5 Plugin von G_Stylezzz und die a_mysql.inc
Unter OnPlayerDisConnect habe ich das:
SavePlayer(playerid);
Und hier die Funktion:
stock SavePlayer(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
mysql_SetInt("accounts", "Tode", Player[playerid][Deaths], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Kills", Player[playerid][Kills], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Points", Player[playerid][Pkt], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Wantedlevel", Player[playerid][Wantedlevel], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Admin", Player[playerid][Admin], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Drugs", Player[playerid][Drugs], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Spawn", Player[playerid][spawnc], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "WantedVariable", Player[playerid][WVar], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "HausVariable", Player[playerid][HVar], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Shotgunskill", Player[playerid][Shotgun], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "SawnOff", Player[playerid][SawnOff], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Spas12", Player[playerid][Spas12], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Premium", Player[playerid][VIP], "Name", oPlayerName[playerid]);
mysql_SetString("accounts", "Rank", string_rank, "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Geld", GetPlayerMoney(playerid), "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Level", GetPlayerScore(playerid), "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Bank", Player[playerid][Bank], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "GPS", Player[playerid][GPS], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Verwarnungen", Player[playerid][Warns], "Name", oPlayerName[playerid]);
mysql_SetInt("accounts", "Knastzeit", knastzeit[playerid], "Name", oPlayerName[playerid]);
}
}
return 1;
}
Hier noch die Tabelle in der Datenbank:
-- phpMyAdmin SQL Dump
-- version 2.11.8.1deb5+lenny9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 11. August 2011 um 15:24
-- Server Version: 5.0.51
-- PHP-Version: 5.2.6-1+lenny13
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Datenbank: `samp_2`
--
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `accounts`
--
CREATE TABLE IF NOT EXISTS `accounts` (
`Tode` int(11) NOT NULL default '1',
`Kills` int(11) NOT NULL default '1',
`Points` int(11) NOT NULL default '1',
`Wantedlevel` int(11) NOT NULL default '1',
`Admin` int(11) NOT NULL default '1',
`Drugs` int(11) NOT NULL default '1',
`Spawn` int(11) NOT NULL default '1',
`WantedVariable` int(11) NOT NULL default '1',
`HausVariable` int(11) NOT NULL default '1',
`Shotgunskill` int(11) NOT NULL default '1',
`SawnOff` int(11) NOT NULL default '1',
`Spas12` int(11) NOT NULL default '1',
`Premium` int(11) NOT NULL default '1',
`Rank` int(11) NOT NULL default '1',
`Geld` int(11) NOT NULL default '1',
`Level` int(11) NOT NULL default '1',
`Bank` int(11) NOT NULL default '1',
`GPS` int(11) NOT NULL default '1',
`Verwarnungen` int(11) NOT NULL default '1',
`Knastzeit` int(11) NOT NULL default '1'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Daten für Tabelle `accounts`
--
Alles anzeigen
Anbei noch die mysql-log.
lg