How to make this code work?
#1

How to make this code work?

Code:
    new Float: saveip[MAX_PLAYERS];
	GetPlayerIp(playerid, saveip[playerid], saveip[playerid], saveip[playerid], saveip[playerid]);
This give me 3 warnings...
Code:
C:\Users\Robin\Desktop\Simons server\gamemodes\lvdm.pwn(663) : warning 213: tag mismatch
C:\Users\Robin\Desktop\Simons server\gamemodes\lvdm.pwn(663) : warning 213: tag mismatch
C:\Users\Robin\Desktop\Simons server\gamemodes\lvdm.pwn(663) : warning 202: number of arguments does not match definition
Reply
#2

What are you attempting to do? To get the IP?
Reply
#3

I want to save to ip in new Float: saveip[MAX_PLAYERS]; to be able to get the ip when the player disconnetct.. Reason: If you try GetPlayerIp in OnPlayerDisconnect its only return 255.255.255.255-_- So I want to store the ip from OnPlayerConnect so i can use it when a player Disconnect!

Sorry for my bad English! I'm from Sweden...
Reply
#4

pawn Code:
new ip[16];
GetPlayerIp(playerid,ip,sizeof(ip));
Reply
#5

Quote:
Originally Posted by MenaceX^
pawn Code:
new ip[16];
GetPlayerIp(playerid,ip,sizeof(ip));
Thanks but I most store the id of the player to... This only store one ip on the latest connected player-_-
Reply
#6

Then change it to an array like you did for the floats.

pawn Code:
new ip[MAX_PLAYERS][16];


GetPlayerIp(playerid, ip[playerid], sizeof(ip[]));
Reply
#7

Quote:
Originally Posted by 0rb
Then change it to an array like you did for the floats.

pawn Code:
new ip[MAX_PLAYERS][16];


GetPlayerIp(playerid, ip[playerid], sizeof(ip[]));
Its works but if you try to do it whits new ip[MAX_PLAYERS][16]; you will get 2 warnings..
C:\Users\Robin\Desktop\Simons server\gamemodes\lvdm.pwn(4672) : warning 219: local variable "ip" shadows a variable at a preceding level
C:\Users\Robin\Desktop\Simons server\gamemodes\lvdm.pwn(4712) : warning 219: local variable "ip" shadows a variable at a preceding level

But this works so tank you!
new saveip[MAX_PLAYERS][16];
GetPlayerIp(playerid,saveip[playerid],sizeof(saveip[]));

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)