Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case DIALOG_FRIENDS+1:
- {
- if(!response) return 1;
- new id;
- if(sscanf(inputtext, "u", id))
- {
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Eroare: Jucatorul nu este conectat.");
- }
- else
- {
- if(id == playerid) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Nu te poti adauga pe tine in lista!");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Eroare: Jucatorul nu este conectat.");
- new test, friends;
- new result[256];
- format(string, sizeof(string), "SELECT * FROM `friends` WHERE `friendID`='%d'", PlayerInfo[id][pSQLID]);
- new Cache: db = mysql_query (SQL, string);
- for ( new i, j = cache_get_row_count (); i != j; ++i )
- {
- friends++;
- cache_get_field_content( i, "AddBy", result ); test = strval( result );
- if(test == PlayerInfo[playerid][pSQLID]) return SendClientMessage(playerid, COLOR_WHITE, "Acest player este deja in lista ta de prieteni!");
- }
- if(friends == 25 && PlayerInfo[playerid][pPremiumAccount] == 0) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}* Poti avea doar 25 prieteni fara cont premium!");
- if(friends == 50) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}* Ai prea multi prieteni!");
- cache_delete( db );
- format(string, sizeof(string), "{FFB870}%s (%d) face acum parte din lista ta de prieteni.", GetName(id), id);
- SendClientMessage(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "{FFB870}%s (%d) te-a adaugat in lista sa de prieteni.", GetName(playerid), playerid);
- SendClientMessage(id, COLOR_WHITE, string);
- format(string, sizeof(string), "INSERT INTO `friends` (`friendID`, `friendName`, `AddBy`) VALUES ('%d', '%s', '%d')", PlayerInfo[id][pSQLID], PlayerInfo[id][pUsername], PlayerInfo[playerid][pSQLID]);
- mysql_tquery(SQL, string, "", "");
- }
- }
- case DIALOG_FRIENDS+2:
- {
- if(!response) return ShowPlayerFriends(playerid);
- new userid = GetPlayerID(sName[playerid]);
- if(!IsPlayerConnected(userid)) return 1;
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pPnumber] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: You don't have a cellphone!");
- foreach(Player, i)
- {
- if(PlayerInfo[i][pPnumber] == PlayerInfo[userid][pPnumber])
- {
- new id = i;
- if(PlayerInfo[id][pPnumber] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: This player dont have a cellphone!");
- if(PhoneOnline[id] == 1) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Player's phone is offline!");
- Mobile[playerid] = id;
- if(Mobile[id] != 255) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: That player is speaking with someone.");
- if(Mobile[id] == 255)
- {
- format(string, sizeof(string), "{FFFF45}Phone: %s ({FFFFFF}%s{FFFF45}) is calling you. Type (/pickup) to answer.", GetName(playerid), DecimalNumber(playerid));
- SendClientMessage(id, COLOR_WHITE, string);
- format(string, sizeof(string), "%s takes out a cellphone and dials a number.", GetName(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- format(string, sizeof(string), "%s's phone rings.", GetName(id));
- ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
- return 1;
- }
- }
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][pPnumber] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: You don't have a cellphone!");
- ShowPlayerDialog(playerid, DIALOG_FRIENDS+4, DIALOG_STYLE_INPUT, "Send SMS:", "Write the SMS text in the box below.", "Send", "Cancel");
- }
- case 2:
- {
- mysql_format(SQL,string,128,"DELETE FROM `friends` WHERE `friendID`='%d'",PlayerInfo[userid][pSQLID]);
- mysql_query(SQL, string);
- format(string, sizeof(string), "{FFB870}%s nu mai face parte din lista ta de prieteni.", PlayerInfo[userid][pUsername]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- }
- }
- case DIALOG_FRIENDS+3:
- {
- if(!response) return ShowPlayerFriends(playerid);
- mysql_format(SQL,string,128,"DELETE FROM `friends` WHERE `friendName`='%s'",sName[playerid]);
- mysql_query(SQL, string);
- format(string, sizeof(string), "{FFB870}%s nu mai face parte din lista ta de prieteni.", sName[playerid]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- case DIALOG_FRIENDS+4:
- {
- if(!response) return 1;
- new userid = GetPlayerID(sName[playerid]);
- if(!IsPlayerConnected(userid)) return 1;
- foreach(Player, i)
- {
- if(PlayerInfo[i][pPnumber] == PlayerInfo[userid][pPnumber] && PlayerInfo[userid][pPnumber] != 0)
- {
- new id = i;
- if(PlayerInfo[id][pPnumber] == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: This player dont have a cellphone!");
- if(PhoneOnline[id] == 1) return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Player's phone is offline!");
- format(string, sizeof(string), "SMS from %s ({FFFFFF}%s{FFFF00}): %s",GetName(playerid),DecimalNumber(playerid), inputtext);
- SendClientMessage(id, COLOR_YELLOW, string);
- format(string, sizeof(string), "SMS to %s ({FFFFFF}%s{FFFF00}): %s",GetName(id),DecimalNumber(id),inputtext);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- PlayerPlaySound(id, 1052, 0.0, 0.0, 10.0);
- return 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement