Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
#define MAX_DB_OBJS 800 #define DIALOG_OBJS 5450 #define DIALOG_RAMP_OBJS DIALOG_OBJS + 1 #define DIALOG_ROAD_OBJS DIALOG_OBJS + 2 #define DIALOG_ARROW_OBJS DIALOG_OBJS + 3 #define DIALOG_SKYDIVE_OBJS DIALOG_OBJS + 4 #define DIALOG_TUBE_OBJS DIALOG_OBJS + 5 #define DIALOG_MISC_OBJS DIALOG_OBJS + 6 #define DIALOG_LIGHT_OBJS DIALOG_OBJS + 7 #define DIALOG_NEON_OBJS DIALOG_OBJS + 8 #define DIALOG_CREATE_OBJS DIALOG_OBJS + 9 #define DIALOG_MAP_OBJS DIALOG_OBJS + 10 #define DIALOG_BREAK_OBJS DIALOG_OBJS + 11 enum E_DB_OBJ { E_DB_OBJ_DB_ID, E_DB_OBJ_MODEL, Float:E_DB_OBJ_X, Float:E_DB_OBJ_Y, Float:E_DB_OBJ_Z, Float:E_DB_OBJ_RX, Float:E_DB_OBJ_RY, Float:E_DB_OBJ_RZ } new gDBObjs[MAX_DB_OBJS][E_DB_OBJ]; enum E_DB_OBJ_LIST { E_DB_OBJ_LIST_MODEL_ID, E_DB_OBJ_LIST_NAME[64] } //ramps list //done new gRampObjsList[][E_DB_OBJ_LIST] = { {18778, "Ramp T1"}, {18779, "Ramp T2"}, {18780, "Ramp T3"}, {19005, "Ramp T4"}, {18783, "Fun Box Top"}, {18784, "Fun Box Ramp 1"}, {18785, "Fun Box Ramp 2"}, {18786, "Fun Box Ramp 3"}, {18787, "Fun Box Ramp 4"}, {13593, "Kick Ramp"}, {13604, "Kick Ramp 2"}, {13641, "Kick Ramp 3 w/Loop"}, {13645, "Kick Ramp 4"}, {18781, "Big Mesh Ramp"}, {18782, "Cookie Ramp"}, {18862, "Garbage Pile Ramp"}, {13639, "Ramp Parse"}, {1245, "Wood w/Box Ramp"}, {1503, "Wood w/Box Ramp 2"}, {13646, "Ramp Landing Pad"}, {13649, "Ramp Landing Pad 2"}, {18847, "Huge Half Pipe 1"}, {18859, "Quarter Pipe 1"}, {19002, "Fire Hoop 1"}, {18858, "Foam Hoop 1"}, {19001, "VC Wide Loop 1"}, {18882, "Huge Bowl 1"}, {18883, "Huge Bowl 2"}, {18884, "Huge Bowl 3"}, {13666, "Loop Big"} }; //Tubes list //done new gTubeObjsList[][E_DB_OBJ_LIST] = { {18997, "1m"}, {18995, "5m"}, {18996, "5m 45 Bend"}, {18992, "10m 45 Bend"}, {18993, "10m 90 Bend"}, {18994, "10m 180 Bend"}, {18987, "25m"}, {18988, "25m Cut End"}, {18989, "25m 45 Bend"}, {18990, "25m 90 Bend"}, {18991, "25m 180 Bend"}, {18808, "50m"}, {18809, "50m Glass"}, {18810, "50m Bulge"}, {18811, "50m Glass Bulge"}, {18813, "50m Glass Funnel"}, {18812, "50m Funnel 1"}, {18814, "50m Funnel 2"}, {18815, "50m Funnel 3"}, {18816, "50m Funnel 4"}, {18817, "50m TSection"}, {18818, "50m Glass"}, {18819, "50m Plus"}, {18820, "50m Glass Plus"}, {18821, "50m 45 Bend"}, {18822, "50m Glass 45 Bend"}, {18823, "50m 90 Bend 1"}, {18824, "50m Glass 90 Bend"}, {18825, "50m 180 Bend"}, {18826, "50m Glass 180 Bend"}, {18852, "100m "}, {18827, "100m 2"}, {18982, "100m 3"}, {18983, "100m 4"}, {18984, "100m 5"}, {18985, "100m 6"}, {18853, "100m 45 Bend"}, {18854, "100m 90 Bend"}, {18855, "100m 180 Bend"}, {18998, "200m"}, {18999, "200m Bendy"}, {19000, "200m Bulge"}, {18851, "Tube To Road"}, {18986, "Tube To Pipe"}, {18828, "Spiral"}, {18829, "R Texture"}, {18830, "R Texture bridge"}, {18831, "RT 25m Bend 90"}, {18832, "RT 25m Bend 180"}, {18833, "RT 50m Bend 45"}, {18834, "RT 50m Bend 180"}, {18835, "RB Funnel"}, {18836, "RB Halfpipe"}, {18837, "RB 25m Bend 90"}, {18838, "RB 25m Bend 180"}, {18839, "RB 50m Bend 45"}, {18840, "RB 50m Bend 90"}, {18841, "RB 50m Bend 180"}, {18842, "RB 50m"} }; //Skydiving list //done new gSkyDiveObjsList[][E_DB_OBJ_LIST] = { {18768, "SkyDive Platform 1"}, {18769, "SkyDive Platform 1a"}, {18770, "SkyDive Platform 1b"}, {18881, "SkyDive Platform 2"}, {3108, "Base Jump Target"}, {18850, "Heli Pad "} }; //Arrow list //done new gArrowObjsList[][E_DB_OBJ_LIST] = { {1318, "Arrow Type 0"}, {19130, "Arrow Type 1"}, {19131, "Arrow Type 2"}, {19132, "Arrow Type 3"}, {19133, "Arrow Type 4"}, {19134, "Arrow Type 5"}, {19135, "EnEx Marker 1"}, {19197, "EnEx Marker 2"}, {19198, "EnEx Marker 3"} }; //roadwork list //done new gRoadObjsList[][E_DB_OBJ_LIST] = { {1237, "Oarnge Barral"}, {1238, "Traffic Cone"}, {1282, "Small Road Block"}, {1427, "Small Road Block 2"}, {1459, "Small Road Block 3"}, {1422, "Road Block"}, {1423, "Road Block 2"}, {1424, "Road Block 3"}, {1425, "Detour Sign"}, {19467, "vehicle barrier"} }; //Misc list //done new gMiscObjsList[][E_DB_OBJ_LIST] = { {19086, "Chainsaw Dildo"}, {19128, "Dance Floor 1"}, {19129, "Dance Floor 2"}, {18771, "Spiral Stairs"}, {18850, "HeliPad 1"}, {19273, "Keypad Non Dynamic"}, {18861, "scaffoldlift"}, {18880, "SpeedCamera"}, {18885, "Gun Vending Machine"}, {19425, "Speed Bump"}, {19278,"LiftPlatform1"}, {2780, "Smoke Machine"}, {19470, "For Sale 1"}, {19471, "For Sale 2"} }; //Spotlight list //done new gLightObjsList[][E_DB_OBJ_LIST] = { {19143, "Pin SpotLight 1"}, {19144, "Pin SpotLight 2"}, {19145, "Pin SpotLight 3"}, {19146, "Pin SpotLight 4"}, {19147, "Pin SpotLight 5"}, {19148, "Pin SpotLight 6"}, {19149, "Pin SpotLight 7"}, {19150, "Pin SpotLight 8"}, {19151, "Pin SpotLight 9"}, {19152, "Pin SpotLight 10"}, {19153, "Pin SpotLight 11"}, {19154, "Pin SpotLight 12"}, {19155, "Pin SpotLight 13"}, {19156, "Pin SpotLight 14"}, {18656, "Beam White"}, {18657, "Beam Red"}, {18658, "Beam Blue"}, {18643, "Laser Red"}, {19080, "Laser Blue"}, {19081, "Laser Purple"}, {19082, "Laser Orange"}, {19083, "Laser Green"}, {19084, "Laser Yellow"}, {19121, "Bollard White"}, {19122, "Bollard Blue"}, {19123, "Bollard Green"}, {19124, "Bollard Red"}, {19125, "Bollard Yellow"}, {19126, "Bollard Light Blue"}, {19127, "Bollard Pink"} }; //Neon list //done new gNeonObjsList[][E_DB_OBJ_LIST] = { {9123, "Tunnel"}, {18647, "Red Tube"}, {18648, "Blue Tube"}, {18649, "Green Tube"}, {18650, "Yellow Tube"}, {18651, "Pink Tube"}, {18652, "White Tube"}, {7097, "vRock"}, {9125, "Lxor"}, {9129, "Pirate"} }; //Misc list //done new gMapObjsList[][E_DB_OBJ_LIST] = { {19164, "Map 1"}, {19165, "Map 2"}, {19166, "Map 3"}, {19167, "Map 4"}, {19168, "Map 5"}, {19169, "Map 6"}, {19170, "Map 7"}, {19171, "Map 8"} }; //glass list //done new gBreakableObjsList[][E_DB_OBJ_LIST] = { {1517, "Bar Bottle"}, {19818, "Wine Glass"}, {19819, "Martini Glass"}, {19820, "Glass Bottle"}, {19821, "Glass Bottle"}, {19822, "Glass Bottle"}, {19823, "Glass Bottle"}, {19824, "Glass Bottle"}, {19570, "Milk Jar"} }; /* //glass list //done new gPoliceObjsList[][E_DB_OBJ_LIST] = { {19797, "Police Light Visor"}, {19834, "Police Line Tape"}, {18646, "Police Light (Single Red)"}, {19419, "Police Light Bar (on)"}, {19420, "Police Light Bar (off)"}, {19620, "Police Light Bar"} }; */ stock ShowCreateBreakableDialog(playerid) { new strDialog[1024]; for (new i=0,len = sizeof(gBreakableObjsList);i<len;i++){ if (i==0) format(strDialog, sizeof (strDialog), "%s", gBreakableObjsList[i][E_DB_OBJ_LIST_NAME]); else format(strDialog, sizeof (strDialog), "%s\n%s", strDialog, gBreakableObjsList[i][E_DB_OBJ_LIST_NAME]); } return ShowPlayerDialog(playerid,DIALOG_BREAK_OBJS,DIALOG_STYLE_LIST,"Select A Map Obj",strDialog,"Ok","Cancel"); } stock ShowCreateMapDialog(playerid) { new strDialog[1024]; for (new i=0,len = sizeof(gMapObjsList);i<len;i++){ if (i==0) format(strDialog, sizeof (strDialog), "%s", gMapObjsList[i][E_DB_OBJ_LIST_NAME]); else format(strDialog, sizeof (strDialog), "%s\n%s", strDialog, gMapObjsList[i][E_DB_OBJ_LIST_NAME]); } return ShowPlayerDialog(playerid,DIALOG_MAP_OBJS,DIALOG_STYLE_LIST,"Select A Map Obj",strDialog,"Ok","Cancel"); } stock ShowCreateLightDialog(playerid) { new strDialog[1024]; for (new i=0,len = sizeof(gLightObjsList);i<len;i++){ if (i==0) format(strDialog, sizeof (strDialog), "%s", gLightObjsList[i][E_DB_OBJ_LIST_NAME]); else format(strDialog, sizeof (strDialog), "%s\n%s", strDialog, gLightObjsList[i][E_DB_OBJ_LIST_NAME]); } return ShowPlayerDialog(playerid,DIALOG_LIGHT_OBJS,DIALOG_STYLE_LIST,"Select A Light Obj",strDialog,"Ok","Cancel"); } stock ShowCreateMiscDialog(playerid) { new strDialog[1024]; for (new i=0,len = sizeof(gMiscObjsList);i<len;i++){ if (i==0) format(strDialog, sizeof (strDialog), "%s", gMiscObjsList[i][E_DB_OBJ_LIST_NAME]); else format(strDialog, sizeof (strDialog), "%s\n%s", strDialog, gMiscObjsList[i][E_DB_OBJ_LIST_NAME]); } return ShowPlayerDialog(playerid,DIALOG_MISC_OBJS,DIALOG_STYLE_LIST,"Select A Misc Obj",strDialog,"Ok","Cancel"); } stock ShowCreateArrowDialog(playerid) { new strDialog[1024]; for (new i=0,len = sizeof(gArrowObjsList);i<len;i++){ if (i==0) format(strDialog, sizeof (strDialog), "%s", gArrowObjsList[i][E_DB_OBJ_LIST_NAME]); else format(strDialog, sizeof (strDialog), "%s\n%s", strDialog, gArrowObjsList[i][E_DB_OBJ_LIST_NAME]); } return ShowPlayerDialog(playerid,DIALOG_ARROW_OBJS,DIALOG_STYLE_LIST,"Select A Arrow Obj",strDialog,"Ok","Cancel"); } stock ShowCreateSkyDiveDialog(playerid) { new strDialog[1024]; for (new i=0,len = sizeof(gSkyDiveObjsList);i<len;i++){ if (i==0) format(strDialog, sizeof (strDialog), "%s", gSkyDiveObjsList[i][E_DB_OBJ_LIST_NAME]); else format(strDialog, sizeof (strDialog), "%s\n%s", strDialog, gSkyDiveObjsList[i][E_DB_OBJ_LIST_NAME]); } return ShowPlayerDialog(playerid,DIALOG_SKYDIVE_OBJS,DIALOG_STYLE_LIST,"Select A SkyDive Obj",strDialog,"Ok","Cancel"); } stock ShowCreateTubeDialog(playerid) { new strDialog[1024]; for (new i=0,len = sizeof(gTubeObjsList);i<len;i++){ if (i==0) format(strDialog, sizeof (strDialog), "%s", gTubeObjsList[i][E_DB_OBJ_LIST_NAME]); else format(strDialog, sizeof (strDialog), "%s\n%s", strDialog, gTubeObjsList[i][E_DB_OBJ_LIST_NAME]); } return ShowPlayerDialog(playerid,DIALOG_TUBE_OBJS,DIALOG_STYLE_LIST,"Select A Tube",strDialog,"Ok","Cancel"); } stock ShowCreateRampDialog(playerid) { new strDialog[1024]; for (new i=0,len = sizeof(gRampObjsList);i<len;i++){ if (i==0) format(strDialog, sizeof (strDialog), "%s", gRampObjsList[i][E_DB_OBJ_LIST_NAME]); else format(strDialog, sizeof (strDialog), "%s\n%s", strDialog, gRampObjsList[i][E_DB_OBJ_LIST_NAME]); } return ShowPlayerDialog(playerid,DIALOG_RAMP_OBJS,DIALOG_STYLE_LIST,"Select A Ramp",strDialog,"Ok","Cancel"); } stock ShowCreateRoadWorkDialog(playerid) { new strDialog[1024]; for (new i=0,len = sizeof(gRoadObjsList);i<len;i++){ if (i==0) format(strDialog, sizeof (strDialog), "%s", gRoadObjsList[i][E_DB_OBJ_LIST_NAME]); else format(strDialog, sizeof (strDialog), "%s\n%s", strDialog, gRoadObjsList[i][E_DB_OBJ_LIST_NAME]); } return ShowPlayerDialog(playerid,DIALOG_ROAD_OBJS,DIALOG_STYLE_LIST,"Select A Road Object",strDialog,"Ok","Cancel"); } stock ShowCreateNeonDialog(playerid) { new strDialog[1024]; for (new i=0,len = sizeof(gNeonObjsList);i<len;i++){ if (i==0) format(strDialog, sizeof (strDialog), "%s", gNeonObjsList[i][E_DB_OBJ_LIST_NAME]); else format(strDialog, sizeof (strDialog), "%s\n%s", strDialog, gNeonObjsList[i][E_DB_OBJ_LIST_NAME]); } return ShowPlayerDialog(playerid,DIALOG_NEON_OBJS,DIALOG_STYLE_LIST,"Select A Neon Obj",strDialog,"Ok","Cancel"); } new strCObjDialog[1024]; stock ShowCreateObjDialog(playerid) { if(strCObjDialog[0]==EOS) { format ( strCObjDialog, sizeof(strCObjDialog), "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s", "RoadWork", "Ramp", "Tube", "SkyDive", "Arrow", "Light", "Neon", "Misc", "Maps", "Glass' Bottles", "Select Obj", "Select Closest Obj" ); } return ShowPlayerDialog(playerid,DIALOG_CREATE_OBJS,DIALOG_STYLE_LIST,"Select A Object Type",strCObjDialog,"Ok","Cancel"); } YCMD:cbreakable(playerid, params[], help) { #pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/cBreakable : create a Breakable object");} else {ShowCreateBreakableDialog(playerid);} return 1; } YCMD:cmap(playerid, params[], help) { #pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/cMap : create a Map object");} else {ShowCreateMapDialog(playerid);} return 1; } YCMD:cneon(playerid, params[], help) { #pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/cNeon : create a Neon object");} else {ShowCreateNeonDialog(playerid);} return 1; } YCMD:clight(playerid, params[], help) { #pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/cLight : create a Light object");} else {ShowCreateLightDialog(playerid);} return 1; } YCMD:cmisc(playerid, params[], help) { #pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/cMisc : create a Misc object");} else {ShowCreateMiscDialog(playerid);} return 1; } YCMD:carrow(playerid, params[], help) { #pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/cArrow : create a Arrow object");} else {ShowCreateArrowDialog(playerid);} return 1; } YCMD:cskydive(playerid, params[], help) { #pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/cSkyDive : create a SkyDive object");} else {ShowCreateSkyDiveDialog(playerid);} return 1; } YCMD:ctube(playerid, params[], help) { #pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/cTube : create a Tube object");} else {ShowCreateTubeDialog(playerid);} return 1; } YCMD:cramp(playerid, params[], help) { #pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/cRamp : create a ramp object");} else {ShowCreateRampDialog(playerid);} return 1; } YCMD:croadwork(playerid, params[], help) { #pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/cRoadWork : create a Road Work object");} else {ShowCreateRoadWorkDialog(playerid);} return 1; } YCMD:cobj(playerid, params[], help) { #pragma unused params /* new strOut[128]; format ( strOut, sizeof(strOut), "%s %s %s %s %s %s %s %s %s %s", "/cRoadWork", "/cRamp", "/cTube", "/cSkyDive", "/cArrow", "/cLight", "/cNeon", "/cMisc", "/sobj", "/scobj" ); SendClientMessage(playerid, 0xFF9933FF, strOut); */ if (help) {SendClientMessage(playerid, 0xFF9933FF, "/cobj : creates / edits an object");} else {ShowCreateObjDialog(playerid);} return 1; } YCMD:sobj(playerid, params[], help) { #pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/sobj : select an object to edit");} else { SelectObject(playerid); SendClientMessage(playerid, 0xFF9933FF, "SERVER: Please select the object you'd like to edit!"); } return 1; } YCMD:scloseobj(playerid, params[], help) { #pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/scloseobj [range : default 25.0]: selects an object close to you to edit");} else { new Float:selRange; if (sscanf(params, "f",selRange)) selRange = 25.0; new closeObj = GetClosestObject(playerid,selRange); dprintf("Closest obj to edit %i",closeObj); if (closeObj) { EditObject(playerid, closeObj); SendClientMessage(playerid, 0xFF9933FF, "SERVER: You are now editing the closest obj to you."); } else { SendClientMessage(playerid, 0xFF9933FF, "SERVER: No Object found close to you, try getting closer to the obj your trying to edit. or use the range param"); SendClientMessage(playerid, 0xFF9933FF, "/scloseobj [range : default 25.0]: selects an object close to you to edit"); } } return 1; } /* //objects!!!!!! YCMD:cobj(playerid, params[], help) { //#pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/cobj : create an obj");} else { ShowCreateRampDialog(playerid); } return 1; } */ stock GetClosestObject(playerid, Float:range = 25.0) { new Float:dist, Float:cdist=FLOAT_INFINITY, cobj=0; for(new i=0; i < MAX_DB_OBJS; i++) { if(gDBObjs[i][E_DB_OBJ_MODEL]) { dist = GetPlayerDistanceFromPoint ( playerid, gDBObjs[i][E_DB_OBJ_X], gDBObjs[i][E_DB_OBJ_Y], gDBObjs[i][E_DB_OBJ_Z] ); if(dist < cdist) { cdist = dist; cobj = i; } } } if (cdist < range) return cobj; return 0; } stock CreateObjDBTable(DB:db) { CreateDbTable ( db, //database ref "OBJS", //table name true, //create an index field (ID) //table fields "MODEL", "X", "Y", "Z", "RX", "RY", "RZ" ); return 1; } stock DeleteObjFromDB (DB:db, objectid) { new Query[256]; format(Query, sizeof(Query), "DELETE FROM OBJS WHERE ID=%i", gDBObjs[objectid][E_DB_OBJ_DB_ID]); db_query(db, Query); dprint(Query); gDBObjs[objectid][E_DB_OBJ_DB_ID] = 0; gDBObjs[objectid][E_DB_OBJ_MODEL] = 0; gDBObjs[objectid][E_DB_OBJ_X] = 0.0; gDBObjs[objectid][E_DB_OBJ_Y] = 0.0; gDBObjs[objectid][E_DB_OBJ_Z] = 0.0; gDBObjs[objectid][E_DB_OBJ_RX] = 0.0; gDBObjs[objectid][E_DB_OBJ_RY] = 0.0; gDBObjs[objectid][E_DB_OBJ_RZ] = 0.0; dprint("obj DELETED FROM db"); return 1; } stock AddObjToDB (DB:db, objectid) { new Query[256], Query_Values[128], DBResult:Result, str[10]; format ( Query_Values, sizeof(Query_Values), "'%i','%f','%f','%f','%f','%f','%f'", gDBObjs[objectid][E_DB_OBJ_MODEL], gDBObjs[objectid][E_DB_OBJ_X], gDBObjs[objectid][E_DB_OBJ_Y], gDBObjs[objectid][E_DB_OBJ_Z], gDBObjs[objectid][E_DB_OBJ_RX], gDBObjs[objectid][E_DB_OBJ_RY], gDBObjs[objectid][E_DB_OBJ_RZ] ); format(Query, sizeof(Query), "INSERT INTO OBJS (`MODEL`,`X`, `Y`, `Z`, `RX`, `RY`, `RZ`) VALUES(%s)", Query_Values); dprint(Query); db_query(db, Query); Result = db_query(db, "SELECT `ID` FROM `OBJS` ORDER BY `ID` DESC LIMIT 1"); db_get_field_assoc(Result,"ID",str,sizeof(str)); db_free_result(Result); gDBObjs[objectid][E_DB_OBJ_DB_ID] = strval(str); dprint("obj added to db"); return 1; } stock UpdateObjToDB (DB:db, objectid) { new str_Query[1024]; format( str_Query, sizeof(str_Query), "UPDATE `OBJS` SET `MODEL`='%i', `X`='%f', `Y`='%f', `Z`='%f', `RX`='%f', `RY`='%f', `RZ`='%f' WHERE `ID`=%i", gDBObjs[objectid][E_DB_OBJ_MODEL], gDBObjs[objectid][E_DB_OBJ_X], gDBObjs[objectid][E_DB_OBJ_Y], gDBObjs[objectid][E_DB_OBJ_Z], gDBObjs[objectid][E_DB_OBJ_RX], gDBObjs[objectid][E_DB_OBJ_RY], gDBObjs[objectid][E_DB_OBJ_RZ], gDBObjs[objectid][E_DB_OBJ_DB_ID] ); db_query(db,str_Query); dprint(str_Query); return 1; } forward LoadObjsDb(DB:db); public LoadObjsDb(DB:db) { new DBResult:Result, mLoaded ; Result = db_query( db, "SELECT * FROM `OBJS`" ); for(new a,r=db_num_rows(Result);a<r;a++) { new str[256],str2[128]; db_get_field_assoc(Result,"ID",str2,sizeof(str2)); strcat(str,str2); strcat(str," "); db_get_field_assoc(Result,"MODEL",str2,sizeof(str2)); strcat(str,str2); strcat(str," "); db_get_field_assoc(Result,"X",str2,sizeof(str2)); strcat(str,str2); strcat(str," "); db_get_field_assoc(Result,"Y",str2,sizeof(str2)); strcat(str,str2); strcat(str," "); db_get_field_assoc(Result,"Z",str2,sizeof(str2)); strcat(str,str2); strcat(str," "); db_get_field_assoc(Result,"RX",str2,sizeof(str2)); strcat(str,str2); strcat(str," "); db_get_field_assoc(Result,"RY",str2,sizeof(str2)); strcat(str,str2); strcat(str," "); db_get_field_assoc(Result,"RZ",str2,sizeof(str2)); strcat(str,str2); if(!sscanf( str, "iiffffff", gDBObjs[0][E_DB_OBJ_DB_ID], gDBObjs[0][E_DB_OBJ_MODEL], gDBObjs[0][E_DB_OBJ_X], gDBObjs[0][E_DB_OBJ_Y], gDBObjs[0][E_DB_OBJ_Z], gDBObjs[0][E_DB_OBJ_RX], gDBObjs[0][E_DB_OBJ_RY], gDBObjs[0][E_DB_OBJ_RZ] )) { mLoaded++; new objectid = CreateObject ( gDBObjs[0][E_DB_OBJ_MODEL], gDBObjs[0][E_DB_OBJ_X], gDBObjs[0][E_DB_OBJ_Y], gDBObjs[0][E_DB_OBJ_Z], gDBObjs[0][E_DB_OBJ_RX], gDBObjs[0][E_DB_OBJ_RY], gDBObjs[0][E_DB_OBJ_RZ] ); sscanf( str, "iiffffff", gDBObjs[objectid][E_DB_OBJ_DB_ID], gDBObjs[objectid][E_DB_OBJ_MODEL], gDBObjs[objectid][E_DB_OBJ_X], gDBObjs[objectid][E_DB_OBJ_Y], gDBObjs[objectid][E_DB_OBJ_Z], gDBObjs[objectid][E_DB_OBJ_RX], gDBObjs[objectid][E_DB_OBJ_RY], gDBObjs[objectid][E_DB_OBJ_RZ] ); } db_next_row(Result); } db_free_result(Result); printf("Loaded %d Objects from: database",mLoaded); return 1; } /* YCMD:mobj(playerid, params[], help) { //#pragma unused params if (help) {SendClientMessage(playerid, 0xFF9933FF, "/mobj [objId][text] : ");} else { new objectid,strIn[128]; if (sscanf(params,"is[128]",objectid,strIn)) return SendClientMessage(playerid, 0xFF9933FF, "/mobj [objId][text] : "); if (!IsValidObject(objectid)) return SendClientMessage(playerid, 0xFF9933FF, "/mobj [objId][text] : Invalid objId"); //new myobject = CreateObject(19353, 0, 0, 10, 0.0, 0.0, 90.0); //create the object SetObjectMaterialText ( objectid, strIn, 0, OBJECT_MATERIAL_SIZE_512x512 , "Arial", 28, 0, 0xFFFF8200, //argb 0xFF000000, //argb OBJECT_MATERIAL_TEXT_ALIGN_CENTER ); new strOut[128]; format(strOut,128,"ObjID (%i) mat updated",objectid); SendClientMessage(playerid, 0xFF9933FF, strOut); } return 1; } */ //----------------------------------------------------------------------------------------------------- /* native CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0); native DestroyDynamicObject(objectid); native IsValidDynamicObject(objectid); native SetDynamicObjectPos(objectid, Float:x, Float:y, Float:z); native GetDynamicObjectPos(objectid, &Float:x, &Float:y, &Float:z); native SetDynamicObjectRot(objectid, Float:rx, Float:ry, Float:rz); native GetDynamicObjectRot(objectid, &Float:rx, &Float:ry, &Float:rz); native MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed); native StopDynamicObject(objectid); native DestroyAllDynamicObjects(); native CountDynamicObjects(); */ //For more info on ALS Hooking check //http://forum.sa-mp.com/showthread.php?t=85907 /* static gOBJS_HasCB[1]; //--------------OnGameModeInit Hook------------------- public OnGameModeInit() { //your OnGameModeInit pre code here //function hook checks gOBJS_HasCB[0] = funcidx("OBJS_OnPlayerEditObject") != -1; if (funcidx("OBJS_OnGameModeInit") != -1) { return CallLocalFunction("OBJS_OnGameModeInit", ""); } //your OnGameModeInit post code here return 1; } #if defined _ALS_OnGameModeInit #undef OnGameModeInit #else #define _ALS_OnGameModeInit #endif #define OnGameModeInit OBJS_OnGameModeInit forward OBJS_OnGameModeInit(); //--------------OnPlayerEditObject Hook------------------- public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ) { new strOut[128]; if(!IsValidObject(objectid)) return 0; if(!playerobject) // If this is a global object, move it for other players { MoveObject(objectid, fX, fY, fZ, 100.0); } if(response == EDIT_RESPONSE_FINAL) { // Do anything here to save (or revert) the updated object position format ( strOut, 128, "Object Saved, objid(%i) x(%.02f) y(%.02f) z(%.02f) rx(%.02f) ry(%.02f) rz(%.02f)", objectid, fX, fY, fZ, fRotX, fRotY, fRotZ ); SendClientMessage(playerid,-1,strOut); // (optional) put them back in selection mode after they click save //SelectObject(playerid); } if (response == EDIT_RESPONSE_CANCEL) { DestroyObject(objectid); } // if (gOBJS_HasCB[0]) { return CallLocalFunction("OBJS_OnPlayerEditObject", "iiiiffffff",playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ); } return 1; } #if defined _ALS_OnPlayerEditObject #undef OnPlayerEditObject #else #define _ALS_OnPlayerEditObject #endif #define OnPlayerEditObject OBJS_OnPlayerEditObject forward OBJS_OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ); */
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
⭐ Free ETH Method ⭐
JavaScript | 4 sec ago | 0.26 KB
ChangeNOW Exploit
JavaScript | 9 sec ago | 0.26 KB
Profit Method
JavaScript | 17 sec ago | 0.26 KB
ChangeNOW Bug (Get more on BTC swaps)
JavaScript | 21 sec ago | 0.26 KB
Swapzone Glitch ⭐Working⭐
JavaScript | 26 sec ago | 0.26 KB
Exchange Exploit
JavaScript | 30 sec ago | 0.26 KB
Free Crypto Method (NEVER SEEN BEFORE)
JavaScript | 46 sec ago | 0.26 KB
✅ MAKE $900 INSTANTLY
JavaScript | 52 sec ago | 0.26 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!