PASTEBIN MOORS.IN

გვერდების ძიება
ბოლოს დამატებული
Voice System [By Roma Janelidz
  1. //================== Voice System By: Roma Janelidze [Moors.in] ===============//
  2.  
  3.  
  4.  
  5. //============ NEWS ==============//
  6.  
  7. #include <sampvoice>
  8. new SV_LSTREAM:lstream[MAX_PLAYERS] = { SV_NULL, ... };
  9. new SV_GSTREAM:gstream[9999];
  10. new SV_GSTREAM:gstream1;
  11. new zariskodi[MAX_PLAYERS];
  12.  
  13.  
  14.  
  15. //====================== OnplayerConnect =================//
  16. if (!SvGetVersion(playerid)) SendClientMessage(playerid, -1, "Tqven ar giyeniat voice chat");
  17.         else if (!SvHasMicro(playerid)) SendClientMessage(playerid, -1, "Tqven ar gaqvt mikrofoni");
  18.         else if (isPlayerUsingVoice(playerid)) { // red color
  19.                 SendClientMessage(playerid, -1, "{E3801D}[Voice]{FFFFFF} Tqven sargeblobt voice chatit mis gamosayeneblad daachiret {E3801D}[Z]{FFFFFF}");
  20.                 SendClientMessage(playerid, -1, "{E3801D}[Voice]{FFFFFF} Chventan ayenia axali Voice sistema sanaxavad daweret {E3801D}[/voicehelp]{FFFFFF}");
  21.                 SvAddKey(playerid, 0x5A);//Z
  22.                 SvAddKey(playerid, 0x42);//B
  23.                 SvAddKey(playerid, 0x4A);//J
  24.                 SvAddKey(playerid, 0x58);//X
  25.                 SvAddKey(playerid, 0x4B);//K
  26.                 SvAddKey(playerid, 0x4D);//M
  27.                 if (gstream1) SvAttachListenerToStream(gstream1, playerid);
  28.         }
  29.  
  30.  
  31.  
  32. //=============== OnPlayerDisconnect ===============//
  33. if (lstream[playerid]) {
  34.                 SvDeleteStream(lstream[playerid]);
  35.                 lstream[playerid] = SV_NULL;
  36.         }
  37.  
  38.  
  39.  
  40.  
  41. //============ STOCK =====================//
  42. stock Voicechatebi()
  43. {
  44.     gstream[1] = SvCreateGStream(0x0800FFFF, "Police");
  45.     gstream[2] = SvCreateGStream(0x313131AA, "FBI");
  46.     gstream[3] = SvCreateGStream(0x68C421FF, "Army");
  47.     gstream[4] = SvCreateGStream(0xFF5757FF, "Medic");
  48.     gstream[5] = SvCreateGStream(0x9C0058FF, "Italian Mafia");
  49.     gstream[6] = SvCreateGStream(0xCC0000FF, "Yakuza");
  50.     gstream[7] = SvCreateGStream(0xD4FF00FF, "City Hall");
  51.     gstream[11] = SvCreateGStream(0x139BECFF, "Avtoskola");
  52.     gstream[12] = SvCreateGStream(0xAA00B0AA, "Ballas");
  53.     gstream[13] = SvCreateGStream(0xFFC929AA, "Vagos");
  54.     gstream[14] = SvCreateGStream(0x00B3A7FF, "Russian Mafia");
  55.     gstream[15] = SvCreateGStream(0x00C72EAA, "Grove");
  56.     gstream[16] = SvCreateGStream(0xFF9500AA, "Mass Media");
  57.     gstream[17] = SvCreateGStream(0x00DDFFAA, "Azteca");
  58.     gstream[18] = SvCreateGStream(0x8F33FFAA, "Rifa");
  59.     gstream[22] = SvCreateGStream(0x3BB171AA, "48 Street");
  60.     gstream[33] = SvCreateGStream(0xFF8000FF, "Departament");
  61.     gstream[99] = SvCreateGStream(0xFF0000FF, "Adminstration");
  62.     gstream1 = SvCreateGStream(0x2015EAFF, "OOC/Admin");
  63. }
  64.  
  65.  
  66.  
  67. stock isPlayerUsingVoice(playerid)
  68. {
  69.         lstream[playerid] = SvCreateDLStreamAtPlayer(20.0, SV_INFINITY, playerid, 0xff0000ff, "L");
  70.         return lstream[playerid];
  71. }
  72.  
  73.  
  74.  
  75. //===================== OnGamemodeInit ==================//
  76. Voicechatebi();
  77.  
  78.  
  79.  
  80.  
  81.  
  82. //=================== CMD =============================//
  83.  
  84. CMD:voicehelp(playerid, params[])
  85. {
  86.         ShowPlayerDialog(playerid, INVALID_DIALOG_ID, DIALOG_STYLE_MSGBOX, "Voice Help", "{E3801D}[1]{FFFFFF} /vr - Fraqciis Chatebshi shesvla Sasaubrod [J]n{E3801D}[2]{FFFFFF} {FFFFFF} /vd - Departament Chatebshi Shesvla Sasaubrod [X]n{E3801D}[3]{FFFFFF} /va - AdminVoice [K]n{E3801D}[4]{FFFFFF} /voo - AdminSaerto [M]n{E3801D}[5]{FFFFFF} /vend - /vr,/vd,/va  Chatebidan gamosvla", "CLOSE", "");
  87.         return true;
  88. }
  89.  
  90. CMD:voo(playerid, params[])
  91. {
  92.         if(PlayerInfo[playerid][pAdmin] < 6) return true;
  93.     SvAttachSpeakerToStream(gstream1, playerid);
  94.     SetPVarInt(playerid,"AdminisSaerto",1);
  95.         new strings[200];
  96.     format(strings,sizeof(strings),"{E3801D}[Voice System] {0F73B0} Administratori %s Chaerto Yvelas VOICE'shi ((Gasatishad /vend, Axlidan Mosasmenad /mosmena))",Name(playerid));
  97.     SendClientMessageToAll(0x159D89FF,strings);
  98.     for(new i; i<MAX_PLAYERS; i++)
  99.         {
  100.             SvAttachListenerToStream(gstream1, i);
  101.         }
  102.         SvDetachListenerFromStream(gstream1, playerid);
  103.         SendClientMessage(playerid,0x159D89FF,"Sasaubrod Gilaki [M] ((gasatishad dawere /vend))");
  104.         return true;
  105. }
  106. CMD:mosmena(playerid, params[]) return SvAttachListenerToStream(gstream1, playerid), SendClientMessage(playerid,COLOR_GREEN,"Tqven shemoxvedit Saerto Voiceshi ((Gasasvlelad /vend))");
  107. CMD:va(playerid, params[])
  108. {
  109.         if(!PlayerInfo[playerid][pLogin] || PlayerInfo[playerid][pAdmin] == 0) return 1;
  110.     if(GetPVarInt(playerid,"VaChartuliaqvs") == 0)
  111.         {
  112.                 zariskodi[playerid] = 99;
  113.             SetPVarInt(playerid,"ARaciebis",zariskodi[playerid]);
  114.             SetPVarInt(playerid,"VaChartuliaqvs",1);
  115.             SvAttachListenerToStream(gstream[zariskodi[playerid]], playerid);
  116.             SendClientMessage(playerid,COLOR_GREEN,"Tqven Chaertet Admin Raciebis Voiceshi. Gilaki [K] ((Gasatishad /vend))");
  117.             return true;
  118.     }
  119.         return true;
  120. }
  121. CMD:vr(playerid, params[])
  122. {
  123.     if(!PlayerInfo[playerid][pLogin] || PlayerInfo[playerid][pMember] == 0) return 1;
  124.         if(PlayerInfo[playerid][pMuted]) return SendClientMessage(playerid, -1, "["GameMode"] Tqven gadevt chatis bani.");
  125.         if(GetPVarInt(playerid,"Chartuliaqvs") == 0)
  126.         {
  127.                 zariskodi[playerid] = PlayerInfo[playerid][pMember];
  128.             SetPVarInt(playerid,"Raciebis",zariskodi[playerid]);
  129.             SetPVarInt(playerid,"RChartuliaqvs",1);
  130.             SvAttachListenerToStream(gstream[zariskodi[playerid]], playerid);
  131.             SendClientMessage(playerid,COLOR_GREEN,"Tqven Chaertet Raciebis Voiceshi. Gilaki [J] ((Gasatishad /vend))");
  132.             return true;
  133.     }
  134.         return true;
  135. }
  136. CMD:vend(playerid,params[])
  137. {
  138.         for(new i = 0; i < 100; i++)
  139.         {
  140.     SvDetachSpeakerFromStream(gstream[i], playerid);
  141.     SvDetachListenerFromStream(gstream[i], playerid);
  142.     }
  143.     SvDetachSpeakerFromStream(gstream1, playerid);
  144.     SvDetachListenerFromStream(gstream1, playerid);
  145.         DeletePVar(playerid,"DChartuliaqvs");
  146.         DeletePVar(playerid,"VaChartuliaqvs");
  147.         DeletePVar(playerid,"RChartuliaqvs");
  148.         DeletePVar(playerid,"Raciebis");
  149.         DeletePVar(playerid,"DRaciebis");
  150.         DeletePVar(playerid,"ARaciebis");
  151.         DeletePVar(playerid,"AdminisSaerto");
  152.         zariskodi[playerid] = 0;
  153.         SendClientMessage(playerid,COLOR_GREEN,"Tqven Gamoxvedit Raciebis Voicedan");
  154.     return true;
  155. }
  156. CMD:vd(playerid, params[])
  157. {
  158.     if(!PlayerInfo[playerid][pLogin] || !memberOfGovFrac(playerid) || !FormaFrac[playerid]) return 1;
  159.         if(PlayerInfo[playerid][pMuted]) return SendClientMessage(playerid, -1, "["GameMode"] Tqven gadevt chatis bani.");
  160.     if(GetPVarInt(playerid,"DChartuliaqvs") == 0)
  161.         {
  162.                 zariskodi[playerid] = 33;
  163.             SetPVarInt(playerid,"DRaciebis",zariskodi[playerid]);
  164.             SetPVarInt(playerid,"DChartuliaqvs",1);
  165.             SvAttachListenerToStream(gstream[zariskodi[playerid]], playerid);
  166.             SendClientMessage(playerid,COLOR_GREEN,"Tqven Chaertet Departament Raciebis Voiceshi. Gilaki [X] ((Gasatishad /vend))");
  167.             return true;
  168.     }
  169.         return true;
  170. }
  171.  
  172.  
  173.  
  174.  
  175. //====================== Public ==========================//
  176.  
  177. public SV_VOID:OnPlayerActivationKeyPress(
  178.         SV_UINT:playerid,
  179.         SV_UINT:keyid
  180. ) {
  181.         if (keyid == 0x5A && lstream[playerid]) SvAttachSpeakerToStream(lstream[playerid], playerid);//Z aso
  182.         if(GetPVarInt(playerid,"AdminisSaerto") == 1)
  183.         {
  184.                 if (keyid == 0x4D && gstream1) SvAttachSpeakerToStream(gstream1, playerid);//M AdminisSaerto
  185.         }
  186.         if(GetPVarInt(playerid,"Raciebis") == zariskodi[playerid])//J aso
  187.         {
  188.             if (keyid == 0x4A && gstream[zariskodi[playerid]] && GetPVarInt(playerid,"RChartuliaqvs") == 1) SvAttachSpeakerToStream(gstream[zariskodi[playerid]], playerid);
  189.         }
  190.         else if(GetPVarInt(playerid,"DRaciebis") == zariskodi[playerid])//X Aso
  191.         {
  192.             if (keyid == 0x58 && gstream[zariskodi[playerid]]  && GetPVarInt(playerid,"DChartuliaqvs") == 1) SvAttachSpeakerToStream(gstream[zariskodi[playerid]], playerid);
  193.         }
  194.         else if(GetPVarInt(playerid,"ARaciebis") == zariskodi[playerid])//K Aso
  195.         {
  196.             if (keyid == 0x4B && gstream[zariskodi[playerid]] && GetPVarInt(playerid,"VaChartuliaqvs") == 1) SvAttachSpeakerToStream(gstream[zariskodi[playerid]], playerid);
  197.         }
  198. }
  199.  
  200. public SV_VOID:OnPlayerActivationKeyRelease(
  201.         SV_UINT:playerid,
  202.         SV_UINT:keyid
  203. ) {
  204.         if (keyid == 0x5A && lstream[playerid]) SvDetachSpeakerFromStream(lstream[playerid], playerid);//Z Aso
  205.         if(GetPVarInt(playerid,"AdminisSaerto") == 1)
  206.         {
  207.                 if (keyid == 0x4D && gstream1) SvDetachSpeakerFromStream(gstream1, playerid);//M
  208.         }
  209.         if(GetPVarInt(playerid,"Raciebis") == zariskodi[playerid])//J aso
  210.         {
  211.             if (keyid == 0x4A && gstream[zariskodi[playerid]] && GetPVarInt(playerid,"RChartuliaqvs") == 1) SvDetachSpeakerFromStream(gstream[zariskodi[playerid]], playerid);
  212.         }
  213.         else if(GetPVarInt(playerid,"DRaciebis") == zariskodi[playerid])//X Aso
  214.         {
  215.             if (keyid == 0x58 && gstream[zariskodi[playerid]] && GetPVarInt(playerid,"DChartuliaqvs") == 1) SvDetachSpeakerFromStream(gstream[zariskodi[playerid]], playerid);
  216.         }
  217.         else if(GetPVarInt(playerid,"ARaciebis") == zariskodi[playerid])//K Aso
  218.         {
  219.             if (keyid == 0x4B && gstream[zariskodi[playerid]] && GetPVarInt(playerid,"VaChartuliaqvs") == 1) SvDetachSpeakerFromStream(gstream[zariskodi[playerid]], playerid);
  220.         }
  221. }
  222.  
Parsed in 0.044 seconds