Someone can help me with a function (uses mysql)
#1

Well im getting alot of warning and i need some help with this
pawn Код:
function CreatVehicle(owner[24], Float:x, Float:y, Float:z, price)
{
    printf("Saved Car Model(%d) to DB....", modelid);
    new query[300];
    format(query, sizeof(query), "INSERT INTO vehicles (modelid, x, y, z, a, color1, color2, locked, owner, value, owned, cantsell, Modop, vehid, model, fuel, miles, vlock, insurance, junk) VALUES (%d, %f, %f, %f, %f, %d, %d, %d, '%s', %d, %d, %d, %d, %d, '%s', %d, %d, %d, %d, %d)",
    modelid, x, y, z, a, color1, color2, locked, owner, value, owned, cantsell, Modop, vehid, model, fuel, miles, vlock, insurance, junk);
    MySQLCheckConnection();
    printf("Creating player vehicle....");
    print("addvehicle query...");
    printf(" SQL: %s",query);
    samp_mysql_query(query);

    samp_mysql_query("SELECT MAX(vehid) FROM vehicles");
    samp_mysql_store_result();
    new SQLId[12];
    samp_mysql_fetch_row(SQLId);
    printf("Vehicle Added as %s....",SQLId);
    new    vehid = strval(SQLId);
    new Owner[MAX_PLAYER_NAME];

    if(veh >= MAX_VEHICLES) { printf("Max Vehicles Reached."); return INVALID_SQL_ID; }

    vehinfo[vehid][cModel] = vehid;
    vehinfo[vehid][Float:cLocationx] = x;
    vehinfo[vehid][Float:cLocationy] = y;
    vehinfo[vehid][Float:cLocationz] = z;
    vehinfo[vehid][Float:Float:cAngle] = a;
    vehinfo[vehid][cColorOne];
    vehinfo[vehid][cColorTwo];
    vehinfo[vehid][cLocked];
    vehinfo[vehid][cOwner] = Owner;
    vehinfo[vehid][cValue] = price;
    vehinfo[vehid][cOwned];
    vehinfo[vehid][cCantSell];
    vehinfo[vehid][cModop];
    vehinfo[vehid][cVehid];
    vehinfo[vehid][cName];
    vehinfo[vehid][cMiles];
    vehinfo[vehid][cLock];
    vehinfo[vehid][cInsurance];
    vehinfo[vehid][cJunk];
    vehinfo[vehid][cPanel];
    vehinfo[vehid][cDoor];
    vehinfo[vehid][cLight];
    vehinfo[vehid][cTire];
    vehinfo[vehid][Float:cHealth];
    vehinfo[vehid][cSQLId];
    return 1;
}
I know its alot of code and very bad coded xD im tryind to creat this function to when a player type /buy vehicle he will need to put the vehicle id and colors


EDIT: FORGOT add modelid to the top dont mind about it
Reply


Messages In This Thread
Someone can help me with a function (uses mysql) - by NoobScripter1 - 08.10.2010, 11:56

Forum Jump:


Users browsing this thread: 1 Guest(s)