offline aka
#1

is it possible to make /offlineaka from the code below ??
Код:
CMD:aka(playerid, params[]) {
     if(PlayerInfo[playerid][pAdmin] >= 3) {
	    if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /aka [playerid]");
    	    new player1 = strval(params), str[128], tmp3[50];
	    if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) {
  		  	GetPlayerIp(player1, tmp3, 50);
		        format(str, sizeof(str), "A.K.A: [%s id:%d] [%s] %s", pName(player1), player1, tmp3, dini_Get("ladmin/pAdmin/aka.txt", tmp3));
	                return SendClientMessage(playerid, COLOR_WHITE, str);
		} else return SendClientMessage(playerid, red, "Player is not connected or is yourself");
	} else return SendClientMessage(playerid, red, "ERROR: You need to be level 3 to use this command");
}
Reply
#2

yes but it will be by ip for ex /offlineaka [ip]

and here you go
PHP код:
CMD:offlineaka(playeridparams[]) {
    if(
PlayerInfo[playerid][pAdmin] >= 3) {
        if(
isnull(params)) return SendClientMessage(playeridred"USAGE: /offlineaka [ip]");
        new 
str[128];
        
format(strsizeof(str), "Offline A.K.A: [ %s ] %s"paramsdini_Get("ladmin/pAdmin/aka.txt"params));
        
SendClientMessage(playeridCOLOR_WHITEstr);
    }
    else
    {
        
SendClientMessage(playeridred"ERROR: You need to be level 3 to use this command");
    }
    return 
1;

Reply
#3

thank you it worked


edit: what about change it to /offlineaka [username] ??
Reply
#4

Quote:
Originally Posted by Muhammad78
Посмотреть сообщение
thank you it worked


edit: what about change it to /offlineaka [username] ??
its possible but only will be for registered users as long as you just can get player ip from their user.
Reply
#5

Код:
CMD:offlineaka(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] >= 3) {
		new name[32]; new player1 = strval(params), str[128], tmp3[50];
     	if(sscanf(params, "s", name)) return SendClientMessage(playerid, red, "USAGE: /offlineaka [username]");
        new playerFile[100];
	    format(playerFile,256,"/ladmin/users/%s.ini",udb_encode(name));
      	if(fexist(playerFile))
	    {
	 		GetPlayerIp(player1, tmp3, 50);
	  		format(str, sizeof(str), "Name: %s\nAKA: [ %s ] %s", pName(player1), tmp3, dini_Get("ladmin/pAdmin/aka.txt", tmp3));
	      	        return ShowPlayerDialog(playerid,1907,DIALOG_STYLE_MSGBOX, "{FF0000}Offline A.K.A", str, "Ok", "");
		} else return SendClientMessage(playerid, red, "That player doesn't exist!");
	} else return SendClientMessage(playerid, red, "ERROR: You are not a high enough level to use this command");
}
i have tried make it but it doesn't work perfectly haha help x3
Reply
#6

Is the player supposed to be offline or online when you use /offlineaka [username]?

Also, stop using that old version of sscanf. The plugin version is much faster.
Reply
#7

here you go sir
PHP код:
CMD:offlineaka(playeridparams[]) {
    if(
PlayerInfo[playerid][pAdmin] >= 3) {
        new 
name[32], str[128];
         if(
sscanf(params"s"name)) return SendClientMessage(playeridred"USAGE: /offlineaka [username]");
        new 
playerFile[100];
        
format(playerFile,256,"/ladmin/users/%s.ini",udb_encode(name));
          if(
fexist(playerFile))
        {
              
format(strsizeof(str), "Name: %s\nAKA: %s"namedini_Get("ladmin/pAdmin/aka.txt"dini_Get(playerFile"ip")));
              return 
ShowPlayerDialog(playerid,1907,DIALOG_STYLE_MSGBOX"{FF0000}Offline A.K.A"str"Ok""");
        } else return 
SendClientMessage(playeridred"That player doesn't exist!");
    } else return 
SendClientMessage(playeridred"ERROR: You are not a high enough level to use this command");

Reply
#8

awesome, thanks sir jlalt. i sent you a rep+ idk you received it or not :3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)