I cant even describe this problem. So here is what i do.
local cp= createCheckpoin(params)
table.insert(checkPoints,cp)
now, “cp” should be the checkpoint entity, however its just a number. How can i add the Entity itself to the table, so i can access it later?
now in table checkPoints the first value is 1. It should be the cp entity.
I know that, it was just an example that i mystyped.
local CP = CreateCheckpoint(1,checkPoints[number],checkPoints[number+1],checkPoints[number+2],checkPoints[number+3],checkPoints[number+4],checkPoints[number+5],10.0,255,0,0,120)
table.insert(cpTable,CP)
Citizen.Trace(CP)
This is the actual code, where CP is just a random “1” number. It should contain the CheckPoint entity.