Facebook
From Silver, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 221
  1. #include <a_samp>
  2. #include <sscanf2>
  3. #include <PAWN.cmd>
  4.  
  5. #define  KONUM_DIALOG   (9999)// modda bulunan dialog id ile çakışma olasılıgını engellemek için değiştirebilirsin
  6.  
  7. new Konum_Gonderilen[MAX_PLAYERS];
  8. new Konum_Gonderen[MAX_PLAYERS];
  9.  
  10. public OnPlayerConnect(playerid)
  11. {
  12.     Konum_Gonderilen[playerid] = -1; Konum_Gonderen[playerid] = -1;
  13.         return 1;
  14. }
  15.  
  16. public OnPlayerEnterCheckpoint(playerid)
  17. {
  18.     new adam = Konum_Gonderen[playerid];
  19.     if(adam != -1)
  20.     {
  21.         SendClientMessage(playerid, 0xFFFF00FF, "[!] Konum noktasına ulaştınız.");
  22.         SendClientMessage(adam, 0xFFFF00FF, "[!] Konum paylaştığınız kullanıcı, konum noktasına ulaştı.");
  23.         DisablePlayerCheckpoint(playerid);
  24.     }
  25.         return 1;
  26. }
  27.  
  28. public OnPlayerDisconnect(playerid, reason)
  29. {
  30.         if(Konum_Gonderilen[playerid] != -1)
  31.         {
  32.                 SendClientMessage(Konum_Gonderilen[playerid], 0xFF0000FF, "[!] Gönderilen konum, konum sahibi tarafından sıfırlandı.");
  33.                 DisablePlayerCheckpoint(Konum_Gonderilen[playerid]);
  34.                 Konum_Gonderen[Konum_Gonderilen[playerid]] = -1;
  35.             Konum_Gonderilen[playerid] = -1;
  36.         }
  37.         return 1;
  38. }
  39.  
  40. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  41. {
  42.         switch(dialogid)
  43.         {
  44.                 case KONUM_DIALOG:
  45.                 {
  46.                         new adam = Konum_Gonderen[playerid];
  47.                     if(!response)
  48.                         {
  49.                             SendClientMessage(playerid, 0xFF0000FF, "[!] Konum isteğini iptal ettiniz.");
  50.                                 SendClientMessage(adam, 0xFF0000FF, "[!] Kullanıcı konum isteğini iptal etti.");
  51.                 Konum_Gonderilen[adam] = -1;
  52.                                 return 1;
  53.                         }
  54.                     if(response)
  55.                     {
  56.                         new Float:adamPos[3];
  57.                         GetPlayerPos(adam, adamPos[0], adamPos[1], adamPos[2]);
  58.                         SetPlayerCheckpoint(playerid, adamPos[0], adamPos[1], adamPos[2], 3);
  59.                         SendClientMessage(playerid, 0xFF0000FF, "[!] Konumu kabul ettiniz.");
  60.                         SendClientMessage(adam, 0xFF0000FF, "[!] Kullanıcı konumu kabul etti.");
  61.                     }
  62.                 }
  63.         }
  64.         return 1;
  65. }
  66.  
  67. stock IsimCek(playerid)
  68. {
  69.         new slvr_isim[MAX_PLAYER_NAME];
  70.         GetPlayerName(playerid, slvr_isim, sizeof(slvr_isim));
  71.         return slvr_isim;
  72. }
  73.  
  74. CMD:konumgonder(playerid, params[])
  75. {
  76.         new kullanici, str[128 * 2];
  77.         if(sscanf(params, "u", kullanici)) return SendClientMessage(playerid, 0xFF00FFAA, "[>] /konumgonder [isim/id]");
  78.         if(!IsPlayerConnected(kullanici)) return SendClientMessage(playerid, 0xFF0000FF, "[>] Geçersiz kullanıcı.");
  79.         if(Konum_Gonderilen[playerid] == kullanici) return SendClientMessage(playerid, 0xFF0000FF, "[>] Bu kullanıcıya önceden konum gönderdiniz.");
  80.     Konum_Gonderilen[playerid] = kullanici; Konum_Gonderen[kullanici] = playerid;
  81.         format(str, sizeof(str), "-> %s tarafından konum çağrısı aldınız.\nKonumu kabul etmek ister misiniz?", IsimCek(playerid));
  82.         ShowPlayerDialog(kullanici, KONUM_DIALOG, DIALOG_STYLE_MSGBOX, "Konum Bildirisi", str, "Kabul Et", "Iptal Et");
  83.         return 1;
  84. }
  85.  
  86. cmd:konumsifirla(playerid, params[])
  87. {
  88.         if(Konum_Gonderilen[playerid] != -1)
  89.         {
  90.             SendClientMessage(playerid, 0xFF0000FF, "[!] Konum sıfırlandı.");
  91.                 SendClientMessage(Konum_Gonderilen[playerid], 0xFF0000FF, "[!] Gönderilen konum, konum sahibi tarafından sıfırlandı.");
  92.                 DisablePlayerCheckpoint(Konum_Gonderilen[playerid]);
  93.                 Konum_Gonderen[Konum_Gonderilen[playerid]] = -1;
  94.             Konum_Gonderilen[playerid] = -1;
  95.         }
  96.         else SendClientMessage(playerid, 0xFF0000FF, "[!] Sıfırlanacak konum bulunamadı.");
  97.         return 1;
  98. }