Advertisement
Guest User

LSR - V2.0 FS

a guest
Dec 27th, 2010
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.58 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 OnFilterScriptInit()
  30. {
  31.     UseFlashRadar();//Activates FLASH function.
  32.     CreateRadar(1257.644287, -1332.972900, 12.756792, 20, 50, 0, 1);//Radar with error. (First radar never works)
  33.     radartest = CreateRadar(1194.994995, -1279.451416, 13.152740, 20, 50, 1318, 1);//Radar near general hospital.
  34.     CreateRadar(1057.763549, -1366.322143, 13.189699, 20, 50, 1318, 1);//Radar behind general hospital.
  35.     total_radares_from_files += LoadStaticRadarsFromFile("radares/red_county.txt");//Load radars from red_county.txt file inside radars folder.
  36.     total_radares_from_files += LoadStaticRadarsFromFile("radares/radares_salvos.txt");//Load radars from radares_salvos.txt file inside radars folder.
  37.     print("[LSR:] Criador de radar carregado com sucesso.");//Sent a message on console saying that FS has been loaded sucefully.
  38.     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.
  39.     return 1;
  40. }
  41.  
  42. public OnPlayerEnterRadar(playerid, speed, radarid)//Callback that's called when a player pass on radar above speed limit.
  43. {
  44.     new string[128];//Array to keep the strings below.
  45.     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.
  46.     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.
  47.     SendClientMessage(playerid, 0xA9C4E4FF, string);//Sends a message to the player.
  48.     GivePlayerMoney(playerid, -500);//Gets $500 of the player.
  49.     return 1;
  50. }
  51.  
  52. public OnPlayerCommandText(playerid, cmdtext[])
  53. {
  54.     new idx, cmd[MAX_psf_strtok], comment[MAX_psf_strtok];//Variables, etc...
  55.     cmd = psf_strtok(cmdtext, idx);
  56.     if(!strcmp(cmd, "/saveradar", true))
  57.     {
  58.         cmd = psf_strtok(cmdtext, idx);
  59.         new speed;//Variable.
  60.         speed = strval(cmd);
  61.         cmd = psf_strtok(cmdtext, idx);
  62.         new radiation;//Variable.
  63.         radiation = strval(cmd);
  64.         comment = psf_strtok(cmdtext, idx);
  65.         if(!strlen(cmd)) return SendClientMessage(playerid, 0xAA3333AA, "[LSR:] /saveradar [speed limit] [radiation (default 20)] [comment]");//Mensagem de erro.
  66.         if(!strlen(cmd)) return SendClientMessage(playerid, 0xAA3333AA, "[LSR:] /saveradar [speed limit] [radiation (default 20)] [comment]");//Mensagem de erro.
  67.         if(!strlen(cmd)) return SendClientMessage(playerid, 0xAA3333AA, "[LSR:] /saveradar [speed limit] [radiation (default 20)] [comment]");//Mensagem de erro.
  68.         new Float:X, Float:Y, Float:Z, strf[128], strl[128];//Variables, etc..
  69.         GetPlayerPos(playerid, X, Y, Z);//Get Player Position (o'rly?).
  70.         format(strf, sizeof(strf), "CreateRadar(%f, %f, %f, %d, %d, 1318, 1);//%s\r\n", X, Y, Z, speed, radiation, cmd, comment);//string
  71.         pgd_EscreverArquivo("radares/codigos_salvos.txt", strf);//Saves code ready to add to the your script.
  72.         format(strl, sizeof(strl), "%f, %f, %f, %d, %d, 1318, 1, -1 ;\r\n", X, Y, Z, speed, radiation, cmd);//string
  73.         pgd_EscreverArquivo("radares/radares_salvos.txt", strl);//Saves the radar created and always will be loaded when filterscript starts.
  74.         CreateRadar(X, Y, Z, speed, radiation, 1318, 1);//Create a radar.
  75.         SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Radar Saved!");//Sends a message to the player that created radar.
  76.         return 1;
  77.     }
  78.     if(!strcmp(cmd, "/credits", true))
  79.     {
  80.         SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Radars Script.");
  81.         SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Author: Larceny");
  82.         SendClientMessage(playerid, 0x33AA33AA, "[LSR:] lcsdegodoy@gmail.com");
  83.         return 1;
  84.     }
  85.     return 0;
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement