IsPlayerConnected problem -
Tumba - 07.05.2013
Hello, everybody!
PHP код:
PLUGIN_EXPORT void PLUGIN_CALL ProcessTick()
{
for(int i = 0;i < MAX_PLAYERS;i++)
{
if(g_Invoke->callNative(&PAWN::IsPlayerConnected,i) == 1) std::cout << i;
}
}
Why, doesnt it work
P.S. ProcessTick works
Re: IsPlayerConnected problem -
Yiin - 07.05.2013
why cout, not logprintf ?
Re: IsPlayerConnected problem -
Tumba - 07.05.2013
Quote:
Originally Posted by Yiin
why cout, not logprintf ?
|
It hasns't value.
Re: IsPlayerConnected problem -
Dan.. - 07.05.2013
Check if "g_Invoke->callNative(&PAWN::IsPlayerConnected,i)" works fine. Try using some kind of this message for debug:
Код:
logprintf("[debug] IsPlayerConnected[i = %d] = %d", i, g_Invoke->callNative(&PAWN::IsPlayerConnected,i));
Re: IsPlayerConnected problem -
Tumba - 07.05.2013
PHP код:
[17:07:42] [join] Diego_Vela has joined the server (0:127.0.0.1)
[17:07:42] [debug] IsPlayerConnected[i = 0] = 0
Re: IsPlayerConnected problem -
Tumba - 07.05.2013
It always returns 0
Re: IsPlayerConnected problem -
AndreT - 07.05.2013
Strong assumption: you haven't set up Invoke properly.
Read the plugin development tutorial. It has exact steps what you need to do (create invoke, push AMX back, etc).
Re: IsPlayerConnected problem -
Tumba - 07.05.2013
Quote:
Originally Posted by AndreT
Strong assumption: you haven't set up Invoke properly.
Read the plugin development tutorial. It has exact steps what you need to do (create invoke, push AMX back, etc).
|
All Have been set up.
Everything works fine, except of IsPlayerConnected
Re: IsPlayerConnected problem -
xeeZ - 08.05.2013
Did you try debugging it? Like stepping line by line in a debugger and seeing what's going on (what the IsPlayerConnected() native returns, what parameters are passed to it, etc)?
Also, have a look at this:
https://sampforum.blast.hk/showthread.php?tid=421090
Re: IsPlayerConnected problem -
Tumba - 08.05.2013
Quote:
Originally Posted by xeeZ
|
Yes i Have tried it.All parameters are right.
Re: IsPlayerConnected problem -
RCON1 - 25.05.2014
Anyone solved this problem? I have the same
Код:
logprintf( "witam [%d=%d] ",i, g_Invoke->callNative( &PAWN::IsPlayerConnected, i ));
result:
http://pastebin.com/CMF1WbsY