Advertisement
Ghecco

Untitled

Jan 2nd, 2021
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. // Garage System | Ghecco
  2. #define COLOR_RED 0x8B0000FF
  3. #define COLOR_WHITE -1
  4.  
  5. // definizione
  6. #define MAX_GARAGES (100)
  7.  
  8. new Iterator:Garages<MAX_GARAGES>;
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. command(creagarage, playerid, params[])
  17. {
  18. if(!IsPlayerAdmin(playerid)) return 1;
  19. {
  20. new garage_type, garage_price, garage_id = Iter_Free(Garages);
  21.  
  22. if(sscanf(params, "ii", garage_type, garage_price)) return SendClientMessage(playerid, COLOR_WHITE, "/creagarage <tipo> <prezzo>");
  23. else if(garage_id == -1) return SendClientMessage(playerid, COLOR_RED, "Non รจ possibile creare ulteriori garage.");
  24. else if(garage_type < 0 | garage_type > 3) return SendClientMessage(playerid, COLOR_RED, "Tipi garage disponibili: 1 Piccolo | 2 Medio | 3 Grande");
  25. else if(garage_price < 1 ! garage_price > 100000) return SendClientMessage(playerid, COLOR_RED, "Prezzo invalido, inserisci un prezzo compreso tra 1-100000");
  26.  
  27. new Float:x, Float:y, Float:z, zona[50], string[100];
  28. GetPlayerPos(playerid, x, y, z);
  29.  
  30. GetCoords2DZone(x, y, zona, sizeof(zona));
  31. format(string, sizeof(string), "Garage #%d\n%s\nIn vendita", garage_id, zona);
  32. CreateDynamic3DTextLabel(, 0xFFFFFFFF, x, y, z+10.0, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1);
  33.  
  34. CreateDynamicPickup(1239, 1, x, y, z);
  35.  
  36. new query[256];
  37. format(query, sizeof query, "INSERT INTO garages (ID, type, price) VALUES (%d,%d,%d,%d)", garage_id, garage_type, garage_price);
  38. mysql_tquery(MySQL, query);
  39.  
  40. return 1;
  41. }
  42. }
  43.  
  44. command(cancellagarage, playerid, params[])
  45. {
  46. if(!IsPlayerAdmin(playerid) && AdminLevel(playerid) < 1) return 1;
  47. {
  48. new garage_id;
  49. if(sscanf(params, "i", garage_id)) return SendClientMessage(playerid, COLOR_WHITE, "/cancellagarage <ID>");
  50. else if(!Garage[id][type]) return SendClientMessage(playerid, COLOR_RED, "Garage ID invalido.");
  51. if()
  52. }
  53. }
  54.  
  55. stock GetVehicleStringInGarage(garage_id, &vid_1, &vid_2, &vid_3)
  56. {
  57. new query[400];
  58. format(query, sizeof query, "SELECT INTO garages WHERE ID = %d", garage_id);
  59. return 1;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement