Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new bool:Admin[MAX_PLAYERS];
- new JobVehicle[MAX_VEHICLES];
- public OnGameModeInit()
- {
- LoadJobVeh();
- /// Tolimesni Jūsų veiksmai...
- return 1;
- }
- CMD:cjv(playerid,params[])
- {
- new vehtype,vehlcol1,vehcol2,jobid;
- if(sscanf(params,"dddd",vehtype,vehlcol1,vehcol2,jobid)) return SendClientMessage(playerid,0xffff00AA,"Sukurti darbo transportą :{ffffff} /cjv [ModelioID][Spalva1][Spalva2][DarboID]");
- new Float:posX,Float:posY,Float:posZ,Float:posR;
- GetPlayerPos(playerid,posX,posY,posZ);
- GetPlayerFacingAngle(playerid,posR);
- CreateJobCar(vehtype,posX,posY,posZ,posR,vehlcol1,vehcol2,600,jobid);
- new q[224];
- format(q,224,"INSERT INTO JobVehicles(pos_x,pos_y,pos_z,pos_r,Color1,Color2,JID,VehID) VALUES('%f','%f','%f','%f','%d','%d','%d','%d')",posX,posY,posZ,posR,vehlcol1,vehcol2,jobid,vehtype);
- mysql_query(q);
- SendClientMessage(playerid,-1,"* Sėkmgingai sukūrėte transporto priemonę");
- return 1;
- }
- stock LoadJobVeh()
- {
- new Float:posX,Float:posY,Float:posZ,Float:posR,color1,color2,jidas,vidas,result[30];
- mysql_query("SELECT pos_x,pos_y,pos_z,pos_r,Color1,Color2,JID,VehID FROM JobVehicles");
- mysql_store_result();
- while(mysql_retrieve_row())
- {
- mysql_fetch_field_row( result, "pos_x" );
- posX = floatstr( result );
- mysql_fetch_field_row( result, "pos_y" );
- posY = floatstr( result );
- mysql_fetch_field_row( result, "pos_z" );
- posZ = floatstr( result );
- mysql_fetch_field_row( result, "pos_r" );
- posR = floatstr( result );
- mysql_fetch_field_row(result,"Color1");
- color1 = strval(result);
- mysql_fetch_field_row(result,"Color2");
- color2 = strval(result);
- mysql_fetch_field_row(result,"JID");
- jidas = strval(result);
- mysql_fetch_field_row(result,"VehID");
- vidas = strval(result);
- CreateJobCar(vidas,posX,posY,posZ,posR,color1,color2,jidas);
- }
- }
- stock CreateJobCar(modelid,Float:x,Float:y,Float:z,Float:rotation,color1,color2,jobid)
- {
- new dtransportas = CreateVehicle(modelid,Float:x,Float:y,Float:z,Float:rotation,color1,color2,600);
- JobVehicle[dtransportas] = jobid;
- return dtransportas;
- }
- //////////////////////////////////////////// DUOMENŲ BAZĖJE //////////////////////////
- /* CREATE TABLE `JobVehicles` (
- `pos_x` float NOT NULL,
- `pos_y` float NOT NULL,
- `pos_z` float NOT NULL,
- `pos_r` float NOT NULL,
- `Color1` int(4) NOT NULL,
- `Color2` int(4) NOT NULL,
- `JID` int(3) NOT NULL,
- `VehID` int(4) NOT NULL
- ) */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement