Small problem about foreach and strcmp
#1

Hi, i have a small problem with this function :

PHP код:
stock CheckServerIp(string[]) {
    foreach(new 
iVirtualServer) if(!strcmp(VirtualServerInfo[i][sIP], string)) return i;
    return -
1;

The problem is that this function always return the first value, for example i have the valid VirtualServer value 1,2,3 and the string that i want to get is 3 but it will return 1, i have done some test commands and it's work perfect, this is my test commands below:
PHP код:
CMD:getip(playeridparams[]) {
    new 
value;
    if(
sscanf(params,"d"value)) return Usage(playerid"/getip [id]");
    return 
SendFormatMessage(playerid, -1"%s"VirtualServerInfo[value][sIP]);

Thanks for reading.
Reply


Messages In This Thread
Small problem about foreach and strcmp - by AlexBlack - 14.03.2016, 13:53
Re: Small problem about foreach and strcmp - by Threshold - 14.03.2016, 14:13
Re: Small problem about foreach and strcmp - by AlexBlack - 14.03.2016, 14:17
Re: Small problem about foreach and strcmp - by Threshold - 14.03.2016, 15:26
Re: Small problem about foreach and strcmp - by AlexBlack - 14.03.2016, 15:40
Re: Small problem about foreach and strcmp - by Konstantinos - 14.03.2016, 16:08
Re: Small problem about foreach and strcmp - by AlexBlack - 14.03.2016, 16:47
Re: Small problem about foreach and strcmp - by AlexBlack - 21.04.2016, 10:50

Forum Jump:


Users browsing this thread: 1 Guest(s)