09.11.2009, 18:55
Have a look at my code:
It needs some adjustments here and there for you. But that is up to you!
pawn Code:
stock LoadVehicles( )
{
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 );
CreateVehicle( Modelid , Spawn_X , Spawn_Y , Spawn_Z , Angle , Color1 , Color2 , Respawn_delay ) );
}
mysql_free_result( );
return 1;
}