IsPlayerConnected problem
#1

Hello, everybody!

PHP код:
PLUGIN_EXPORT void PLUGIN_CALL ProcessTick()
{
     
      for(
int i 0;MAX_PLAYERS;i++)
      {
                if(
g_Invoke->callNative(&PAWN::IsPlayerConnected,i) == 1std::cout << i;
    
      }

Why, doesnt it work

P.S. ProcessTick works
Reply
#2

why cout, not logprintf ?
Reply
#3

Quote:
Originally Posted by Yiin
Посмотреть сообщение
why cout, not logprintf ?
It hasns't value.
Reply
#4

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));
Reply
#5

PHP код:
[17:07:42] [joinDiego_Vela has joined the server (0:127.0.0.1)
[
17:07:42] [debugIsPlayerConnected[0] = 
Reply
#6

It always returns 0
Reply
#7

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).
Reply
#8

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
Reply
#9

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
Reply
#10

Quote:
Originally Posted by xeeZ
Посмотреть сообщение
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
Yes i Have tried it.All parameters are right.
Reply
#11

Anyone solved this problem? I have the same
Код:
logprintf( "witam [%d=%d] ",i, g_Invoke->callNative( &PAWN::IsPlayerConnected,  i ));
result: http://pastebin.com/CMF1WbsY
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)