04.11.2016, 15:37
Hello all today i have a problem with my records commands it will show player IP and their accounts on the IP so i am having the issue if i use this command with playerid its working good but i have added a function like if any one getting record through player ip example
/arecords 182.182 so its not getting the records with matching ip here is my code please help me to fix it.
/arecords 182.182 so its not getting the records with matching ip here is my code please help me to fix it.
PHP код:
CMD:arecords(playerid, params[])
{
new givedplayerid, pIP[256], playersname[25], str[256], options[128], str2[256];
if (adlvl[playerid] < 3) return 0;
if (sscanf(params, "s[128]", options))
{
SendClientMessage(playerid, COLOR_WHITE, "Usage: /arecords [options]");
SendClientMessage(playerid, COLOR_WHITE, "OPTIONS: IP | playerid");
return 1;
}
else if(!strcmp(options, "IP", true, 2))
{
if(sscanf(params, "s[128]s[128]", options, pIP))
{
SendClientMessage(playerid, COLOR_WHITE, "Usage: /arecords IP [IP Address]");
return 1;
}
//format(str,sizeof(str),"|- IP: %s's Records -|", pIP);
//SendClientMessage(playerid,-1,str);
new File: file = fopen("Records.txt", io_read), idxx=1;
while(fread(file, str))
{
format(str, sizeof(str), "%s", str);
if (strcmp(str, pIP, false) == 0)
{
format(str2, sizeof(str2), "%s", str);
SendClientMessage(playerid, COLOR_ORANGE, str2);
idxx ++;
}
}
}
return 1;
}