SA-MP Forums Archive
SA-MP Loading vehicles - 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)
+--- Thread: SA-MP Loading vehicles (/showthread.php?tid=486629)



SA-MP Loading vehicles - sammp - 09.01.2014

I've recently turned to mysql r34. I just need someone to explain what to do in the public: I want to load Player Owned Vehicles. All I need someone to do is give a layout of what I'm gonna need to do. Thanks!!

pawn Код:
new query[164]; // this code is from OnPlayerConnect.
        format(query, sizeof(query), "SELECT * FROM `ownedvehicles` WHERE `OwnedVehicleOwner` = '%s' ORDER BY `OwnedVehicleID` ASC", "OnOwnedVehicleLoad", Player[playerid][Name]);
        mysql_tquery(SQL, query, "OnOwnedVehicleLoad", "us", playerid, Player[playerid][Name]);
       
       
        orm_load(ormid, "OnPlayerDataLoaded", "dd", playerid, MysqlRaceCheck[playerid]);
        return 1;
    }
   
    forward OnOwnedVehicleLoad(playerid, p_name[]);
    public OnOwnedVehicleLoad(playerid, p_name[])
    {
       
        return 1;
    }



Re: SA-MP Loading vehicles - sammp - 09.01.2014

Can someone help? Can't really get anywhere without it


Re: SA-MP Loading vehicles - Seif- - 09.01.2014

After sending the query, store the result then fetch the rows. You can use sscanf as a delimiter to store your values in variables.