10.11.2017, 22:46
PHP код:
LoadPlayerData(playerid){
new query[1000], Float:xPos[3], result[121];
format ( query , sizeof ( query ) , "SELECT * FROM players WHERE name = '%s' LIMIT 1" , getName ( playerid ) ) ;
mysql_query ( query ) ;
mysql_store_result ( ) ;
if ( mysql_num_rows ( ) == 1 ) {
mysql_fetch_row(result);
mysql_fetch_field_row ( query , "id" ); pData [ playerid ] [ sqlid ] = strval ( query );
mysql_fetch_field_row ( query , "istorija" ); pData[playerid][istorija] = strval ( query );
mysql_fetch_field_row ( query , "lytis" ); pData[playerid][lytis] = strval ( query );
mysql_fetch_field_row ( query , "drabuziai" ); pData[playerid][drabuziai] = strval ( query );
mysql_fetch_field_row ( query , "naujokouzd" ); pData[playerid][newbieTask] = strval ( query );
mysql_fetch_field_row ( query , "xp" ); pData[playerid][patirtis] = strval ( query );
mysql_fetch_field_row ( query , "lygis" ); pData[playerid][lygis] = strval ( query );
mysql_fetch_field_row ( query , "money" ); GivePlayerMoney(playerid, strval ( query ));
mysql_fetch_field_row ( query , "x" ) ; xPos[0] = floatstr ( query );
mysql_fetch_field_row ( query , "y" ) ; xPos[1] = floatstr ( query );
mysql_fetch_field_row ( query , "z" ) ; xPos[2] = floatstr ( query );
SetPlayerPos(playerid, xPos[0],xPos[1],xPos[2]);
SetPlayerSkin(playerid, pData[playerid][drabuziai]);
printf("%f %f %f", xPos[0],xPos[1],xPos[2]);
} else return Kick(playerid);
printf("%s zaidejo informacija buvo uzkrauta", getName(playerid));
mysql_free_result();
return true;
}
PHP код:
23:38:32] CMySQLHandler::Query(SELECT * FROM players WHERE name = 'Jakesn' LIMIT 1) - Successfully executed.
[23:38:32] >> mysql_store_result( Connection handle: 1 )
[23:38:32] CMySQLHandler::StoreResult() - Result was stored.
[23:38:32] >> mysql_num_rows( Connection handle: 1 )
[23:38:32] CMySQLHandler::NumRows() - Returned 1 row(s)
[23:38:32] >> mysql_fetch_row_format( Connection handle: 1 )
[23:38:32] CMySQLHandler::FetchRow() - Return: 4|Jakesn|lopas|127.0.0.1|2017-11-05 18:20:04|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|132.334|-67.63|1.57812
[23:38:32] >> mysql_fetch_field_row( Connection handle: 1 )
[23:38:32] CMySQLHandler::FetchField("id") - 4
[23:38:32] >> mysql_fetch_field_row( Connection handle: 1 )