Big SQL problem
#1

hy i have some problems implementing mysql in my gamemode

i dono what i did wrong
here is an image

http://i86.servimg.com/u/f86/12/06/95/36/untitl10.jpg

can anyone help me with it?
Reply
#2

post your sql query line
Reply
#3

do you mean this?

[02:14:51] Error in mysql_query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Char=0,ContractTime=0,DetSkill=0,SexSkill=0,BoxSk ill=0,LawSkill=0,MechSkill=0,Ja' at line 1
[02:14:51] Error in mysql_query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Int=0,Local=255,Team=3,Model=7,PhoneNr=8343,House =255,Bizz=255,Pos_x='2246.60009' at line 1
[02:14:51] Error in mysql_query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s
=5,Locked=0,FishTool=0,Mask=0,SafeBox=0,CargoGet=0 WHERE id=1' at line 1

this is the error

this is my database

Код:
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `bans`
--

DROP TABLE IF EXISTS `bans`;
SET @saved_cs_client   = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `bans` (
 `id` int(11) NOT NULL auto_increment,
 `type` tinyint(2) NOT NULL,
 `player` int(11) NOT NULL,
 `time` int(11) NOT NULL,
 `amount` bigint(20) NOT NULL default '0',
 `ip` varchar(16) NOT NULL,
 `inactive` tinyint(1) NOT NULL default '0',
 PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `logins`
--

DROP TABLE IF EXISTS `logins`;
SET @saved_cs_client   = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `logins` (
 `id` int(11) NOT NULL auto_increment,
 `time` int(11) NOT NULL,
 `ip` varchar(16) NOT NULL,
 `userid` int(11) NOT NULL default '0',
 PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client;

--
-- Table structure for table `players`
--

DROP TABLE IF EXISTS `players`;
SET @saved_cs_client   = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `players` (
 `id` int(11) NOT NULL auto_increment,
 `Name` varchar(50) collate latin1_general_ci NOT NULL,
 `Password` varchar(50) character set latin1 collate latin1_bin NOT NULL,
 `Level` int(11) NOT NULL default '1',
 `AdminLevel` int(11) NOT NULL default '0',
 `DonateRank` int(11) NOT NULL default '0',
 `UpgradePoints` int(11) NOT NULL default '0',
 `ConnectedTime` int(11) NOT NULL default '0',
 `Registered` int(11) NOT NULL default '0',
 `Sex` int(11) NOT NULL default '0',
 `Age` int(11) NOT NULL default '18',
 `Origin` int(11) NOT NULL default '0',
 `CK` int(11) NOT NULL default '0',
 `Muted` int(11) NOT NULL default '0',
 `Respect` int(11) NOT NULL default '0',
 `Money` bigint(20) NOT NULL default '0',
 `Bank` int(11) NOT NULL default '0',
 `Crimes` int(11) NOT NULL default '0',
 `Kills` int(11) NOT NULL default '0',
 `Deaths` int(11) NOT NULL default '0',
 `Arrested` int(11) NOT NULL default '0',
 `WantedDeaths` int(11) NOT NULL default '0',
 `Phonebook` int(11) NOT NULL default '0',
 `LottoNr` int(11) NOT NULL default '0',
 `Fishes` int(11) NOT NULL default '0',
 `BiggestFish` int(11) NOT NULL default '0',
 `Job` int(11) NOT NULL default '0',
 `Paycheck` int(11) NOT NULL default '0',
 `HeadValue` int(11) NOT NULL default '0',
 `Jailed` int(11) NOT NULL default '0',
 `JailTime` int(11) NOT NULL default '0',
 `UsedDrugs` int(11) NOT NULL default '0',
 `DrugTime` int(11) NOT NULL default '0',
 `Materials` int(11) NOT NULL default '0',
 `Rope` int(11) NOT NULL default '0',
 `VirtualWorld` int(11) NOT NULL default '0',
 `Drugs` int(11) NOT NULL default '0',
 `SafeMats` int(11) NOT NULL default '0',
 `SafeDrugs` int(11) NOT NULL default '0',
 `Leader` int(11) NOT NULL default '0',
 `Member` int(11) NOT NULL default '0',
 `FMember` int(11) NOT NULL default '255',
 `Rank` int(11) NOT NULL default '0',
 `Char` int(11) NOT NULL default '0',
 `ContractTime` int(11) NOT NULL default '0',
 `DetSkill` int(11) NOT NULL default '0',
 `SexSkill` int(11) NOT NULL default '0',
 `BoxSkill` int(11) NOT NULL default '0',
 `LawSkill` int(11) NOT NULL default '0',
 `MechSkill` int(11) NOT NULL default '0',
 `JackSkill` int(11) NOT NULL default '0',
 `CarSkill` int(11) NOT NULL default '0',
 `NewsSkill` int(11) NOT NULL default '0',
 `DrugsSkill` int(11) NOT NULL default '0',
 `CookSkill` int(11) NOT NULL default '0',
 `FishSkill` int(11) NOT NULL default '0',
 `BusSkill` int(11) NOT NULL default '0',
 `TaxiSkill` int(11) NOT NULL default '0',
 `pSHealth` varchar(16) collate latin1_general_ci NOT NULL default '50.0',
 `pHealth` varchar(16) collate latin1_general_ci NOT NULL default '50.0',
 `Int` int(11) NOT NULL default '0',
 `Local` int(11) NOT NULL default '255',
 `Team` int(11) NOT NULL default '3',
 `Model` int(11) NOT NULL default '0',
 `PhoneNr` int(11) NOT NULL default '0',
 `House` int(11) NOT NULL default '255',
 `Bizz` int(11) NOT NULL default '255',
 `Pos_x` varchar(16) collate latin1_general_ci NOT NULL default '0',
 `Pos_y` varchar(16) collate latin1_general_ci NOT NULL default '0',
 `Pos_z` varchar(16) collate latin1_general_ci NOT NULL default '0',
 `CarLic` int(11) NOT NULL default '0',
 `FlyLic` int(11) NOT NULL default '0',
 `BoatLic` int(11) NOT NULL default '0',
 `FishLic` int(11) NOT NULL default '0',
 `GunLic` int(11) NOT NULL default '0',
 `Gun1` int(11) NOT NULL default '0',
 `Gun2` int(11) NOT NULL default '0',
 `Gun3` int(11) NOT NULL default '0',
 `Gun4` int(11) NOT NULL default '0',
 `Ammo1` int(11) NOT NULL default '0',
 `Ammo2` int(11) NOT NULL default '0',
 `Ammo3` int(11) NOT NULL default '0',
 `Ammo4` int(11) NOT NULL default '0',
 `CarTime` int(11) NOT NULL default '0',
 `PayDay` int(11) NOT NULL default '0',
 `PayDayHad` int(11) NOT NULL default '0',
 `CDPlayer` int(11) NOT NULL default '0',
 `Wins` int(11) NOT NULL default '0',
 `Loses` int(11) NOT NULL default '0',
 `AlcoholPerk` int(11) NOT NULL default '0',
 `DrugPerk` int(11) NOT NULL default '0',
 `MiserPerk` int(11) NOT NULL default '0',
 `PainPerk` int(11) NOT NULL default '0',
 `TraderPerk` int(11) NOT NULL default '0',
 `Tutorial` int(11) NOT NULL default '0',
 `Mission` int(11) NOT NULL default '0',
 `Warnings` int(11) NOT NULL default '0',
 `Adjustable` int(11) NOT NULL default '0',
 `Fuel` int(11) NOT NULL default '0',
 `Married` int(11) NOT NULL default '0',
 `MarriedTo` varchar(50) collate latin1_general_ci NOT NULL default 'No-one',
 `Locked` int(11) NOT NULL default '0',
 `FishTool` int(11) NOT NULL default '0',
 `Mask` int(11) NOT NULL default '0',
 `SafeBox` int(11) NOT NULL default '0',
 `CargoGet` int(11) NOT NULL default '0',
 PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
SET character_set_client = @saved_cs_client;

/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
Reply
#4

no i mean the code that could possibly be:
Код:
samp_mysql_query("SELECT * FROM `users`");

or

new query[1024];
query = "SELECT * FROM `users`";
samp_mysql_query(query);
Reply
#5

pawn Код:
forward MySQLConnect(sqlhost[], sqluser[], sqlpass[], sqldb[]);
forward MySQLDisconnect();
forward MySQLCheckConnection();
forward MySQLUpdateBuild(query[], sqlplayerid);
forward MySQLUpdateFinish(query[], sqlplayerid);
forward MySQLUpdatePlayerInt(query[], sqlplayerid, sqlvalname[], sqlupdateint);
forward MySQLUpdatePlayerIntSingle(sqlplayerid, sqlvalname[], sqlupdateint);
forward MySQLUpdatePlayerFlo(query[], sqlplayerid, sqlvalname[], Float:sqlupdateflo);
forward MySQLUpdatePlayerStr(query[], sqlplayerid, sqlvalname[], sqlupdatestr[]);
forward MySQLCheckAccount(sqlplayersname[]);
forward MySQLCheckAccountLocked(sqlplayerid);
forward MySQLCheckIPBanned(ip[]);
forward MySQLFetchAcctSingle(sqlplayerid, sqlvalname[], sqlresult[]);
forward MySQLFetchAcctRecord(sqlplayerid, sqlresult[]);
forward MySQLCreateAccount(newplayersname[], newpassword[]);
forward MySQLAddLoginRecord(sqlplayerid, ipaddr[]);
pawn Код:
public MySQLConnect(sqlhost[], sqluser[], sqlpass[], sqldb[])
{
    print("MYSQL: Attempting to connect to server...");
    samp_mysql_connect(sqlhost, sqluser, sqlpass);
    samp_mysql_select_db(sqldb);
    if(samp_mysql_ping()==0)
    {
        print("MYSQL: Database connection established.");
        return 1;
    }
    else
    {
        print("MYSQL: Connection error, retrying...");
        samp_mysql_connect(sqlhost, sqluser, sqlpass);
        samp_mysql_select_db(sqldb);
        if(samp_mysql_ping()==0)
        {
            print("MYSQL: Reconnection successful. We can continue as normal.");
            return 1;
        }
        else
        {
            print("MYSQL: Could not reconnect to server, terminating server...");
            SendRconCommand("exit");
            return 0;
        }
    }
}

public MySQLDisconnect()
{
    samp_mysql_close();
    return 1;
}

public MySQLCheckConnection()
{
    if(samp_mysql_ping()==0)
    {
        return 1;
    }
    else
    {
        print("MYSQL: Connection seems dead, retrying...");
        MySQLDisconnect();
        MySQLConnect(MYSQL_HOST,MYSQL_USER,MYSQL_PASS,MYSQL_DB);
        if(samp_mysql_ping()==0)
        {
            print("MYSQL: Reconnection successful. We can continue as normal.");
            return 1;
        }
        else
        {
            print("MYSQL: Could not reconnect to server, terminating server...");
            SendRconCommand("exit");
            return 0;
        }
    }
}

public MySQLUpdateBuild(query[], sqlplayerid)
{
    new querylen = strlen(query);
    new querymax = MAX_STRING;
    if (querylen < 1) format(query, querymax, "UPDATE players SET ");
    else if (querymax-querylen < 50)
    {
        new whereclause[32];
        format(whereclause, sizeof(whereclause), " WHERE id=%d", sqlplayerid);
        strcat(query, whereclause, querymax);
        samp_mysql_query(query);
        format(query, querymax, "UPDATE players SET ");
    }
    else if (strfind(query, "=", true) != -1) strcat(query, ",", MAX_STRING);
    return 1;
}

public MySQLUpdateFinish(query[], sqlplayerid)
{
    if (strcmp(query, "WHERE id=", false) == 0) samp_mysql_query(query);
    else
    {
        new whereclause[32];
        format(whereclause, sizeof(whereclause), " WHERE id=%d", sqlplayerid);
        strcat(query, whereclause, MAX_STRING);
        samp_mysql_query(query);
        format(query, MAX_STRING, "UPDATE players SET ");
    }
    return 1;
}

public MySQLUpdatePlayerInt(query[], sqlplayerid, sqlvalname[], sqlupdateint)
{
    MySQLUpdateBuild(query, sqlplayerid);
    new updval[64];
    format(updval, sizeof(updval), "%s=%d", sqlvalname, sqlupdateint);
    strcat(query, updval, MAX_STRING);
    return 1;
}

public MySQLUpdatePlayerFlo(query[], sqlplayerid, sqlvalname[], Float:sqlupdateflo)
{
    new flotostr[32];
    format(flotostr, sizeof(flotostr), "%f", sqlupdateflo);
    MySQLUpdatePlayerStr(query, sqlplayerid, sqlvalname, flotostr);
    return 1;
}

public MySQLUpdatePlayerStr(query[], sqlplayerid, sqlvalname[], sqlupdatestr[])
{
    MySQLUpdateBuild(query, sqlplayerid);
    new escstr[128];
    new updval[128];
    samp_mysql_real_escape_string(sqlupdatestr, escstr);
    format(updval, sizeof(updval), "%s='%s'", sqlvalname, escstr);
    strcat(query, updval, MAX_STRING);
    return 1;
}

public MySQLUpdatePlayerIntSingle(sqlplayerid, sqlvalname[], sqlupdateint)
{
    new query[128];
    format(query, sizeof(query), "UPDATE players SET %s=%d WHERE id=%d", sqlvalname, sqlupdateint, sqlplayerid);
    samp_mysql_query(query);
    return 1;
}

public MySQLCheckAccount(sqlplayersname[])
{
    new query[128];
    new escstr[MAX_PLAYER_NAME];
    samp_mysql_real_escape_string(sqlplayersname, escstr);
    format(query, sizeof(query), "SELECT id FROM players WHERE LOWER(Name) = LOWER('%s') LIMIT 1", escstr);
    samp_mysql_query(query);
    samp_mysql_store_result();
    if (samp_mysql_num_rows()==0)
    {
        return 0;
    }
    else
    {
        new strid[32];
        new intid;
        samp_mysql_fetch_row(strid);
        intid = strval(strid);
        return intid;
    }
}

public MySQLCheckAccountLocked(sqlplayerid)
{
    new query[64];
    new lockedboolstr[4];
    format(query, sizeof(query), "SELECT Locked FROM players WHERE id = %d LIMIT 1", sqlplayerid);
    samp_mysql_query(query);
    samp_mysql_store_result();
    samp_mysql_fetch_row(lockedboolstr);
    if (strval(lockedboolstr) != 0)
    {
        return 1;
    }
    return 0;
}

public MySQLCheckIPBanned(ip[])
{
    new query[64];
    format(query, sizeof(query), "SELECT type FROM bans WHERE ip = '%s' AND inactive = 0 ORDER BY id DESC LIMIT 1", ip);
    samp_mysql_query(query);
    samp_mysql_store_result();
    if (samp_mysql_num_rows() != 0)
    {
        new bantypestr[4];
        new bantypeint;
        samp_mysql_fetch_row(bantypestr);
        bantypeint = strval(bantypestr);
        samp_mysql_free_result();
        return bantypeint;
    }
    return 0;
}

public MySQLFetchAcctSingle(sqlplayerid, sqlvalname[], sqlresult[])
{
    new query[128];
    format(query, sizeof(query), "SELECT %s FROM players WHERE id = %d LIMIT 1", sqlvalname, sqlplayerid);
    samp_mysql_query(query);
    samp_mysql_store_result();
    if(samp_mysql_fetch_row(sqlresult)==1)
    {
        return 1;
    }
    return 0;
}

public MySQLFetchAcctRecord(sqlplayerid, sqlresult[])
{
    new query[64];
    format(query, sizeof(query), "SELECT * FROM players WHERE id = %d LIMIT 1", sqlplayerid);
    samp_mysql_query(query);
    samp_mysql_store_result();
    if(samp_mysql_fetch_row(sqlresult)==1)
    {
        return 1;
    }
    return 0;
}

public MySQLCreateAccount(newplayersname[], newpassword[])
{
    new query[128];
    new sqlplyname[64];
    new sqlpassword[64];
    samp_mysql_real_escape_string(newplayersname, sqlplyname);
    samp_mysql_real_escape_string(newpassword, sqlpassword);
    format(query, sizeof(query), "INSERT INTO players (Name, Password) VALUES ('%s', '%s')", sqlplyname, sqlpassword);
    samp_mysql_query(query);
    new newplayersid = MySQLCheckAccount(newplayersname);
    if (newplayersid != 0)
    {
        return newplayersid;
    }
    return 0;
}

public MySQLAddLoginRecord(sqlplayerid, ipaddr[])
{
    new query[128];
    new escip[16];
    samp_mysql_real_escape_string(ipaddr, escip);
    format(query, sizeof(query), "INSERT INTO logins (time,ip,userid) VALUES (UNIX_TIMESTAMP(),'%s',%d)", escip, sqlplayerid);
    samp_mysql_query(query);
    return 1;
}
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerConnected(playerid))
    {
    if(gPlayerLogged[playerid])
        {
            MySQLCheckConnection();
            new query[MAX_STRING];
            format(query, MAX_STRING, "UPDATE players SET ");
            MySQLUpdatePlayerStr(query, PlayerInfo[playerid][pSQLID], "Password", PlayerInfo[playerid][pKey]);
            PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Level", PlayerInfo[playerid][pLevel]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "AdminLevel", PlayerInfo[playerid][pAdmin]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "DonateRank", PlayerInfo[playerid][pDonateRank]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "UpgradePoints", PlayerInfo[playerid][gPupgrade]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "ConnectedTime", PlayerInfo[playerid][pConnectTime]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Registered", PlayerInfo[playerid][pReg]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Sex", PlayerInfo[playerid][pSex]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Age", PlayerInfo[playerid][pAge]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Origin", PlayerInfo[playerid][pOrigin]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CK", PlayerInfo[playerid][pCK]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Muted", PlayerInfo[playerid][pMuted]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Respect", PlayerInfo[playerid][pExp]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Money", PlayerInfo[playerid][pCash]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Bank", PlayerInfo[playerid][pAccount]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Crimes", PlayerInfo[playerid][pCrimes]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Kills", PlayerInfo[playerid][pKills]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Deaths", PlayerInfo[playerid][pDeaths]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Arrested", PlayerInfo[playerid][pArrested]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "WantedDeaths", PlayerInfo[playerid][pWantedDeaths]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Phonebook", PlayerInfo[playerid][pPhoneBook]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "LottoNr", PlayerInfo[playerid][pLottoNr]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Fishes", PlayerInfo[playerid][pFishes]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "BiggestFish", PlayerInfo[playerid][pBiggestFish]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Job", PlayerInfo[playerid][pJob]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Paycheck", PlayerInfo[playerid][pPayCheck]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "HeadValue", PlayerInfo[playerid][pHeadValue]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Jailed", PlayerInfo[playerid][pJailed]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "JailTime", PlayerInfo[playerid][pJailTime]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "UsedDrugs", PlayerInfo[playerid][pUsedDrugs]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "DrugTime", PlayerInfo[playerid][pDrugTimes]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Materials", PlayerInfo[playerid][pMats]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Rope", PlayerInfo[playerid][pRope]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "VirtualWorld", PlayerInfo[playerid][pVirtualWorld]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Drugs", PlayerInfo[playerid][pDrugs]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "SafeMats", PlayerInfo[playerid][pBoxMats]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "SafeDrugs", PlayerInfo[playerid][pBoxDrugs]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Leader", PlayerInfo[playerid][pLeader]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Member", PlayerInfo[playerid][pMember]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "FMember", PlayerInfo[playerid][pFMember]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Rank", PlayerInfo[playerid][pRank]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Char", PlayerInfo[playerid][pChar]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "ContractTime", PlayerInfo[playerid][pContractTime]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "DetSkill", PlayerInfo[playerid][pDetSkill]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "SexSkill", PlayerInfo[playerid][pSexSkill]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "BoxSkill", PlayerInfo[playerid][pBoxSkill]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "LawSkill", PlayerInfo[playerid][pLawSkill]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "MechSkill", PlayerInfo[playerid][pMechSkill]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "JackSkill", PlayerInfo[playerid][pJackSkill]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CarSkill", PlayerInfo[playerid][pCarSkill]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "NewsSkill", PlayerInfo[playerid][pNewsSkill]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "DrugsSkill", PlayerInfo[playerid][pDrugsSkill]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CookSkill", PlayerInfo[playerid][pCookSkill]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "FishSkill", PlayerInfo[playerid][pFishSkill]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "BusSkill", PlayerInfo[playerid][pBusSkill]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "TaxiSkill", PlayerInfo[playerid][pTaxiSkill]);
            MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pSQLID], "pSHealth", PlayerInfo[playerid][pSHealth]);
      GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
            MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pSQLID], "pHealth", PlayerInfo[playerid][pHealth]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Int", PlayerInfo[playerid][pInt]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Local", PlayerInfo[playerid][pLocal]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Team", PlayerInfo[playerid][pTeam]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Model", PlayerInfo[playerid][pModel]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "PhoneNr", PlayerInfo[playerid][pPnumber]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "House", PlayerInfo[playerid][pPhousekey]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Bizz", PlayerInfo[playerid][pPbiskey]);
            if ((PlayerInfo[playerid][pPos_x]==0.0 && PlayerInfo[playerid][pPos_y]==0.0 && PlayerInfo[playerid][pPos_z]==0.0))
            {
        PlayerInfo[playerid][pPos_x] = 1684.9;
              PlayerInfo[playerid][pPos_y] = -2244.5;
              PlayerInfo[playerid][pPos_z] = 13.5;
            }
            if(Spectate[playerid] != 255)
            {
              PlayerInfo[playerid][pPos_x] = Unspec[playerid][sPx];
              PlayerInfo[playerid][pPos_y] = Unspec[playerid][sPy];
              PlayerInfo[playerid][pPos_z] = Unspec[playerid][sPz];
              PlayerInfo[playerid][pInt] = Unspec[playerid][sPint];
              PlayerInfo[playerid][pLocal] = Unspec[playerid][sLocal];
            }
            MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pSQLID], "Pos_x", PlayerInfo[playerid][pPos_x]);
            MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pSQLID], "Pos_y", PlayerInfo[playerid][pPos_y]);
            MySQLUpdatePlayerFlo(query, PlayerInfo[playerid][pSQLID], "Pos_z", PlayerInfo[playerid][pPos_z]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CarLic", PlayerInfo[playerid][pCarLic]);
      MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "FlyLic", PlayerInfo[playerid][pFlyLic]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "BoatLic", PlayerInfo[playerid][pBoatLic]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "FishLic", PlayerInfo[playerid][pFishLic]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "GunLic", PlayerInfo[playerid][pGunLic]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Gun1", PlayerInfo[playerid][pGun1]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Gun2", PlayerInfo[playerid][pGun2]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Gun3", PlayerInfo[playerid][pGun3]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Gun4", PlayerInfo[playerid][pGun4]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Ammo1", PlayerInfo[playerid][pAmmo1]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Ammo2", PlayerInfo[playerid][pAmmo2]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Ammo3", PlayerInfo[playerid][pAmmo3]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Ammo4", PlayerInfo[playerid][pAmmo4]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CarTime", PlayerInfo[playerid][pCarTime]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "PayDay", PlayerInfo[playerid][pPayDay]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "PayDayHad", PlayerInfo[playerid][pPayDayHad]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CDPlayer", PlayerInfo[playerid][pCDPlayer]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Wins", PlayerInfo[playerid][pWins]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Loses", PlayerInfo[playerid][pLoses]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "AlcoholPerk", PlayerInfo[playerid][pAlcoholPerk]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "DrugPerk", PlayerInfo[playerid][pDrugPerk]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "MiserPerk", PlayerInfo[playerid][pMiserPerk]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "PainPerk", PlayerInfo[playerid][pPainPerk]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "TraderPerk", PlayerInfo[playerid][pTraderPerk]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Tutorial", PlayerInfo[playerid][pTut]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Mission", PlayerInfo[playerid][pMissionNr]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Warnings", PlayerInfo[playerid][pWarns]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Adjustable", PlayerInfo[playerid][pAdjustable]);
            if(PlayerInfo[playerid][pDonateRank] < 1) { PlayerInfo[playerid][pFuel] = 0; }
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Fuel", PlayerInfo[playerid][pFuel]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Married", PlayerInfo[playerid][pMarried]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "MarriedTo=%s\n", PlayerInfo[playerid][pMarriedTo]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Locked", PlayerInfo[playerid][pLocked]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "FishTool", PlayerInfo[playerid][pFishTool]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Mask", PlayerInfo[playerid][pMask]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "SafeBox", PlayerInfo[playerid][pVault]);
            MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CargoGet", PlayerInfo[playerid][pCargoGet]);
            MySQLUpdateFinish(query, PlayerInfo[playerid][pSQLID]);
        }
    }
    return 1;
}
i have lot's of query in my script i just dono witch one ....
Reply
#6

Cmon, im not gonna read through all of that. narrow it down to maybe 5 possible problems or something and i can help. It shouldnt be hard to figure out where the problem is.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)