Hello, Im pretty curious about arrays like this
PHP Code:
new something[256]
now there is
PHP Code:
new something[4] // lets do small array for example, i ofcourse prefer always the big ones :)
public myfunction(pos, value)
{
something[pos] = value
}
is it same like this?
PHP Code:
new something0,something1,something2,something3
public myfunction(pos, value)
{
switch(pos)
{
case 0: something0 = value
case 1: something1 = value
case 2: something2 = value
case 3: something3 = value
}
}
the way i understand things right now is that the first code is better and faster way and it does not matter if the array size is big or small, it does not effect the cpu speed.
I was an idea for creating big array like this Float:chuckdata[8000][3]
so inside of chuckdata are costom areas ( values are in bit )
so i can just easily check that if player is in costom area
PHP Code:
static Float:o[3],a, b
pev(id, pev_origin, o)
for( a = 0; a < 3; a++ )
{
b = floatround(o[a] + 4000.0)
// i dont know that if its right, i dont know about bits, never tested them and i was thinking that they are useless what is very wrong. I want to check here like if( o[a] != mybit) you know what i mean with that... :)
if( chuckdata[b][a] ~ mybit) return
}
// and now if cpu is here then player is standing in area what is in my database.
// i need to use bits because then i can but more than one areas in one place for example ( and also if area is inside of ohter area, bits will help me. )
2years ago i didn't care about coding methods for example it was fine to me to check what weapon player is holding in prethink. If that was working then it was just fine to me but now i want that everything is perfect.
I hope i can get some feedback ( my "string checking in prethink" topic is like an empty desert : /)
Thanks!