Advertisement
Rolandas_L

/vesti pataisyta

Apr 2nd, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.64 KB | None | 0 0
  1. new bool:Vedes[MAX_PLAYERS];
  2. new SiuloTuoktis[MAX_PLAYERS];
  3.  
  4. #define VESTUVIU_GUI 1
  5.  
  6. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  7. {
  8.     if(dialogid == VESTUVIU_GUI){
  9.         new pID = SiuloTuoktis[playerid],stringas[128],Name1[24],Name2[24];
  10.         GetPlayerName(playerid, Name1, 24);
  11.         GetPlayerName(pID, Name2, 24);
  12.         if(response)
  13.         {
  14.             format(stringas, 128, "%s ir %s Ką tik susituokė! :)", Name1,Name2);
  15.             SendClientMessageToAll(-1, stringas);
  16.             Vedes[pID] = true;
  17.             Vedes[playerid] = true;
  18.             return 1;
  19.         }
  20.         if(!response)
  21.         {
  22.             format(stringas, 128, "%s nesutiko su jūsų pasiūlymu", Name1);
  23.             SendClientMessage(pID, -1, stringas);
  24.             SendClientMessage(playerid, -1, "Nesutikote");
  25.             return 1;
  26.         }
  27.     }
  28.     return 1;
  29. }
  30.  
  31. CMD:vesti(playerid,string[]){
  32.     new pID, stringas[128],Name1[24],Name2[24];
  33.     if(sscanf(string,"u",pID)) return SendClientMessage(playerid, -1, "Komandos naudojimas: /vesti <<žaidėjo vardas/ID");
  34.     if(IsPlayerConnected(pID)) return SendClientMessage(playerid, -1, "Klaida: Tokio žaidėjo nėra, arba žaidėjas neprisijungęs");
  35.     if(pID == playerid) return SendClientMessage(playerid, -1, "Klaida: Savęs vesti negalite");
  36.     if(Vedes[pID]) return SendClientMessage(playerid, -1, "Žaidėjas jau susituokęs");
  37.     SiuloTuoktis[pID] = playerid;
  38.     GetPlayerName(playerid, Name1, 24);
  39.     GetPlayerName(pID, Name2, 24);
  40.     format(stringas, 128, "Pasipiršote %s", Name2);
  41.     SendClientMessage(playerid, -1, stringas);
  42.     format(stringas, 128, "Žaidėjas %s jums pasipiršo :)", Name1);
  43.     ShowPlayerDialog(pID, VESTUVIU_GUI, DIALOG_STYLE_MSGBOX, "Vestuvės :)", stringas, "Taip :)", "Ne :(");
  44.     return 1;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement