Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* _ ______ ______ _______ ______ _ _
- | | /\ (_____ \ / _____|_______) ___ \| | | |
- | | / \ _____) ) / _____ | | | | |___| |
- | | / /\ (_____ (| | | ___) | | | |\_____/
- | |_____| |__| | | | \_____| |_____| | | | ___
- |_______)______| |_|\______)_______)_| |_| (___)
- ________ _________
- __ ___/_______________________ /
- _____ \___ __ \ _ \ _ \ __ /
- ____/ /__ /_/ / __/ __/ /_/ /
- /____/ _ .___/\___/\___/\__,_/
- /_/
- |¯| /¯\ |¯\ /¯\ |¯|
- |¯\ |¯| |_/ |¯| |¯\
- Version 2!
- */
- //Agradecimentos especiais a: ([VGS]PROTIOSO_OC)
- #include "LSR"
- #include "PGD"
- #include "gl_common"
- new radartest;
- new total_radares_from_files=0;
- public OnPlayerConnect(playerid)
- {
- LSR_PlayerConnect(playerid);
- return 1;
- }
- public OnFilterScriptInit()
- {
- UseFlashRadar();//Activates FLASH function.
- CreateRadar(1257.644287, -1332.972900, 12.756792, 20, 50, 0, 1);//Radar with error. (First radar never works)
- radartest = CreateRadar(1194.994995, -1279.451416, 13.152740, 20, 50, 1318, 1);//Radar near general hospital.
- CreateRadar(1057.763549, -1366.322143, 13.189699, 20, 50, 1318, 1);//Radar behind general hospital.
- total_radares_from_files += LoadStaticRadarsFromFile("radares/red_county.txt");//Load radars from red_county.txt file inside radars folder.
- total_radares_from_files += LoadStaticRadarsFromFile("radares/radares_salvos.txt");//Load radars from radares_salvos.txt file inside radars folder.
- print("[LSR:] Criador de radar carregado com sucesso.");//Sent a message on console saying that FS has been loaded sucefully.
- 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.
- return 1;
- }
- public OnPlayerEnterRadar(playerid, speed, radarid)//Callback that's called when a player pass on radar above speed limit.
- {
- new string[128];//Array to keep the strings below.
- 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.
- 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.
- SendClientMessage(playerid, 0xA9C4E4FF, string);//Sends a message to the player.
- GivePlayerMoney(playerid, -500);//Gets $500 of the player.
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new idx, cmd[MAX_psf_strtok], comment[MAX_psf_strtok];//Variables, etc...
- cmd = psf_strtok(cmdtext, idx);
- if(!strcmp(cmd, "/saveradar", true))
- {
- cmd = psf_strtok(cmdtext, idx);
- new speed;//Variable.
- speed = strval(cmd);
- cmd = psf_strtok(cmdtext, idx);
- new radiation;//Variable.
- radiation = strval(cmd);
- comment = psf_strtok(cmdtext, idx);
- if(!strlen(cmd)) return SendClientMessage(playerid, 0xAA3333AA, "[LSR:] /saveradar [speed limit] [radiation (default 20)] [comment]");//Mensagem de erro.
- if(!strlen(cmd)) return SendClientMessage(playerid, 0xAA3333AA, "[LSR:] /saveradar [speed limit] [radiation (default 20)] [comment]");//Mensagem de erro.
- if(!strlen(cmd)) return SendClientMessage(playerid, 0xAA3333AA, "[LSR:] /saveradar [speed limit] [radiation (default 20)] [comment]");//Mensagem de erro.
- new Float:X, Float:Y, Float:Z, strf[128], strl[128];//Variables, etc..
- GetPlayerPos(playerid, X, Y, Z);//Get Player Position (o'rly?).
- format(strf, sizeof(strf), "CreateRadar(%f, %f, %f, %d, %d, 1318, 1);//%s\r\n", X, Y, Z, speed, radiation, cmd, comment);//string
- pgd_EscreverArquivo("radares/codigos_salvos.txt", strf);//Saves code ready to add to the your script.
- format(strl, sizeof(strl), "%f, %f, %f, %d, %d, 1318, 1, -1 ;\r\n", X, Y, Z, speed, radiation, cmd);//string
- pgd_EscreverArquivo("radares/radares_salvos.txt", strl);//Saves the radar created and always will be loaded when filterscript starts.
- CreateRadar(X, Y, Z, speed, radiation, 1318, 1);//Create a radar.
- SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Radar Saved!");//Sends a message to the player that created radar.
- return 1;
- }
- if(!strcmp(cmd, "/attachradar", true))
- {
- if(IsPlayerRadarAttached(playerid))return SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Você já tem um radar anexado a você.");
- SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Um radar foi implantado em você, sempre que você ultrapassar 100km/h será multado.");
- AttachRadarToPlayer(playerid, 100);
- return 1;
- }
- if(!strcmp(cmd, "/dettachradar", true))
- {
- if(!IsPlayerRadarAttached(playerid))return SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Você não tem um radar anexado a você.");
- SendClientMessage(playerid, 0x33AA33AA, "[LSR:] O radar foi retirado.");
- DettachRadarToPlayer(playerid);
- return 1;
- }
- if(!strcmp(cmd, "/credits", true))
- {
- SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Radars Script.");
- SendClientMessage(playerid, 0x33AA33AA, "[LSR:] Author: Larceny");
- SendClientMessage(playerid, 0x33AA33AA, "[LSR:] lcsdegodoy@gmail.com");
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement