Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. CMD:reloadfactioncars(playerid, params[]) {
  2. mysql_format(SQL, SQLStringg, sizeof(SQLStringg), "SELECT * FROM `faction`");
  3. new Cache: facc = mysql_query(SQL, SQLStringg);
  4. for(new faccc=1; faccc<=cache_get_row_count(); faccc++) {
  5. cache_delete(facc);
  6. mysql_format(SQL, SQLStringg2, sizeof(SQLStringg2), "SELECT * FROM `faction_cars` WHERE `Faction`='%d'", faccc);
  7. new Cache: MASINI = mysql_query(SQL, SQLStringg2);
  8. for(new car=1; car<=cache_get_row_count(); car++) {
  9. if(cache_get_row_count() < 1) return SCM(playerid, COLOR_WHITE, "Nu exista masini pentru aceasta factiune.");
  10. if(FactionCar[faccc][car] != 0) DestroyVehicle(FactionCar[faccc][car]);
  11. new strcarplate[512];
  12. format(strcarplate, sizeof(strcarplate), "{%s}%s %d", cache_get_field_content_int(faccc, "ColorPickup2"), cache_get_field_content_int(faccc, "Name2"), car);
  13. FactionCar[faccc][car] = AddStaticVehicleEx(cache_get_field_content_int(car, "Model"), cache_get_field_content_float(car, "LocX"), cache_get_field_content_int(car, "LocY"), cache_get_field_content_float(car, "LocZ"), cache_get_field_content_float(car, "Angle"), cache_get_field_content_int(car, "Color1"), cache_get_field_content_int(car, "Color2"), -1, cache_get_field_content_int(car, "Siren"));
  14. SetVehicleNumberPlate(FactionCar[faccc][car], strcarplate);
  15. }
  16. cache_delete(MASINI);
  17. }
  18. format(PString, sizeof(PString), "%s a reincarcat masinile tuturor factiunilor.", GetName(playerid));
  19. ABroadCast(COLOR_WHITE, PString, 1);
  20. return 1;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement