Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Textdraw'lı Pm Okuma Sistemi
- (¯`·.¸¸.-> °º Copyright haroldfinch - RuLing º° <-.¸¸.·´¯)
- Sistemin Amacı:
- Adminlerin "Pm Okuma, Hile Uyarısı" gibi özellikleri olan sunucu
- modlarında chat ekranında doğal olarak chat kirliliği oluyor.
- Bu sistem chat ekranının hemen altında o işlevi chat ekranı gibi
- yerine getiriyor.
- İyi Kullanımlar:)
- (¯`·.¸¸.-> °º V2 º° <-.¸¸.·´¯)
- Son Eklenenler:
- 1) Türkçe Karakter Problemi Çözüldü.
- 2) Otomatik Silme Eklendi.
- */
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- new giveplayerid;
- new PlayerName[24],
- GivePName[24];
- new tmp_txt[256],
- str[256],
- PMTXT=-1;
- new Text:Lines[8];
- new LinesText[8][128];
- main() {}
- public OnGameModeInit()
- {
- for(new j = 0; j < 7; j++)
- {
- Lines[j] = TextDrawCreate(3.000000, 250.000000 - j* 10, "");
- TextDrawBackgroundColor(Lines[j], 255);
- TextDrawFont(Lines[j], 1);
- TextDrawLetterSize(Lines[j], 0.200000, 1.100000);
- TextDrawTextSize(Lines[j], 640, 480);
- TextDrawColor(Lines[j], -1);
- TextDrawSetOutline(Lines[j], 1);
- TextDrawSetProportional(Lines[j], 1);
- LinesText[j] = "";
- TextDrawSetString(Lines[j], LinesText[j]);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- for(new j = 0; j < 7; j++)
- {
- TextDrawShowForPlayer(playerid, Lines[j]);
- }
- return 1;
- }
- COMMAND:pm(playerid, params[])
- {
- if(sscanf(params, "is[256]", giveplayerid, tmp_txt))
- return SendClientMessage(playerid, -1, "KULLANIM: /pm ID mesaj");
- if(!IsPlayerConnected(giveplayerid))
- return SendClientMessage(playerid, -1, "HATA: Belirtilen kullanıcı bulunamadı.");
- if(giveplayerid == playerid)
- return SendClientMessage(playerid, -1, "HATA: Kendi kendine PM gönderemezsin!");
- GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
- GetPlayerName(giveplayerid, GivePName, sizeof(GivePName));
- format(str, sizeof(str), "%s(%i) -> sen: %s", PlayerName, playerid, tmp_txt);
- SendClientMessage(giveplayerid, -1, str);
- format(str, sizeof(str), "sen -> %s(%i): %s", GivePName, giveplayerid, tmp_txt);
- SendClientMessage(playerid, -1, str);
- new j = 0;
- while(tmp_txt[j] != EOS)
- {
- if(tmp_txt[j] == '~') tmp_txt[j] = ' ';
- j++;
- }
- format(str, sizeof(str), "[PM] %s(%d) >> %s(%d): %s", PlayerName, playerid, GivePName, giveplayerid, tmp_txt);
- SendPMToBox(ConvertToTurkish(str));
- return 1;
- }
- // - Türkçe Karakterleri İngilizceye Çevirme
- stock ConvertToTurkish(txt[])
- {
- new converted_txt[256];
- strcat(converted_txt, txt);
- for (new i = 0; i < 256; i++)
- {
- switch (converted_txt[i])
- {
- case 'ğ': converted_txt[i] = 'g';
- case 'Ğ': converted_txt[i] = 'G';
- case 'ş': converted_txt[i] = 's';
- case 'Ş': converted_txt[i] = 'S';
- case 'ı': converted_txt[i] = 'i';
- case 'ö': converted_txt[i] = 'o';
- case 'Ö': converted_txt[i] = 'O';
- case 'ç': converted_txt[i] = 'c';
- case 'Ç': converted_txt[i] = 'C';
- case 'ü': converted_txt[i] = 'u';
- case 'Ü': converted_txt[i] = 'U';
- case 'İ': converted_txt[i] = 'I';
- }
- }
- return converted_txt;
- }
- stock SendPMToBox(msg[])
- {
- for(new j = 1; j < 7; j++)
- {
- format(LinesText[j - 1], 128, "%s", LinesText[j]);
- TextDrawSetString(Lines[j - 1], LinesText[j - 1]);
- }
- format(LinesText[6], 128, "%s", msg);
- TextDrawSetString(Lines[6], LinesText[6]);
- // - Mesajları Otomatik Silme
- if(PMTXT!=-1)KillTimer(PMTXT);
- PMTXT = -1;
- PMTXT = SetTimerEx("DeletePMToBox",3500,false,"d",0);
- }
- // - Mesajları Otomatik Silme
- forward DeletePMToBox(id);
- public DeletePMToBox(id)
- {
- for(new i=0;i<4;i++){
- LinesText[id][0] = EOS;
- TextDrawSetString(Lines[id],"");
- }
- if(id >=9)return 1;
- PMTXT = SetTimerEx("DeletePMToBox",3500,false,"d",id+1);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment