Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ocmd:createfcar(playerid,params[])
- {
- if(!isAdmin(playerid,1) || ADuty[playerid] == 1) return SendClientMessage(playerid,-1,"Nicht Duty oder Admin");
- {
- //new query[128];
- new mID,pID,color1,color2,frak[128];
- print("Car fehlgeschlagen 2");
- if(sscanf(params,"iiiu",mID,color1,color2,frak)) return SendClientMessage(playerid,-1,"INFO: /createfcar [VehicleID] [Color1] [Color2] [Fraktionsname]");
- if(mID <400 || mID > 611) return SendClientMessage(playerid,RED,"Ungültige ID!");
- {
- new Float:xc,Float:yc,Float:zc,Float:rc;
- GetPlayerPos(pID,xc,yc,zc);
- GetPlayerFacingAngle(pID,rc);
- createFrakCar(pID,mID,xc,yc,zc,rc,color1,color2,frak);
- PutPlayerInVehicle(playerid,mID,1);
- print("Car erfolgreich");
- }
- print("Car fehlgeschlagen");
- }
- return 1;
- }
- forward frakcarSavedToDB(carid);
- createFrakCar(playerid,modelid,Float:x,Float:y,Float:z,Float:r,color1,color2,frak)
- {
- print("Createfcar vor schleife");
- for(new i=0; i<sizeof(fInfo); i++)
- {
- print("Create fcar in schleif");
- if(cInfo[i][id_x]!=0)continue;
- //cInfo[i][besitzer]=fInfo[playerid][f_name];
- //GetPlayerName(playerid,cInfo[i][besitzer],MAX_PLAYER_NAME);
- fInfo[MAX_FRAKS][c_x]=x;
- fInfo[][c_y]=y;
- fInfo[][c_z]=z;
- fInfo[][c_r]=r;
- fInfo[][model]=modelid;
- fInfo[][id_x] = CreateVehicle(modelid,x,y,z,r,color1,color2,-1);
- new string[256],pIDname[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pIDname,sizeof(pIDname));
- format(string,sizeof(string),"Das Auto NR[%i] wurde für %s erstellt",i,pIDname);
- SendClientMessageToAll(RED,string);
- saveCarToDB(playerid,i);
- print("Createfcar in schleife ende");
- return 1;
- }
- return 1;
- }
- public frakcarSavedToDB(carid)
- {
- cInfo[carid][db_id]= cache_insert_id(dbhandle);
- return 1;
- }
- saveFrakCarToDB(playerid,carid)
- {
- new query[512];
- format(query,sizeof(query),"INSERT INTO frakcars (fraktion,model,x,y,z,r,color1,color2) VALUES ('%s','%i','%f','%f','%f','%f','%i','%i')",fInfo[][f_name],fInfo[carid][model],cInfo[carid][c_x],cInfo[carid][c_y],cInfo[carid][c_z],cInfo[carid][c_r],cInfo[playerid][kmstand]);
- print(query); // <--- diese Zeile
- print("Fcar Speicherung");
- mysql_function_query(dbhandle,query,true,"FrakcarSavedToDB","i",carid);
- return 1;
- }
- //ERROR ZEILEN
- fInfo[MAX_FRAKS][c_x]=x;
- fInfo[][c_y]=y;
- fInfo[][c_z]=z;
- fInfo[][c_r]=r;
- fInfo[][model]=modelid;
- fInfo[][id_x] = CreateVehicle(modelid,x,y,z,r,color1,color2,-1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement