Any faster searching method?
#1

Hello,
I made a /v command that can spawn vehicles by entering the vehicle model ID/name.
However I find that searching for the vehicle name is so slow that it freezes my server for a while.
Code for searching in my command currently:
pawn Код:
for(new i = 0;i < sizeof(vehiclename);i++)//212 vehicle names
    if(strfind(vehiclename[i],params,true) != -1) break;
I've benchmarked that code and it runs at around 1 time/ms!

Therefore I'd like to know if there's any faster method.
Reply
#2

I don't think so, you can use a vehicle dialog or only accept full names instead of part names.
And I never noticed this function is slow. So might it got another reason.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)