Not getting inserted into Mysql
#1

When I do this command, it isnt saving the persons skin, X, Y, Z cords. Its not saving anything at all.

pawn Код:
saveCharacterData(playerid) {
    query[0] = 0;//[2048];
    new accent[(32*2)+1];
    new Float:X,Float:Y,Float:Z,Float:A;
    new interior, vw;
    if(isInPaintball(playerid)) {
        X = GetPVarFloat(playerid, "XPaintBall");
        Y = GetPVarFloat(playerid, "YPaintBall");
        Z = GetPVarFloat(playerid, "ZPaintBall");
        interior = GetPVarInt(playerid, "IntPaintBall");
        vw = GetPVarInt(playerid, "VWPaintBall");
        GetPlayerFacingAngle(playerid, A);
    } else if(IsPlayerInEvent(playerid)) {
        A = GetPVarInt(playerid, "EventAngle");
        X = GetPVarFloat(playerid, "EventX");
        Y = GetPVarFloat(playerid, "EventY");
        Z = GetPVarFloat(playerid, "EventZ");
        interior = GetPVarInt(playerid, "EventInt");
        vw = GetPVarInt(playerid, "EventVW");
    } else {
        GetPlayerPos(playerid, X, Y, Z);
        GetPlayerFacingAngle(playerid, A);
        interior = GetPlayerInterior(playerid);
        vw = GetPlayerVirtualWorld(playerid);
    }
    new Float:health,Float:armour;
    GetPlayerHealth(playerid, health);
    GetPlayerArmour(playerid, armour);
    if(GetPlayerState(playerid) == PLAYER_STATE_WASTED || isPlayerDying(playerid)) { // /q to avoid fix
        health = 0.0;
        armour = 0.0;
        ResetPlayerWeaponsEx(playerid);
    }
    format(query, sizeof(query),"UPDATE `characters` SET `x` = %f, `y` = %f, `z` = %f, `angle` = %f, `interior` = %d, `virtualworld` = %d, `skin` = %d, `money` = %d, `bank` = %d,`userflags` = %d, `phonenumber` = %d,`phone` = %d,`sex` = %d, `age` = %d,`vehlocks` = %d,`cigars` = %d,`health` = %f,`armour` = %f, `job` = %d, `jobtime` = FROM_UNIXTIME(%d), `dpermitexptime` = FROM_UNIXTIME(%d) WHERE `id` = %d",
    X, Y, Z, A, interior, vw, GetPVarInt(playerid,"SkinID"), GetPVarInt(playerid,"Money"), GetPVarInt(playerid,"Bank"), GetPVarInt(playerid, "UserFlags"), GetPVarInt(playerid, "PhoneNumber"), GetPVarInt(playerid, "Phone"),GetPVarInt(playerid, "Sex"),GetPVarInt(playerid, "Age"),GetPVarInt(playerid,"VehLockpicks"),GetPVarInt(playerid,"Cigars"),health,armour,GetPVarInt(playerid, "Job"),GetPVarInt(playerid, "JobTime"),GetPVarInt(playerid, "DPermitExpTime"),GetPVarInt(playerid,"CharID"));
    mysql_function_query(g_mysql_handle, query, true, "EmptyCallback", "");
    new jailtime = GetPVarInt(playerid, "ReleaseTime");
    jailtime -= gettime();
    if(jailtime < 1) jailtime = 0;
    GetPVarString(playerid, "Accent", accent, sizeof(accent));
    mysql_real_escape_string(accent, accent);
    format(query, sizeof(query),"UPDATE `characters` SET `level` = %d, `respectpoints` = %d, `matsa` = %d,`matsb` = %d, `matsc` = %d,`pot` = %d, `coke` = %d, `meth` = %d,`gunskill` = %d, `matapacks` = %d, `matbpacks` = %d, `matcpacks` = %d, `potseeds` = %d, `cokeplants` = %d, `methmaterials` = %d, `FMember` = %d, `Rank` = %d, `Kills` = %d, `Deaths` = %d,`Member` = %d,`jailtime` = %d, `trainingcredits` = %d, `fightstyle` = %d, `payday` = %d, `paycheque` = %d, `licenseflags` = %d WHERE `id` = %d",
    GetPVarInt(playerid, "Level"), GetPVarInt(playerid,"RespectPoints"),GetPVarInt(playerid, "MatsA"),
    GetPVarInt(playerid, "MatsB"),GetPVarInt(playerid, "MatsC"),GetPVarInt(playerid, "Pot"),GetPVarInt(playerid, "Coke"),
    GetPVarInt(playerid, "Meth"),GetPVarInt(playerid, "GunSkill"), GetPVarInt(playerid, "MatAPacks"),
    GetPVarInt(playerid, "MatBPacks"),GetPVarInt(playerid, "MatCPacks"),GetPVarInt(playerid, "PotSeeds"),
    GetPVarInt(playerid, "CokePlants"),GetPVarInt(playerid, "MethMaterials"),
    GetPVarInt(playerid, "Family"),GetPVarInt(playerid, "Rank"),
    GetPVarInt(playerid, "Kills"),GetPVarInt(playerid, "Deaths"),GetPVarInt(playerid, "Faction"),
    jailtime, GetPVarInt(playerid, "TrainingCredits"), GetPVarInt(playerid, "FightStyle"),
    GetPVarInt(playerid, "Payday"),GetPVarInt(playerid, "PayCheque"),GetPVarInt(playerid, "LicenseFlags"),
    GetPVarInt(playerid,"CharID"));
    mysql_function_query(g_mysql_handle, query, true, "EmptyCallback", "");
    format(query, sizeof(query),"UPDATE `characters` SET `irc` = %d, `ircrank` = %d,`accent` = \"%s\",`maxcars` = %d,`maxhouses` = %d, `maxbusinesses` = %d,`jailtype` = %d,`contract` = %d,`renthouse` = %d,`gascan` = %d,`wtchannel` = %d,`spouse` = %d,`furnituretokens` = %d, `maxcraftguns` = %d WHERE `id` = %d",
    GetPVarInt(playerid, "IRCChan"), GetPVarInt(playerid,"IRCRank"),accent, GetPVarInt(playerid, "MaxCars"),GetPVarInt(playerid, "MaxHouses"),GetPVarInt(playerid, "MaxBusinesses"),GetPVarInt(playerid, "JailType"),GetPVarInt(playerid, "Contract"),GetPVarInt(playerid, "Rent"),GetPVarInt(playerid, "GasCans"),GetPVarInt(playerid, "WTChannel"),GetPVarInt(playerid, "SpouseID"),GetPVarInt(playerid, "FurnitureTokens"),GetPVarInt(playerid, "MaxCraftGuns"), GetPVarInt(playerid,"CharID"));
    mysql_function_query(g_mysql_handle, query, true, "EmptyCallback", "");
    format(query, sizeof(query), "UPDATE `characters` set `specialitem` = %d,`phonestatus` = %d,`hunger` = %d where `id` = %d",GetPVarInt(playerid, "SpecialItem"), GetPVarInt(playerid, "PhoneStatus"),GetHungerLevel(playerid),GetPVarInt(playerid,"CharID"));
    mysql_function_query(g_mysql_handle, query, true, "EmptyCallback", "");
    saveDiseases(playerid);
    return 1;
}
Reply
#2

MySQL Error?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)