invalid expression, assumed zero -
wallen - 09.02.2018
C:\Users\Wallen\Desktop\LS DM\gamemodes\DBv1.pwn(832) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
PHP код:
if(pInfo[playerid][Admin] >= 1 && pInfo[playerid][Admin] >= 2 && pInfo[playerid][Admin] >= 0)
{
new ip[16], country[32];
GetIPCountry(ip, country, sizeof country);
GetPlayerIp(playerid,ip,sizeof(ip));
format(str,sizeof(str), "{c3c3c3}(INFO) %s joined the game (ID: %d || Country: %s )",name, playerid, country);
SendMessageToAdmins(str);
}
else
{
new ip[16], country[32], isp[32], city[32];
GetPlayerIp(playerid, ip, 16);
GetIPCountry(ip, country, sizeof country);
GetIPISP(ip, isp, sizeof isp);
GetIPCity(ip, city, sizeof city);
GetPlayerIp(playerid,ip,sizeof(ip));
format(str,sizeof(str), "{c3c3c3}(INFO) %s joined the game (ID: %d || IP: %s || Country: %s || City: %s || ISP: %s)",name, playerid, ip, country, city, isp);
SendMessageToAdmins(str);
}
else
{
format(str,sizeof(str), "{c3c3c3}(INFO) %s (ID: %d) joined the game !",name, playerid);
SendClientMessageToAll(playerid, str);
}
Line 832 (LAST ELSE)
Just wanted to specify that if a player is level 1 it will show to the admin only the player's country, level 2 ip countr city isp, level 0 only a normal connection to all players. It gives 1 error on last else.
Re: invalid expression, assumed zero -
Maximun - 09.02.2018
How you declare a level of player ?
I mean this :
Код:
pInfo[playerid][Level]
or what ?
Re: invalid expression, assumed zero -
wallen - 09.02.2018
yeah thats the variable which detects if the player has or no the level
Re: invalid expression, assumed zero -
jasperschellekens - 09.02.2018
You cant use else twice...
Re: invalid expression, assumed zero -
wallen - 09.02.2018
PHP код:
if(pInfo[playerid][Admin] >= 1 )
{
new ip[16], country[32];
GetIPCountry(ip, country, sizeof country);
GetPlayerIp(playerid,ip,sizeof(ip));
format(str,sizeof(str), "{c3c3c3}(INFO) %s joined the game (ID: %d || Country: %s )",name, playerid, country);
SendMessageToAdmins(str);
}
else if (pInfo[playerid][Admin] >= 2 )
{
new ip[16], country[32], isp[32], city[32];
GetPlayerIp(playerid, ip, 16);
GetIPCountry(ip, country, sizeof country);
GetIPISP(ip, isp, sizeof isp);
GetIPCity(ip, city, sizeof city);
GetPlayerIp(playerid,ip,sizeof(ip));
format(str,sizeof(str), "{c3c3c3}(INFO) %s joined the game (ID: %d || IP: %s || Country: %s || City: %s || ISP: %s)",name, playerid, ip, country, city, isp);
SendMessageToAdmins(str);
}
else if (pInfo[playerid][Admin] >= 0)
{
format(str,sizeof(str), "{c3c3c3}(INFO) %s (ID: %d) joined the game !",name, playerid);
SendClientMessageToAll(playerid, str);
}
this should be ok then?
Re: invalid expression, assumed zero -
Maximun - 09.02.2018
Do you mean this ? if yes, can you try it
PHP код:
new ip[16], country[32], isp[32], city[32];
if(pInfo[playerid][Level] == 1)
{
GetIPCountry(ip, country, sizeof country);
GetPlayerIp(playerid,ip,sizeof(ip));
format(str,sizeof(str), "{c3c3c3}(INFO) %s joined the game (ID: %d || Country: %s )",name, playerid, country);
SendMessageToAdmins(str);
}
else if(pInfo[playerid][Level] == 2)
{
GetPlayerIp(playerid, ip, 16);
GetIPCountry(ip, country, sizeof country);
GetIPISP(ip, isp, sizeof isp);
GetIPCity(ip, city, sizeof city);
GetPlayerIp(playerid,ip,sizeof(ip));
format(str,sizeof(str), "{c3c3c3}(INFO) %s joined the game (ID: %d || IP: %s || Country: %s || City: %s || ISP: %s)",name, playerid, ip, country, city, isp);
SendMessageToAdmins(str);
}
format(str,sizeof(str), "{c3c3c3}(INFO) %s (ID: %d) joined the game !",name, playerid);
SendClientMessageToAll(playerid, str);
Re: invalid expression, assumed zero -
wallen - 09.02.2018
Ok thanks ill use your code its more simply than mine