Guest User

Untitled

a guest
Jan 23rd, 2011
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.99 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4. #include <eum>
  5.  
  6. forward ProxDetector(Float:radi, playerid, string[], col1, col2, col3, col4, col5);
  7.  
  8. #define SCM SendClientMessage
  9. #define COLOR_FADE1 0xE6E6E6E6
  10. #define COLOR_FADE2 0xC8C8C8C8
  11. #define COLOR_FADE3 0xAAAAAAAA
  12. #define COLOR_FADE4 0x8C8C8C8C
  13. #define COLOR_FADE5 0x6E6E6E6E
  14.  
  15. public OnFilterScriptInit()
  16. {
  17.     print("\n----------");
  18.     print("[FS]Akcenat");
  19.     print("Credits:");
  20.     print("FS: black_dota");
  21.     print("[INC]EUM: Luka P.");
  22.     print("----------\n");
  23.     return 1;
  24. }
  25.  
  26. public OnPlayerRequestClass(playerid)
  27. {
  28.     SetPVarInt(playerid,"Akcenat",1);
  29.     return 1;
  30. }
  31.  
  32. COMMAND:akcenat(playerid,params[])
  33. {
  34.     SCM(playerid,COLOR_FADE1,"Biraj svoj Akcenat!");
  35.     EUM_ShowForPlayer(playerid, 333, ".::Biranje Akcenta::.", "Biraj akcenat:~n~1. Normalan~n~2. Engleski~n~3. Ruski~n~4. Spanski~n~5. Mexicki~n~6. Americki~n~7. Gangsterski~n~8. Irski~n~9. Kolumbijski~n~10. Japanski", 10);
  36.     return 1;
  37. }
  38.  
  39. public OnPlayerResponse(playerid, option)
  40. {
  41.     if(EUM_Indentify(playerid, 333))
  42.     {
  43.         switch(option)
  44.         {
  45.             case 1: SetPVarInt(playerid,"Akcenat",1), SCM(playerid,COLOR_FADE1,"Odabrao si Normalan Akcenat");
  46.             case 2: SetPVarInt(playerid,"Akcenat",2), SCM(playerid,COLOR_FADE1,"Odabrao si Engleski Akcenat");
  47.             case 3: SetPVarInt(playerid,"Akcenat",3), SCM(playerid,COLOR_FADE1,"Odabrao si Ruski Akcenat");
  48.             case 4: SetPVarInt(playerid,"Akcenat",4), SCM(playerid,COLOR_FADE1,"Odabrao si Spanski Akcenat");
  49.             case 5: SetPVarInt(playerid,"Akcenat",5), SCM(playerid,COLOR_FADE1,"Odabrao si Mexicki Akcenat");
  50.             case 6: SetPVarInt(playerid,"Akcenat",6), SCM(playerid,COLOR_FADE1,"Odabrao si Americki Akcenat");
  51.             case 7: SetPVarInt(playerid,"Akcenat",7), SCM(playerid,COLOR_FADE1,"Odabrao si Gangsterski Akcenat");
  52.             case 8: SetPVarInt(playerid,"Akcenat",8), SCM(playerid,COLOR_FADE1,"Odabrao si Irski Akcenat");
  53.             case 9: SetPVarInt(playerid,"Akcenat",9), SCM(playerid,COLOR_FADE1,"Odabrao si Kolumbijski Akcenat");
  54.             case 10: SetPVarInt(playerid,"Akcenat",10), SCM(playerid,COLOR_FADE1,"Odabrao si Japanski Akcenat");
  55.         }
  56.     }
  57.     EUM_DestroyForPlayer(playerid);
  58.     return 1;
  59. }
  60.  
  61. public OnPlayerText(playerid,text[])
  62. {
  63.     new chat[128];
  64.     new PlayerName[MAX_PLAYER_NAME];
  65.     GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
  66.  
  67.     if(GetPVarInt(playerid, "Akcenat") == 1)
  68.     {
  69.         format(chat, sizeof(chat), "%s kaže: %s", PlayerName, text);
  70.         ProxDetector(10.0, playerid, chat, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  71.         return 0;
  72.     }
  73.     if(GetPVarInt(playerid, "Akcenat") == 2)
  74.     {
  75.         format(chat, sizeof(chat), "%s kaže[Engleski]: %s", PlayerName, text);
  76.         ProxDetector(10.0, playerid, chat, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  77.         return 0;
  78.     }
  79.     if(GetPVarInt(playerid, "Akcenat") == 3)
  80.     {
  81.         format(chat, sizeof(chat), "%s kaže[Ruski]: %s", PlayerName, text);
  82.         ProxDetector(10.0, playerid, chat, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  83.         return 0;
  84.     }
  85.     if(GetPVarInt(playerid, "Akcenat") == 4)
  86.     {
  87.         format(chat, sizeof(chat), "%s kaže[Spanski]: %s", PlayerName, text);
  88.         ProxDetector(10.0, playerid, chat, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  89.         return 0;
  90.     }
  91.     if(GetPVarInt(playerid, "Akcenat") == 5)
  92.     {
  93.         format(chat, sizeof(chat), "%s kaže[Mexicki]: %s", PlayerName, text);
  94.         ProxDetector(10.0, playerid, chat, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  95.         return 0;
  96.     }
  97.     if(GetPVarInt(playerid, "Akcenat") == 6)
  98.     {
  99.         format(chat, sizeof(chat), "%s kaže[Americki]: %s", PlayerName, text);
  100.         ProxDetector(10.0, playerid, chat, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  101.         return 0;
  102.     }
  103.     if(GetPVarInt(playerid, "Akcenat") == 7)
  104.     {
  105.         format(chat, sizeof(chat), "%s kaže[Gangsterski]: %s", PlayerName, text);
  106.         ProxDetector(10.0, playerid, chat, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  107.         return 0;
  108.     }
  109.     if(GetPVarInt(playerid, "Akcenat") == 8)
  110.     {
  111.         format(chat, sizeof(chat), "%s kaže[Irski]: %s", PlayerName, text);
  112.         ProxDetector(10.0, playerid, chat, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  113.         return 0;
  114.     }
  115.     if(GetPVarInt(playerid, "Akcenat") == 9)
  116.     {
  117.         format(chat, sizeof(chat), "%s kaže[Kolumbijski]: %s", PlayerName, text);
  118.         ProxDetector(10.0, playerid, chat, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  119.         return 0;
  120.     }
  121.     if(GetPVarInt(playerid, "Akcenat") == 10)
  122.     {
  123.         format(chat, sizeof(chat), "%s kaže[Japanski]: %s", PlayerName, text);
  124.         ProxDetector(10.0, playerid, chat, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  125.         return 0;
  126.     }
  127.     return 1;
  128. }
  129.  
  130. public ProxDetector(Float:radi, playerid, string[], col1, col2, col3, col4, col5)
  131. {
  132.     if(IsPlayerConnected(playerid))
  133.     {
  134.         new Float:posx, Float:posy, Float:posz;
  135.         new Float:oldposx, Float:oldposy, Float:oldposz;
  136.         new Float:tempposx, Float:tempposy, Float:tempposz;
  137.  
  138.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  139.         //radi = 2.0; //Trigger Radius
  140.         for(new i = 0; i < MAX_PLAYERS; i++)
  141.         {
  142.             if(IsPlayerConnected(i))
  143.             {
  144.                 GetPlayerPos(i, posx, posy, posz);
  145.                 tempposx = (oldposx -posx);
  146.                 tempposy = (oldposy -posy);
  147.                 tempposz = (oldposz -posz);
  148.                 if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  149.                 {
  150.                     if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
  151.                     {
  152.                         SendClientMessage(i, col1, string);
  153.                     }
  154.                 }
  155.                 else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  156.                 {
  157.                     if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
  158.                     {
  159.                         SendClientMessage(i, col2, string);
  160.                     }
  161.                 }
  162.                 else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  163.                 {
  164.                     if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
  165.                     {
  166.                         SendClientMessage(i, col3, string);
  167.                     }
  168.                 }
  169.                 else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  170.                 {
  171.                     if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
  172.                     {
  173.                         SendClientMessage(i, col4, string);
  174.                     }
  175.                 }
  176.                 else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  177.                 {
  178.                     if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
  179.                     {
  180.                         SendClientMessage(i, col5, string);
  181.                     }
  182.                 }
  183.             }
  184.             else
  185.             {
  186.                 SendClientMessage(i, col1, string);
  187.             }
  188.         }
  189.     }//not connected
  190.     return 1;
  191. }
Advertisement
Add Comment
Please, Sign In to add comment