MySQL Help please
#4

This is my (working) code to load vehicles:
pawn Код:
stock LoadVehicles( )
{
    MySQLCheck( );
    new
        ID ,
        Modelid ,
        Float:Spawn_X ,
        Float:Spawn_Y ,
        Float:Spawn_Z ,
        Float:Angle ,
        Color1 ,
        Color2 ,
        Respawn_delay ,
        line[ 1024 ] ;
    mysql_query( "SELECT * FROM `vehicles`" );
    mysql_store_result( );
    while( mysql_fetch_row_format( line , "|" ) )
    {
        sscanf( line , "p|iiffffiii" , ID , Modelid , Spawn_X , Spawn_Y , Spawn_Z , Angle , Color1 , Color2 , Respawn_delay );
        Itter_Add(Vehicle, CreateVehicle( Modelid , Spawn_X , Spawn_Y , Spawn_Z , Angle , Color1 , Color2 , Respawn_delay ) );
    }
    mysql_free_result( );
    return 1;
}
Reply


Messages In This Thread
MySQL Help please - by Cem - 30.11.2009, 14:15
Re: MySQL Help please - by Cem - 30.11.2009, 20:06
Re: MySQL Help please - by Cem - 01.12.2009, 10:54
Re: MySQL Help please - by Marcel - 01.12.2009, 11:45

Forum Jump:


Users browsing this thread: 2 Guest(s)