- #include <a_samp>
- #include <sscanf2>
- #include <PAWN.cmd>
- #define KONUM_DIALOG (9999)// modda bulunan dialog id ile çakışma olasılıgını engellemek için değiştirebilirsin
- new Konum_Gonderilen[MAX_PLAYERS];
- new Konum_Gonderen[MAX_PLAYERS];
- public OnPlayerConnect(playerid)
- {
- Konum_Gonderilen[playerid] = -1; Konum_Gonderen[playerid] = -1;
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- new adam = Konum_Gonderen[playerid];
- if(adam != -1)
- {
- SendClientMessage(playerid, 0xFFFF00FF, "[!] Konum noktasına ulaştınız.");
- SendClientMessage(adam, 0xFFFF00FF, "[!] Konum paylaştığınız kullanıcı, konum noktasına ulaştı.");
- DisablePlayerCheckpoint(playerid);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(Konum_Gonderilen[playerid] != -1)
- {
- SendClientMessage(Konum_Gonderilen[playerid], 0xFF0000FF, "[!] Gönderilen konum, konum sahibi tarafından sıfırlandı.");
- DisablePlayerCheckpoint(Konum_Gonderilen[playerid]);
- Konum_Gonderen[Konum_Gonderilen[playerid]] = -1;
- Konum_Gonderilen[playerid] = -1;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case KONUM_DIALOG:
- {
- new adam = Konum_Gonderen[playerid];
- if(!response)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[!] Konum isteğini iptal ettiniz.");
- SendClientMessage(adam, 0xFF0000FF, "[!] Kullanıcı konum isteğini iptal etti.");
- Konum_Gonderilen[adam] = -1;
- return 1;
- }
- if(response)
- {
- new Float:adamPos[3];
- GetPlayerPos(adam, adamPos[0], adamPos[1], adamPos[2]);
- SetPlayerCheckpoint(playerid, adamPos[0], adamPos[1], adamPos[2], 3);
- SendClientMessage(playerid, 0xFF0000FF, "[!] Konumu kabul ettiniz.");
- SendClientMessage(adam, 0xFF0000FF, "[!] Kullanıcı konumu kabul etti.");
- }
- }
- }
- return 1;
- }
- stock IsimCek(playerid)
- {
- new slvr_isim[MAX_PLAYER_NAME];
- GetPlayerName(playerid, slvr_isim, sizeof(slvr_isim));
- return slvr_isim;
- }
- CMD:konumgonder(playerid, params[])
- {
- new kullanici, str[128 * 2];
- if(sscanf(params, "u", kullanici)) return SendClientMessage(playerid, 0xFF00FFAA, "[>] /konumgonder [isim/id]");
- if(!IsPlayerConnected(kullanici)) return SendClientMessage(playerid, 0xFF0000FF, "[>] Geçersiz kullanıcı.");
- if(Konum_Gonderilen[playerid] == kullanici) return SendClientMessage(playerid, 0xFF0000FF, "[>] Bu kullanıcıya önceden konum gönderdiniz.");
- Konum_Gonderilen[playerid] = kullanici; Konum_Gonderen[kullanici] = playerid;
- format(str, sizeof(str), "-> %s tarafından konum çağrısı aldınız.\nKonumu kabul etmek ister misiniz?", IsimCek(playerid));
- ShowPlayerDialog(kullanici, KONUM_DIALOG, DIALOG_STYLE_MSGBOX, "Konum Bildirisi", str, "Kabul Et", "Iptal Et");
- return 1;
- }
- cmd:konumsifirla(playerid, params[])
- {
- if(Konum_Gonderilen[playerid] != -1)
- {
- SendClientMessage(playerid, 0xFF0000FF, "[!] Konum sıfırlandı.");
- SendClientMessage(Konum_Gonderilen[playerid], 0xFF0000FF, "[!] Gönderilen konum, konum sahibi tarafından sıfırlandı.");
- DisablePlayerCheckpoint(Konum_Gonderilen[playerid]);
- Konum_Gonderen[Konum_Gonderilen[playerid]] = -1;
- Konum_Gonderilen[playerid] = -1;
- }
- else SendClientMessage(playerid, 0xFF0000FF, "[!] Sıfırlanacak konum bulunamadı.");
- return 1;
- }