12.08.2016, 12:44
Introduction
AKA(Alias) include allows to retrieve the names of different accounts on the same ip(very easily)
Why did i make this?
Few months ago i wanted a aka system, i could not find one, so i thought why not make one and today i finally got enough free time to make one...
Features
-Uses SQLite for storing AKA data
-Simple and Easy
-You can choose the maximum number of names retrieved from database
How to use?
Command
Example Filterscript
coming soon
Download V1.0
AKA(Alias) include allows to retrieve the names of different accounts on the same ip(very easily)
Why did i make this?
Few months ago i wanted a aka system, i could not find one, so i thought why not make one and today i finally got enough free time to make one...
Features
-Uses SQLite for storing AKA data
-Simple and Easy
-You can choose the maximum number of names retrieved from database
How to use?
- Put "#include <aka>" under samp include
- Put "LoadAKADatabase();" Under "OnGameModeInt"(or "FilterscriptInit" , if you want to use it in a filterscript)
- Put "InitAKAOnConnect(playerid);" under "OnPlayerConnect"
- Then use the function "AKA" to retrieve the multiple accounts where needed
Command
PHP код:
CMD:aka(playerid,params[])
{
new pID;
if(!sscanf(params,"u",pID)) return SendClientMessage(playerid,-1,"/aka (playerid)");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,-1,"Invalid playerid");
new accounts[*][MAX_PLAYER_NAME],string[256]; //change * to the maximum number of names you want to retrieve.
AKA(playerid,accounts);
if(accounts[0][0] == '\0') return SendClientMessage(playerid,-1,"This Player has no mutli accounts!");
for(new i; i<sizeof(accounts); i++)
{
if(accounts[i][0] == '\0') break;
format(string,sizeof(string),"%sPlayerName: %s\n",string,accounts[i]);
}
return ShowPlayerDialog(playerid,999,DIALOG_STYLE_MSGBOX,"All Player Accounts",string,!"Okay",!"");
}
coming soon
Download V1.0
PHP код:
#if !defined _samp_included
#error samp is not included
#endif
#if defined _AKA
#endinput
#endif
#define _AKA
static DB:database;
LoadAKADatabase()
{
database = db_open("aka.db");
db_query(database,"CREATE TABLE IF NOT EXISTS `akas` (`Username`,`Ip`)");
}
InitAKAOnConnect(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
new ip[16],name[MAX_PLAYER_NAME],DBResult:result,string[128];
GetPlayerIp(playerid,ip,16);
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(string,sizeof(string),"SELECT `Ip` FROM `akas` WHERE `Username`='%s'",name);
result = db_query(database,string);
switch(db_num_rows(result))
{
case 0: format(string,sizeof(string),"INSERT INTO `akas` (`Username`,`Ip`) VALUES ('%s','%s')",name,ip);
default: format(string,sizeof(string),"UPDATE `akas` SET `Ip`='%s' WHERE `Username`='%s'",ip,name);
}
db_free_result(result);
db_query(database,string);
return 1;
}
stock AKA(playerid,accs[][],const size=sizeof(accs))
{
new ip[16],name[MAX_PLAYER_NAME],DBResult:result,string[128],rows;
GetPlayerIp(playerid,ip,16);
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(string,sizeof(string),"SELECT `Username` FROM `akas` WHERE `Ip`='%s'",ip);
result = db_query(database,string);
rows = db_num_rows(result);
if(rows>1)
{
for(new i,j; i<rows; i++)
{
if(j==size) break;
db_get_field(result,0,accs[j++],MAX_PLAYER_NAME);
db_next_row(result);
}
}
return db_free_result(result);
}