Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward SaveORGAutos(theorgcarid);
- public SaveORGAutos(theorgcarid)
- {
- new query[512];
- 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
- OrgAuto[theorgcarid][orgautox],OrgAuto[theorgcarid][orgautoy],OrgAuto[theorgcarid][orgautoz],OrgAuto[theorgcarid][orgautor],
- OrgAuto[theorgcarid][orgautocolor],OrgAuto[theorgcarid][orgautocolor2],OrgAuto[theorgcarid][orgautokaufpreis],OrgAuto[theorgcarid][orgautodbid]);
- mysql_function_query(mysqlcon,query, false, "", "");
- return 1;
- }
- ocmd:orgauto(playerid,params[]){ /// FactionCars[fc][fVehid] wird verwendet irgendwo noch... oder ?
- if(PlayerInfo[playerid][pAdmin] == 2002)
- {
- new vehid,col1,col2,orgid;
- if(sscanf(params,"dddd",vehid,col1,col2,orgid)) return SendClientMessage(playerid,FACTION_COL_GREY,"Benutze: '/orgauto [Model] [Farbe(1)] [Farbe(2)] [OrgID]'.");
- if(vehid < 400 || vehid > 611) return SendClientMessage(playerid,FACTION_COL_GREY,"Vehicle-ID nur von 400 bis 611.");
- if(col1 < 0 || col1 > 255) return SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Farbe(1)!");
- if(col2 < 0 || col2 > 255) return SendClientMessage(playerid,FACTION_COL_GREY,"Falsche Farbe(2)!");
- new fc = getFreeorgautoid();
- OrgAuto[fc][orgvehtype] = vehid;
- new Float:fX,Float:fY,Float:fZ,Float:fA;
- GetPlayerPos(playerid,fX,fY,fZ),GetPlayerFacingAngle(playerid,fA);
- OrgAuto[fc][orgautox] = fX;
- OrgAuto[fc][orgautoy] = fY;
- OrgAuto[fc][orgautoz] = fZ;
- OrgAuto[fc][orgautor] = fA;
- OrgAuto[fc][orgautocolor] = col1;
- OrgAuto[fc][orgautocolor2] = col2;
- OrgAuto[fc][autoorgid] = orgid;
- //FactionCars[fc][fPrice] = 0;
- 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);
- //Gas[FactionCars[fc][fCarid]] = 80;
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"Du hast das Organisations Fahrzeug erfolgreich erstellt.");
- SendClientMessage(playerid,COLOR_LIGHTBLUE,"Vergesse es nicht mit '/parken' umzuparken.");
- PutPlayerInVehicle(playerid,OrgAuto[fc][LocalID],0);
- SaveORGcarToDB(OrgAuto[fc][orgautodbid]);
- return 1;
- }else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
- return 1;
- }
- forward SaveORGcarToDB(fc);
- public SaveORGcarToDB(fc)
- {
- new query[512];
- 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')",
- 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]);
- mysql_function_query(mysqlcon,query,true,"OnORGAutoCreated","i",OrgAuto[fc][autoorgid]);
- return 1;
- }
- forward OnORGAutoCreated(fc);
- public OnORGAutoCreated(fc)
- {
- OrgAuto[fc][orgautodbid] = mysql_insert_id();
- SendClientMessageToAll(-1,"Du bist hässlich und was noch ?");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement