Execute opcode from c++? [SOLVED]

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
EDIT: CLOSED, THE ANSWER: https://github.com/DK22Pac/plugin-sdk - In this there is ScriptCommands example, just trace back to the origins of Command<> and you can see how it happens.

EDIT2: not closed nvm, I need to do it independently, pluginSDK has a way but it's not the way I want to do it, I want a way to do it without fully hooking in gta, I don't want to use plugin-sdk so I can't just copy over scriptcommands source from there (too much)

EDIT3: ok fuck it, I am going to get myself a alternative. lock this.

How can I execute opcodes from a exe and a dll?
Is it possible?
Or is there a exact same alternative for in CVehicle library?
07E4: get_model dimensions_cornerA_to dimensions_cornerB_to
 
Last edited:

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
nvm & bump
07E4: get_model dimensions_cornerA_to dimensions_cornerB_to
is there a alternative for this in CVehicle or CVehicleSA? maybe that can help. I've tried searching..
of the edit: I can't use plugin-sdk as I don't use it on my project.

edit: no need anymore, got an alternative. well not exactly but i collected model info from here https://wiki.sa-mp.com/wiki/GetVehicleModelInfo
and calculating it myself now.
here's the code to generate it from pawno/sa-mp script:
Code:
new File:handle = fopen("vehiclemodelinfo.txt", io_write);

	if(handle)
	{
		new Float: X, Float: Y, Float: Z, tempStr[64];
		for(new i = 400; i <= 611; i++)
		{
			printf("[VEHICLE]: [%s]  [MODEL]: [%d]", GetVehicleNameFromModelEx(i, 0), i);

			format(tempStr, sizeof tempStr, "{ // %s\r\n", GetVehicleNameFromModelEx(i, 0));
			fwrite(handle, tempStr);

			for(new iid = 1; iid <= 9; iid++)
			{
				GetVehicleModelInfo(i, iid, X, Y, Z);
				printf("[INFO]: [%d]  [X]: [%f]  [Y]: [%f]  [Z]: [%f]", iid, X, Y, Z);

				fwrite(handle, "\t{\r\n");

				format(tempStr, sizeof tempStr, "\t\t%f, %f, %f\r\n", X, Y, Z);
				fwrite(handle, tempStr);

				fwrite(handle, "\t},\r\n");
			}

			printf("\n");
			fwrite(handle, "},\r\n");
		}
	
		fclose(handle);
	}
	else
	{
		print("Failed to open file \"vehiclemodelinfo.txt\".");
	}
 
Last edited:
Top