SA-MP Forums Archive
Help with friends sistem - Printable Version

+- SA-MP Forums Archive (
+-- Forum: SA-MP Scripting and Plugins (
+--- Forum: Scripting Help (
+--- Thread: Help with friends sistem (/showthread.php?tid=605051)

Help with friends sistem - PudraMentolata - 13.04.2016

How I can put a restriction that a player who is already in the list of friends and wants to add him and to give him a message like this: You already have that player on your list . I wrote something but do not know how to put restriction can someone help me ?

public AddFriend(playerid, friend[])
		new playername[25];
		if(strval(friend) == strval(playername)) return SendClientMessage(playerid,-1,"{FFB870}Erorr: You can't add you in friend list.");
			new cont;
			cont = MySQLCheckAccount(friend);
			if(cont == 0) return SendClientMessage(playerid,-1,"{FFB870}Erorr: This name does not exist.");
			//SendClientMessage(playerid,-1,"{FFB870}Erorr: You already friend with that player."); 
			new playername3[MAX_PLAYER_NAME];
			GetPlayerName(playerid, playername3, sizeof(playername3));
			new Str[200];
			format(Str,sizeof(Str),"INSERT INTO `friends` (`user`,`friend`) VALUES ('%s','%s')",playername3,friend);
			strmid(FriendsInfo[playerid][pFriendName], friend, 0, strlen(friend), 255);
			new string[128];
			format(string,sizeof(string),"{FFB870}You succesfully added %s on your friends list.",friend);
		return 1;
	return 1;

Re: Help with friends sistem - PudraMentolata - 14.04.2016