SA-MP Forums Archive
Need help changing this command! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help changing this command! (/showthread.php?tid=421910)



Need help changing this command! - SiggaSvana - 11.03.2013

Quote:

CMD:ipcheck(playerid, params[])
{
MOD_CHECK;
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOUR_RED, "USAGE: /ipcheck [playerid]");

if(giveplayerid == INVALID_PLAYER_ID) return 1;
if(IsPlayerConnected(giveplayerid))
{
new playerip[32];
GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
format(string, sizeof(string), "(ID: %d) - (Name: %s) - (IP: %s)", giveplayerid, ReturnName(giveplayerid), playerip);
SendClientMessage(playerid, COLOUR_RED, string);
}
else SendClientMessage(playerid, COLOUR_RED, "Invalid player specified.");
}
return 1;
}

I need the command to check in accounts/{name}.ini but it can only check connected names. I need to get IP's for offline players also, hence accounts/name.ini
Im really having problems doing that Can someone please help?
Thank you!


Re: Need help changing this command! - HDFord - 11.03.2013

What saving system are you using?


Re: Need help changing this command! - SiggaSvana - 11.03.2013

Quote:
Originally Posted by HDFord
Посмотреть сообщение
What saving system are you using?
dini...(?)


Re: Need help changing this command! - Denying - 11.03.2013

I'm not so sure, but shouldn't IPs be a float?


Re: Need help changing this command! - SiggaSvana - 11.03.2013

Quote:
Originally Posted by HDFord
Посмотреть сообщение
What saving system are you using?
Quote:
Originally Posted by Denying
Посмотреть сообщение
I'm not so sure, but shouldn't IPs be a float?
I think its alright like this, just needs to fetch accounts instead of online players.


Re: Need help changing this command! - Ananisiki - 11.03.2013

Use this instead:

pawn Код:
CMD:aka(playerid, params[])
{
    if(!IsCnRAdmin(playerid)) return UnknownCMD(playerid);
    new pID;
    if(sscanf(params, "u", pID)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /aka (nick/id) - Enter A Valid Nick / ID");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "This Player Is Not Connected.");
    if(pID == cellmin) return SendClientMessage(playerid, COLOR_RED, "Multiple Players Found. Please Be More Specific.");
    new file[128], string[200], ip[128];
    format(file, sizeof file, "DM/Config/aka.txt");
    GetPlayerIp(pID, ip, sizeof ip);
    if(pID == playerid) format(string, sizeof string, "Your Nicknames [%s]:  %s", ip, dini_Get(file, ip));
    else format(string, sizeof string, "%s (%d)'s Nicknames [%s]:  %s", PlayerName(pID), pID, ip, dini_Get(file, ip));
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    return 1;
}
This is straight from my admin fs.


Re: Need help changing this command! - SiggaSvana - 11.03.2013

Looks like LuxAdmin(?)

I dont want a new command, I just want mine modified to my needs
I thank you for this though!


Re: Need help changing this command! - SiggaSvana - 12.03.2013

Someone?


Re: Need help changing this command! - SiggaSvana - 13.03.2013

Bump this :/


Re: Need help changing this command! - SiggaSvana - 14.03.2013

Please help me I need to add "accounts/{name}.ini" somewhere there, but not sure where.