Loading cars
#1

Hi, is it possible to get data from a certain rows in MySQL? I know I can do
Код:
cache_get_value_name...(rowid...
etc but I'm trying to add dynamic vehicles system to my gamemode and only load a player's cars once he logs in. I'm planning to allow player to have like 5 slots so I can't just select one row and load data. I want to load all the 5 cars so I could do it like this: let's say I have my cars in row 1, 6, 8, 10 and 12 then I could do it like this:
Код:
cache_get_value_name(1,...
cache_get_value_name(6,...
cache_get_value_name(8,...
cache_get_value_name(10,...
cache_get_value_name(12,...
but how do I know the row ids? Do I need to create some variables called Car1, Car2, Car3, etc for each player and then load his cars one by one?
Reply
#2

the cache rows are determined by the results that you get from your SELECT queries

they go from 0 to n

Some pseudo code, to show you what you could do:

PHP код:
mysql_tquery(sqlHandle"SELECT * FROM cars WHERE Owner='Username'""callback");
forward callback();
public 
callback()
{
    new 
rowcount;
    
cache_get_row_count(rowcount);
    
    for(new 
0rowcounti++)
    {
        
cache_get_value_name("VARIABLE NAME"putInHere);
        
loadCar(putInHere);
    }
    

Reply
#3

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)