27.03.2013, 13:04
Hello!
I have another question for you guys
How can I make /getip command with dini?
Thanks for help!
I have another question for you guys
How can I make /getip command with dini?
Thanks for help!
CMD:aka(playerid, params[]) { if(!IsCnRAdmin(playerid)) return UnknownCMD(playerid); // replace your own admin variable 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; }
Try this
Код:
CMD:aka(playerid, params[]) { if(!IsCnRAdmin(playerid)) return UnknownCMD(playerid); // replace your own admin variable 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; } |
dcmd_aka(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid)) {
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /aka [playerid]");
new player1, playername[MAX_PLAYER_NAME], str[128], tmp3[50];
player1 = strval(params);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
GetPlayerIp(player1,tmp3,50);
GetPlayerName(player1, playername, sizeof(playername));
format(str,sizeof(str),"AKA: [%s id:%d] [%s] %s", playername, player1, tmp3, dini_Get("ladmin/config/aka.txt",tmp3) );
return SendClientMessage(playerid,blue,str);
} else return SendClientMessage(playerid, red, "Player is not connected or is yourself");
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Maybe this one can help you then, from the ladmin FS
pawn Код:
|
C:\Users\tadej\Desktop\My Server, Don't touch!\gamemodes\Samp.pwn(547) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |
line?
Do you want a command /getip that gets the ip of a player whether he's online or not by his file by using dini? Do you want a command /getip that gets player's ip who is online by using the SA:MP function? |
} else return SendClientMessage(playerid,red,"You need to be administrator level 1 to use that command!");