Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by IntrozeN
Quote:
Originally Posted by Cuecumber
IP addresses are strings, not integers, so use the dini string functions instead of the integer ones.
~Cueball~
|
And dini_Int is used to check the Integer of the IP Adress.
I save the adresses like this:
127.0.0.1=1 //Banned
36.358.35.3=0 //Not Banned
|
A integer is a number not a number with dots. You cannot read from it, because dini_Int only finds numbers, not dots.
Quote:
Originally Posted by IntrozeN
pawn Код:
stock RangeBanCheck(playerid) { new pIP[256]; GetPlayerIp(playerid,pIP,sizeof(pIP)); new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,sizeof(pName)); if(dini_Get("CLRP/RangeBans.ban",pIP) == 1) { new server[256]; format(server,sizeof(server),".: Server kicked %s, Account BANNED! :.",pName); SendClientMessageToAll(COLOR_DARKRED, server); Kick(playerid); } return 1; }
Код:
E:\Documents and Settings\IntrozeN\Desktop\SAMP Serv\gamemodes\CLRP.pwn(7207) : error 033: array must be indexed (variable "dini_Get")
=/
|
A string doesn't equal 1.
Use strcmp to compare 2 strings.
|
Used:
pawn Код:
stock RangeBanCheck(playerid)
{
new pIP[256];
GetPlayerIp(playerid,pIP,sizeof(pIP));
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
if(strcmp("CLRP/RangeBans.ban",pIP) == 0)
{
new server[256];
format(server,sizeof(server),".: Server kicked %s, Account BANNED! :.",pName);
SendClientMessageToAll(COLOR_DARKRED, server);
Kick(playerid);
}
return 1;
}
didn't work...