Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:draugai(playerid,params[])
- {
- if(isnull(params))
- {
- new QueryString[200];
- mysql_format(connectionHandle, QueryString, 200, "SELECT `Draugas` FROM `draugai` WHERE `Pridejo` = '%e' ORDER BY `ID` DESC LIMIT 20;", Vardas(playerid));
- mysql_function_query(connectionHandle, QueryString, true, "OnSelectDraugai", "d", playerid);
- }
- else
- {
- new id;
- if(sscanf(params, "u", id))
- {
- UsageMessage(playerid,"* Pridëti þaidëjà á draugø sàraðà /draugas Vardas_Pavarde [ID]");
- return 1;
- }
- if(id == playerid)
- {
- ErrorMsg(playerid,"* Savæs á draugus pridët negalima!");
- return 1;
- }
- if(!IsPlayerConnected(id))
- {
- ErrorMsg(playerid,"* Tokio þaidëjo nëra.");
- return 1;
- }
- if(PlayerDB[playerid][DraugaiVisi] == 20)
- {
- ErrorMsg(playerid,"* Daugiausiai gali turëti 20 draugø!");
- return 1;
- }
- new string[144];
- format(string, 144, "* %s pridëtas á draugø sàraðà.", Vardas(id));
- SendClientMessage(playerid, GELTONA, string);
- PlayerDB[playerid][DraugaiVisi]+=1;
- new QueryString[512];
- mysql_format(connectionHandle, QueryString, 512, "INSERT INTO `draugai`(`Draugas`, `Pridejo`) VALUES ('%e','%e');", Vardas(id),Vardas(playerid));
- mysql_function_query(connectionHandle, QueryString, false, "", "");
- }
- return 1;
- }
- forward OnSelectDraugai(playerid);
- public OnSelectDraugai(playerid)
- {
- if(cache_get_row_count() == 0)
- {
- ErrorMsg(playerid,"* Neturi draugø! Pridëk su komanda /draugas V_P");
- }
- else
- {
- new info[1000];
- for(new row=0;row<cache_get_row_count();row++)
- {
- new string[150];
- new Draugas[24];
- new id;
- cache_get_row(row, 0, Draugas);
- if(!sscanf(Draugas, "u", id))
- {
- if(IsPlayerConnected(id))
- {
- format(string, 150, "\n{00FF00}%s ON", Draugas);
- strcat(info, string);
- }
- else
- {
- format(string, 150, "\n{FF0000}%s OFF", Draugas);
- strcat(info, string);
- }
- }
- }
- ShowPlayerDialog(playerid, 246, DIALOG_STYLE_LIST, "Draugai", info, "Gerai", "");
- }
- return 1;
- }
- CMD:atsakiklis(playerid,params[])
- {
- new QueryString[200];
- mysql_format(connectionHandle, QueryString, 200, "SELECT `SenderName`, FROM_UNIXTIME(`SendingTime`) AS `GavimoLaikasData`, `Zinute` FROM `smszinutes` WHERE `ReceiverName` = '%e' ORDER BY `ID` DESC LIMIT 20;", Vardas(playerid));
- mysql_function_query(connectionHandle, QueryString, true, "OnSelectSMSZinutes", "d", playerid);
- return 1;
- }
- forward OnSelectSMSZinutes(playerid);
- public OnSelectSMSZinutes(playerid)
- {
- if(cache_get_row_count() == 0)
- {
- ErrorMsg(playerid,"* Atsakiklis tuðèias!");
- }
- else
- {
- new info[2048];
- for(new row=0;row<cache_get_row_count();row++)
- {
- new string[150];
- new SenderName[24];
- new GavimoLaikasData[20];
- new Zinute[144];
- cache_get_row(row, 0, SenderName);
- cache_get_row(row, 1, GavimoLaikasData);
- cache_get_row(row, 2, Zinute);
- format(string, 150, "\n[%s] %s: %s",GavimoLaikasData,SenderName,Zinute);
- strcat(info, string);
- }
- ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Atsakiklis", info, "Gerai", "");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement