Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1. forward SaveORGAutos(theorgcarid);
  2. public SaveORGAutos(theorgcarid)
  3. {
  4. new query[512];
  5. format(query, sizeof(query), "UPDATE `orgautos` SET orgautox = '%f',orgautoy = '%f',orgautoz = '%f',orgautor = '%f',orgautocolor = '%d',orgautocolor2 = '%d',orgautokaufpreis WHERE `autoid` = '%d'", // org id wird ja direkt inserted
  6. OrgAuto[theorgcarid][orgautox],OrgAuto[theorgcarid][orgautoy],OrgAuto[theorgcarid][orgautoz],OrgAuto[theorgcarid][orgautor],
  7. OrgAuto[theorgcarid][orgautocolor],OrgAuto[theorgcarid][orgautocolor2],OrgAuto[theorgcarid][orgautokaufpreis],OrgAuto[theorgcarid][orgautodbid]);
  8. mysql_function_query(mysqlcon,query, false, "", "");
  9. return 1;
  10. }
  11.  
  12.  
  13.  
  14.  
  15.  
  16. ocmd:orgauto(playerid,params[]){ /// FactionCars[fc][fVehid] wird verwendet irgendwo noch... oder ?
  17. if(PlayerInfo[playerid][pAdmin] == 2002)
  18. {
  19. new vehid,col1,col2,orgid;
  20. if(sscanf(params,"dddd",vehid,col1,col2,orgid)) return SendClientMessage(playerid,FACTION_COL_GREY,"Benutze: '/orgauto [Model] [Farbe(1)] [Farbe(2)] [OrgID]'.");
  21. if(vehid < 400 || vehid > 611) return SendClientMessage(playerid,FACTION_COL_GREY,"Vehicle-ID nur von 400 bis 611.");
  22. if(col1 < 0 || col1 > 255) return SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Farbe(1)!");
  23. if(col2 < 0 || col2 > 255) return SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Farbe(2)!");
  24.  
  25. new fc = getFreeorgautoid();
  26.  
  27. OrgAuto[fc][orgvehtype] = vehid;
  28. new Float:fX,Float:fY,Float:fZ,Float:fA;
  29. GetPlayerPos(playerid,fX,fY,fZ),GetPlayerFacingAngle(playerid,fA);
  30.  
  31. OrgAuto[fc][orgautox] = fX;
  32. OrgAuto[fc][orgautoy] = fY;
  33. OrgAuto[fc][orgautoz] = fZ;
  34. OrgAuto[fc][orgautor] = fA;
  35. OrgAuto[fc][orgautocolor] = col1;
  36. OrgAuto[fc][orgautocolor2] = col2;
  37.  
  38. OrgAuto[fc][autoorgid] = orgid;
  39.  
  40. //FactionCars[fc][fPrice] = 0;
  41.  
  42. OrgAuto[fc][LocalID] = CreateVehicle(OrgAuto[fc][orgvehtype],OrgAuto[fc][orgautox],OrgAuto[fc][orgautoy],OrgAuto[fc][orgautoz],OrgAuto[fc][orgautor],OrgAuto[fc][orgautocolor],OrgAuto[fc][orgautocolor2],-1, 0);
  43. //Gas[FactionCars[fc][fCarid]] = 80;
  44. SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du hast das Organisations Fahrzeug erfolgreich erstellt.");
  45. SendClientMessage(playerid,COLOR_LIGHTBLUE,"Vergesse es nicht mit '/parken' umzuparken.");
  46. PutPlayerInVehicle(playerid,OrgAuto[fc][LocalID],0);
  47. SaveORGcarToDB(OrgAuto[fc][orgautodbid]);
  48. return 1;
  49. }else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
  50. return 1;
  51. }
  52.  
  53. forward SaveORGcarToDB(fc);
  54. public SaveORGcarToDB(fc)
  55. {
  56. new query[512];
  57. format(query,sizeof(query),"INSERT INTO orgautos (autoid,orgid,orgvehtype,orgautox,orgautoy,orgautoz,orgautor,orgautocolor,orgautocolor2,orgautokaufpreis) VALUES ('%d','%d','%d','%f','%f','%f','%f','%d','%d','%d')",
  58. OrgAuto[fc][orgautodbid],OrgAuto[fc][autoorgid],OrgAuto[fc][orgvehtype],OrgAuto[fc][orgautox],OrgAuto[fc][orgautoy],OrgAuto[fc][orgautoz],OrgAuto[fc][orgautor],OrgAuto[fc][orgautocolor],OrgAuto[fc][orgautocolor2],OrgAuto[fc][orgautokaufpreis]);
  59.  
  60.  
  61. mysql_function_query(mysqlcon,query,true,"OnORGAutoCreated","i",OrgAuto[fc][autoorgid]);
  62. return 1;
  63. }
  64. forward OnORGAutoCreated(fc);
  65. public OnORGAutoCreated(fc)
  66. {
  67. OrgAuto[fc][orgautodbid] = mysql_insert_id();
  68. SendClientMessageToAll(-1,"Du bist hässlich und was noch ?");
  69. return 1;
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement