gallexme / LuaPlugin-GTAV

20 stars 13 forks source link

No support for pointers #4

Closed Lynxaa closed 9 years ago

Lynxaa commented 9 years ago

Can you add support for pointers please?

gallexme commented 9 years ago

give me a example where they are not supported all pointers should be returned already

gallexme commented 9 years ago

any news?

Alan-FGR commented 9 years ago

Hello there headscript (I guess it's you). I can confirm that pointers are working properly.

gallexme commented 9 years ago

yep its me ok then i can close this issue

Lynxaa commented 9 years ago
local vehOut = select(2, PED.GET_PED_NEARBY_VEHICLES(PLAYER.PLAYER_PED_ID(), 0));
print(vehOut);

http://www.dev-c.com/nativedb/func/info/cff869cbfa210d82

This has 0 support. It simply returns the number of the closest vehicles, where as in C++ it returns the offsets in an array.

    local vehOut = 0;
    PED.GET_PED_NEARBY_VEHICLES(PLAYER.PLAYER_PED_ID(), vehOut);
    print(vehOut);

I need to use the select function as the code above doesn't work at all (It's always 0)

This problem isn't just for this particular native, it's throughout a majority of natives that require pointers for similar tasks.

gallexme commented 9 years ago

try that

local Table,Count = PED.GET_PED_NEARBY_VEHICLES(playerPed, 0)
for k,vehicle in ipairs(Table) do
        VEHICLE.SET_VEHICLE_NUMBER_PLATE_TEXT(vehicle, "HAX") 
end
Lynxaa commented 9 years ago

It would seem that I'm slightly brain dead. Thanks, that worked.