11.12.2014, 19:01
hmm nevermind try this:
pawn Код:
#include <a_samp>
#include <dini>
#include <sscanf2>
#include <zcmd>
new Name[MAX_PLAYER_NAME];
new Name2[MAX_PLAYER_NAME];
new File[256];
new pid;
new Str[128];
new FStr[128];
#define FRIEND "Friends/%s.ini"
#if defined FILTERSCRIPT
#endif
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(pid, Name2, sizeof(Name2));
format(File, sizeof(File), FRIEND, Name);
if(dialogid == 1555)
{
if(!response) return SendClientMessage(playerid, 0xFF0000FF, "FriendShip Denied!");
if(response)
{
SendClientMessage(playerid, 0x00FF00FF, "FriendShipe Accepted Congrats!!!");
format(FStr, sizeof(FStr), " %s,", Name2);
dini_Create(File);
dini_Set(File, "Friends", FStr);
dini_Set(File, "\n", FStr);
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
CMD:addfriend(playerid, params[])
{
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(pid, Name2, sizeof(Name2));
format(File, sizeof(File), FRIEND, Name);
if(sscanf(params, "us", pid)) return SendClientMessage(playerid, 0xFF0000FF, "Usage : /AddFriend [ID]!");
if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, 0xFF0000FF, "Player Is Not Connected!");
format(Str, sizeof(Str), "%s Want To Add You As A Friend!", Name);
ShowPlayerDialog(pid, 1555, DIALOG_STYLE_MSGBOX, "Friend Req!!!", Str, "Accept", "Cancel");
return 1;
}
CMD:myfriend(playerid, params[])
{
new fl[128];
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(pid, Name2, sizeof(Name2));
format(File, sizeof(File), FRIEND, Name);
new friends;
new friends2;
friends = dini_Int(File, "Friends");
friends2 = dini_Int(File, "\n");
format(fl, sizeof(fl), "{00FF00}Friend : {FFFF00}%s, %s", friends, friends2);
SendClientMessage(playerid, 0xFFFF00FF, Str);
return 1;
}
#pragma unused ret_memcpy