Posts: 721
Threads: 25
Joined: Nov 2007
Reputation:
0
You mean replacing the IsPlayerConnected(playerid) check with pInfo[playerid][pLoggedIn] check, yeah you could do that. But it's nowhere near efficient. There's no point in doing it. Just keep using IsPlayerConnected.
Posts: 2,856
Threads: 6
Joined: Jun 2007
Reputation:
0
array calls are faster than a native function call
But this can only be used if every needs to log in
And than use bool for a flag (false / true)
At least dont forget to set it to false again in OnPlayerDisconnect
Posts: 106
Threads: 39
Joined: Jun 2010
Reputation:
0
I'm still not satisfied with the two answers.
Can someone give me a detailed answer?
Posts: 2,421
Threads: 52
Joined: Mar 2009
Reputation:
0
Like nero said getting a value from a variable will always be faster than calling functions. Functions (most of em) do checks then (in this case) return a value. Using a var would cut the checks out, and get the value straight away. Though i dont know how OnPlayerConnect works internally.
Just use what you preffer it wont realy make a difference (just a small one) anyway.
Posts: 106
Threads: 39
Joined: Jun 2010
Reputation:
0
I really want to know did the IsPlayerConnected run