Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CreatexVehicle(modelid, ownername[], prices, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2)
- {
- new id = Iter_Free(xVehicles);
- xVehicle[id][xv_Veh] = CreateVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, -1);
- xVeh[xVehicle[id][xv_Veh]] = id;
- xVehicle[id][xv_ModelID] = modelid;
- xVehicle[id][xv_Renk][0] = color1;
- xVehicle[id][xv_Renk][1] = color2;
- xVehicle[id][xv_Paintjob] = -1;
- xVehicle[id][xv_Pos][0] = spawn_x;
- xVehicle[id][xv_Pos][1] = spawn_y;
- xVehicle[id][xv_Pos][2] = spawn_z;
- xVehicle[id][xv_Pos][3] = z_angle;
- format(xVehicle[id][xv_Sahip], 24, "%s", ownername);
- xVehicle[id][xv_Fiyat] = prices;
- plate_check:
- format(xVehicle[id][xv_Plaka], 8, "%s", CreatePlate());
- foreach(new i : xVehicles) if(!xStrcmp(xVehicle[id][xv_Plaka], xVehicle[i][xv_Plaka])) goto plate_check;
- SetVehicleNumberPlate(xVehicle[id][xv_Veh], xVehicle[id][xv_Plaka]);
- SetVehicleToRespawn(xVehicle[id][xv_Veh]);
- Iter_Add(xVehicles, id);
- new query[256];
- format(query, sizeof(query),"INSERT INTO `xVehicle` (`ID`,`Sahip`,`Fiyat`,`X`,`Y`,`Z`,`A`,`Model`,`Renk1`,`Renk2`,`Plaka`) VALUES ('%d','%s','%d','%f','%f','%f','%f','%d','%d','%d','%s')",
- id, ownername, prices, spawn_x, spawn_y, spawn_z, z_angle, modelid, color1, color2, xVehicle[id][xv_Plaka]);
- mysql_query(handle, query);
- if(!strlen(xVehicle[id][xv_Sahip]))
- {
- new str[150];
- format(str, sizeof(str), "{00FF00}This Vehicle Is For Sale!\n{FFA500}Vehicle Name: {FFFFFF}%s\n{FFA500}Plate Number: {FFFFFF}%s\n{FFA500}Price: {00FF00}$%d", GetVehicleNameFromModel(xVehicle[id][xv_ModelID]), xVehicle[id][xv_Plaka], xVehicle[id][xv_Fiyat]);
- xVehicle[id][xv_Text] = Create3DTextLabel(str, 0x008080FF, 0.0, 0.0, 0.0, 50.0, 0);
- Attach3DTextLabelToVehicle(xVehicle[id][xv_Text], xVehicle[id][xv_Veh], 0.0, 0.0, 1.0);
- }
- return xVehicle[id][xv_Veh];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement