Advertisement
Guest User

LSR - V2.1.1 FS

a guest
Jan 1st, 2011
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.34 KB | None | 0 0
  1. /*           _             ______   ______ _______ ______  _     _
  2.             | |        /\ (_____ \ / _____|_______)  ___ \| |   | |
  3.             | |       /  \ _____) ) /      _____  | |   | | |___| |
  4.             | |      / /\ (_____ (| |     |  ___) | |   | |\_____/
  5.             | |_____| |__| |    | | \_____| |_____| |   | |  ___
  6.             |_______)______|    |_|\______)_______)_|   |_| (___)
  7.  
  8.             ________                 _________
  9.             __  ___/_______________________  /
  10.             _____ \___  __ \  _ \  _ \  __  /
  11.             ____/ /__  /_/ /  __/  __/ /_/ /
  12.             /____/ _  .___/\___/\___/\__,_/
  13.                    /_/
  14.  
  15.             |¯| /¯\ |¯\ /¯\ |¯|
  16.             |¯\ |¯| |_/ |¯| |¯\
  17.             Version 2!
  18. */
  19.  
  20. //Agradecimentos especiais a: ([VGS]PROTIOSO_OC)
  21.  
  22. #include "LSR"
  23. #include "PGD"
  24. #include "gl_common"
  25.  
  26. new radartest;
  27. new total_radares_from_files=0;
  28.  
  29. public OnPlayerConnect(playerid)
  30. {  
  31.     LSR_PlayerConnect(playerid);
  32.     return 1;
  33. }
  34.  
  35. public OnFilterScriptInit()
  36. {
  37.     UseFlashRadar();//Activates FLASH function.
  38.     CreateRadar(1257.644287, -1332.972900, 12.756792, 20, 50, 0, 1);//Radar with error. (First radar never works)
  39.     radartest = CreateRadar(1194.994995, -1279.451416, 13.152740, 20, 50, 1318, 1);//Radar near general hospital.
  40.     CreateRadar(1057.763549, -1366.322143, 13.189699, 20, 50, 1318, 1);//Radar behind general hospital.
  41.     total_radares_from_files += LoadStaticRadarsFromFile("radares/red_county.txt");//Load radars from red_county.txt file inside radars folder.
  42.     total_radares_from_files += LoadStaticRadarsFromFile("radares/radares_salvos.txt");//Load radars from radares_salvos.txt file inside radars folder.
  43.     print("[LSR:] Criador de radar carregado com sucesso.");//Sent a message on console saying that FS has been loaded sucefully.
  44.     printf("[LSR:] Total de radares em arquivos: %d",total_radares_from_files);//Sends a message on console showing how much radars was loaded in all files.
  45.     return 1;
  46. }
  47.  
  48. public OnPlayerEnterRadar(playerid, speed, radarid)//Callback that's called when a player pass on radar above speed limit.
  49. {
  50.     new string[128];//Array to keep the strings below.
  51.     if(radarid == radartest){format(string, sizeof(string), "[LSR:] You passed on my radar to %d km/h and lost $500.", speed);}//Message that will be sent to the player passed on radartest above speed limit.
  52.     else {format(string, sizeof(string), "[LSR:] You passed in any radar to %d km/h and lost $500.", speed);}//Message that will be sent to the player passed on radartest above speed limit.
  53.     SendClientMessage(playerid, 0xA9C4E4FF, string);//Sends a message to the player.
  54.     GivePlayerMoney(playerid, -500);//Gets $500 of the player.
  55.     return 1;
  56. }
  57.  
  58. public OnPlayerCommandText(playerid, cmdtext[])
  59. {
  60.     new idx, cmd[MAX_psf_strtok], comment[MAX_psf_strtok];//Variables, etc...
  61.     cmd = psf_strtok(cmdtext, idx);
  62.     if(!strcmp(cmd, "/saveradar", true))
  63.     {
  64.         cmd = psf_strtok(cmdtext, idx);
  65.         new speed;//Variable.
  66.         speed = strval(cmd);
  67.         cmd = psf_strtok(cmdtext, idx);
  68.         new radiation;//Variable.
  69.         radiation = strval(cmd);
  70.         comment = psf_strtok(cmdtext, idx);
  71.         if(!strlen(cmd)) return SendClientMessage(playerid, 0xAA3333AA, "[LSR:] /saveradar [speed limit] [radiation (default 20)] [comment]");//Mensagem de erro.
  72.         if(!strlen(cmd)) return SendClientMessage(playerid, 0xAA3333AA, "[LSR:] /saveradar [speed limit] [radiation (default 20)] [comment]");//Mensagem de erro.
  73.         if(!strlen(cmd)) return SendClientMessage(playerid, 0xAA3333AA, "[LSR:] /saveradar [speed limit] [radiation (default 20)] [comment]");//Mensagem de erro.
  74.         new Float:X, Float:Y, Float:Z, strf[128], strl[128];//Variables, etc..
  75.         GetPlayerPos(playerid, X, Y, Z);//Get Player Position (o'rly?).
  76.         format(strf, sizeof(strf), "CreateRadar(%f, %f, %f, %d, %d, 1318, 1);//%s\r\n", X, Y, Z, speed, radiation, cmd, comment);//string
  77.         pgd_EscreverArquivo("radares/codigos_salvos.txt", strf);//Saves code ready to add to the your script.
  78.         format(strl, sizeof(strl), "%f, %f, %f, %d, %d, 1318, 1, -1 ;\r\n", X, Y, Z, speed, radiation, cmd);//string
  79.         pgd_EscreverArquivo("radares/radares_salvos.txt", strl);//Saves the radar created and always will be loaded when filterscript starts.
  80.         CreateRadar(X, Y, Z, speed, radiation, 1318, 1);//Create a radar.
  81.         SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Radar Saved!");//Sends a message to the player that created radar.
  82.         return 1;
  83.     }
  84.     if(!strcmp(cmd, "/attachradar", true))
  85.     {
  86.         if(IsPlayerRadarAttached(playerid))return SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Você já tem um radar anexado a você.");
  87.         SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Um radar foi implantado em você, sempre que você ultrapassar 100km/h será multado.");
  88.         AttachRadarToPlayer(playerid, 100);
  89.         return 1;
  90.     }
  91.     if(!strcmp(cmd, "/dettachradar", true))
  92.     {
  93.         if(!IsPlayerRadarAttached(playerid))return SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Você não tem um radar anexado a você.");
  94.         SendClientMessage(playerid, 0x33AA33AA, "[LSR:] O radar foi retirado.");
  95.         DettachRadarToPlayer(playerid);
  96.         return 1;
  97.     }
  98.     if(!strcmp(cmd, "/credits", true))
  99.     {
  100.         SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Radars Script.");
  101.         SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Author: Larceny");
  102.         SendClientMessage(playerid, 0x33AA33AA, "[LSR:] lcsdegodoy@gmail.com");
  103.         return 1;
  104.     }
  105.     return 0;
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement