Skin wird falsch eingetragen

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo,


    der skin wird falsch eingetragen in der mysql tabelle. Ich benutze MySQL R5. Hier mal der code. public OnPlayerModelSelection(playerid, response, listid, modelid)
    {
    if(listid == skinlist)
    {
    if(response)
    {
    SendClientMessage(playerid, 0xFF0000FF, "Du hast dein Skin erfolgreich geändert. Mit /changeskin kannst du ihn wieder ändern.");
    SetPlayerSkin(playerid, modelid);
    pInfo[playerid][pSkin] = modelid;
    printf("%d",modelid);
    SavePlayer(playerid);
    }
    else SendClientMessage(playerid, 0xFF0000FF, "");
    return 1;
    }
    return 1;
    }


    stock SavePlayer(playerid)
    {
    new mysql[400];
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(pInfo[playerid][pOnline] == 1)
    {
    format(mysql,sizeof(mysql),"UPDATE `users` SET `pAdmin`='%d',`pBanned`='%d',`pSkin`='%d',`pEmail`='%s',`pLevel`='%d',`pMoney`='%d' WHERE `pName` = '%s'",
    pInfo[playerid][pAdmin],pInfo[playerid][pBanned],pInfo[playerid][pSkin],pInfo[playerid][pEmail],pInfo[playerid][pLevel],pInfo[playerid][pMoney],GetName(playerid));
    mysql_query(mysql);
    }
    }
    return 1;
    }


    und in der tabelle steht bei pSkin NULL

  • [19:27:56]


    [19:27:56] ---------------------------


    [19:27:56] MySQL Debugging activated (01/09/14)


    [19:27:56] --------------------------


    [19:27:56]
    [19:27:56] >> mysql_query( Connection handle: 1 )
    [19:27:56] CMySQLHandler::Query(CREATE TABLE IF NOT EXISTS `users` (`id` int(11) AUTO_INCREMENT, PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;) - Successfully executed.
    [19:27:56] >> mysql_query( Connection handle: 1 )
    [19:27:56] CMySQLHandler::Query(ALTER TABLE `users` ADD `pName` varchar(64)) - An error has occured. (Error ID: 1060, Duplicate column name 'pName')
    [19:27:56] >> mysql_query( Connection handle: 1 )
    [19:27:56] CMySQLHandler::Query(ALTER TABLE `users` ADD `pPasswort` varchar(64)) - An error has occured. (Error ID: 1060, Duplicate column name 'pPasswort')
    [19:27:56] >> mysql_query( Connection handle: 1 )
    [19:27:56] CMySQLHandler::Query(ALTER TABLE `users` ADD `pSkin` int(64)) - An error has occured. (Error ID: 1060, Duplicate column name 'pSkin')
    [19:27:56] >> mysql_ping( Connection handle: 1 )
    [19:27:56] CMySQLHandler::Ping() - Connection is still alive.
    [19:28:38] >> mysql_query( Connection handle: 1 )
    [19:28:38] CMySQLHandler::Query(SELECT * FROM `users` WHERE `pName`='aice.j') - Successfully executed.
    [19:28:38] >> mysql_store_result( Connection handle: 1 )
    [19:28:38] CMySQLHandler::StoreResult() - Result was stored.
    [19:28:38] >> mysql_num_rows( Connection handle: 1 )
    [19:28:38] CMySQLHandler::NumRows() - Returned 0 row(s)
    [19:28:40] >> mysql_query( Connection handle: 1 )
    [19:28:40] CMySQLHandler::Query(INSERT INTO `users`(`pName`,`pPasswort`) VALUE ('aice.j','dds')) - Successfully executed.
    [19:28:40] >> mysql_query( Connection handle: 1 )
    [19:28:40] CMySQLHandler::Query(UPDATE `users` SET `pAdmin`='0',`pBanned`='0',`pSkin`='0',`pEmail`='',`pLevel`='0',`pMoney`='0' WHERE `pName` = 'aice.j') - An error has occured. (Error ID: 1054, Unknown column 'pAdmin' in 'field list')
    [19:28:41] >> mysql_query( Connection handle: 1 )
    [19:28:41] CMySQLHandler::Query(UPDATE `users` SET `pAdmin`='0',`pBanned`='0',`pSkin`='4',`pEmail`='',`pLevel`='0',`pMoney`='0' WHERE `pName` = 'aice.j') - An error has occured. (Error ID: 1054, Unknown column 'pAdmin' in 'field list')
    [19:28:44] >> mysql_query( Connection handle: 1 )
    [19:28:44] CMySQLHandler::Query(UPDATE `users` SET `pAdmin`='0',`pBanned`='0',`pSkin`='4',`pEmail`='',`pLevel`='0',`pMoney`='0' WHERE `pName` = 'aice.j') - An error has occured. (Error ID: 1054, Unknown column 'pAdmin' in 'field list')
    [19:28:48] CMySQLHandler::~CMySQLHandler() - deconstructor called.
    [19:28:48] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [19:28:48] CMySQLHandler::Disconnect() - Connection was closed.