SA-MP Forums Archive
PlayerToPoint In MysQl Query - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PlayerToPoint In MysQl Query (/showthread.php?tid=205807)



PlayerToPoint In MysQl Query - LeNy - 02.01.2011

Hello everyone. I have a problem you see I want to do to check whether the player is located at a distance of 2.0 from the position set in the mysql table. And I have a question how to create such a query?


Re: PlayerToPoint In MysQl Query - kLx - 02.01.2011

pawn Код:
stock
    SomeFunc( playerid )
{
    new
        string[ 80 ],
        Float: x, Float: y, Float: z;
       
    mysql_query( "SELECT `x`, `y`, `z` FROM `sometable`" );
    mysql_store_result( );
   
    if ( mysql_fetch_row( string ) )
    {
        sscanf( string, "p<|>fff", x, y, z );
       
        if ( IsPlayerInRangeOfPoint( playerid, 2.0, x, y, z ) )
            return true;
        else
            return false;
    }
    else
        print ( "Query failed." );
       
    return false;
}