how to get players IP?
Ok so it is me again.
Can you please tell me how can I get user IP? Thank you. |
Re: how to get players IP?
INetChannelInfo *nci = engine->GetPlayerNetInfo(playerindex);
Then GetPlayerNetInfo has a GetAddress method ... but I think that returns the port as well i.e. 192.168.1.7:27005 |
Re: how to get players IP?
when i try nci-> nothing returns in Visual Studio so I don't know how to get the IP.
|
Re: how to get players IP?
it would be:
Code:
const char *ip = nci->GetAddress(); |
Re: how to get players IP?
Oh thank you I also forgot to include inetchannelinfo.h.
Now it works. Thank you again. |
Re: how to get players IP?
When I do this it compiles ok but when I join the server, the server crashes with some memory location error.
It crashes on this line const char *address = netinfo->GetAddress(); WHY? EDIT1: I think I don't pass valid edict. OK SO I have main loop which checks for number of players and then takes one by one and checks his IP. I am doing it like this. Quote:
Am I doing something wrong? on load I have this plugins Quote:
|
Re: how to get players IP?
you will need to test the entity before getting the netinfo
Code:
if(pEntity && !pEntity->IsFree() ) { |
Re: how to get players IP?
No, it still crashes :S :S :S :S
The error message is The instruction at "0x12555f8f" referenced memory at "0x00000010". The memory could not be "read". This sounds to me like I havent some constructor. HELP? |
Re: how to get players IP?
This would be an easy place to debug. Do you have it set up for debugging?
|
Re: how to get players IP?
Ahhhh I am little noob to debugging. :D
Arghhhh I really don't know why it crashes. It crashes on netinfo->GetAddress() |
All times are GMT -4. The time now is 09:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.