Die werden mit DOF2 gespeichert...Hier z.B. ist der Befehl um die Freunde zu adden.
CMD:friend(playerid, params[])
{
new giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, 0x33AA33AA, "(*) /friend [playerid]");
if(playerid == giveplayerid) return SendClientMessage(playerid, 0x33AA33AA, "(*) You cannot be friend of yourself.");
new USER_FILE[64];
format(USER_FILE, sizeof(USER_FILE), "SFSUsers/%s.ini", GetPlayerNameEx(playerid));
if(DOF2_GetInt(USER_FILE, GetPlayerNameEx(giveplayerid)) == 1) return SendClientMessage(playerid, 0x33AA33AA, "(*) You already are friend of this player.");
new iStr[70];
format(iStr, sizeof(iStr), "(*) You sent an invitation to %s for a friendship.", GetPlayerNameEx(giveplayerid));
SendClientMessage(playerid, 0x33AA33AA, iStr);
format(iStr, sizeof(iStr), "%s wants to become your friend.\nDo you accept?", GetPlayerNameEx(playerid));
ShowPlayerDialog(giveplayerid, AMIGODIALOG, DIALOG_STYLE_MSGBOX, "Want to be my friend?", iStr, "Yes", "No");
SetPVarInt(giveplayerid, "AmigoRequest", playerid);
return 1;
}
Und dann:
if(!response)
{
SendClientMessage(GetPVarInt(playerid, "AmigoRequest"), 0x33AA33AA, "(*) The invitation has been declined.");
DeletePVar(playerid, "AmigoRequest");
SendClientMessage(playerid, 0x33AA33AA, "(*) You declined the invitation.");
return 1;
}
new USER_FILE[64], FRIEND_FILE[64];
new giveplayerid = GetPVarInt(playerid, "AmigoRequest");
format(USER_FILE, sizeof(USER_FILE), "SFSUsers/%s.ini", GetPlayerNameEx(playerid));
DOF2_SetInt(USER_FILE, GetPlayerNameEx(giveplayerid), 1);
format(FRIEND_FILE, sizeof(FRIEND_FILE), "SFSUsers/%s.ini", GetPlayerNameEx(giveplayerid));
DOF2_SetInt(FRIEND_FILE, GetPlayerNameEx(playerid), 1);
DOF2_SaveFile();
SendClientMessage(giveplayerid, 0x33AA33AA, "(*) The invitation has been accepted.");
SendClientMessage(playerid, 0x33AA33AA, "(*) You've accepted the invitation.");
DeletePVar(playerid, "AmigoRequest");
}