30.01.2014, 18:22
Hello Community!
I have finally fixed all my MYSQL errors so I can finally continue with my RP script.
I just finished my Ownable Vehicle System but now I got a problem.
When I do /mycars it has to load all the cars from the database that the player owns.
Currently I got this, but it only loads one car. ( the first one it finds)
How can I make it so it checks all the players cars? (Max is going to be 10 if you will need that anywhere)
I have finally fixed all my MYSQL errors so I can finally continue with my RP script.
I just finished my Ownable Vehicle System but now I got a problem.
When I do /mycars it has to load all the cars from the database that the player owns.
Currently I got this, but it only loads one car. ( the first one it finds)
pawn Код:
command(mycars, playerid, params[])
{
if(Player[playerid][Adminlevel] == 6)
{
new Data[150],Field[258],idx;
new MyCarPlate[10], MyCarModel, MyCarStoreID;
mysql_queryS("SELECT * FROM `OwnedVehicles` WHERE `VehicleOwner` = '%s'",GetName(playerid));
mysql_store_result();
if(mysql_num_rows() == 1){
mysql_fetch_rowEx(Data);
Field = strtuk( Data, idx, '|' );
for(new s = 0; s < 17; s++)
{
switch(s)
{
case 0: MyCarStoreID = strval(Field);
case 1: MyCarModel = strval(Field);
case 10: strmid(MyCarPlate,Field,0,strlen(Field),10);
}
Field = strtuk( Data, idx, '|' );
}
fSendClientMessage(playerid, WHITE, "> #%d, ModelID: %d, Plate: %s",MyCarStoreID, MyCarModel, MyCarPlate);
}
if(mysql_num_rows() == 0){
SCM(playerid, YELLOW, "> You do not own any vehicles yet!");
}
}
return 1;
}