[Include] Speed Radar
#1

DEPRECATED INCLUDE
Use this one instead: https://github.com/WiRR-/SA-MP-Radars/


Introduction:
Include for creation of speed radars, when a player pass trough radar above the speed limit the radar will be activated, it comes with a filter-script of example with some explanations to you learn more how to create a radar; with the filter-script is possible create radars in-game; Generate code ready to add in your script and save/load radars from files.

ChangeLOG
Код:
Version 2.1.1
• AttachRadarToPlayer(playerid, speedlimit);
• DettachRadarToPlayer(playerid);
• IsPlayerRadarAttached(playerid);
Version 2.1.0
• GetPlayerSpeed(playerid, bool:speed);
• GetVehicleSpeed(vehicleid);
Version 2.0.0
• LoadStaticRadarsFromFile(const filename[]);
Version 1.9.0
• SetRadarActivate(lrid, toggle);
• SetRadarMaxSpeed(lrid, speed);
• SetRadarRadius(lrid, Float:radius);
• SetRadarPickup(lrid, pickupid);
Version 1.8.0
• Radar can be switched to on and off.
Version 1.7.0
• Flash alternative may be defined radar with or without flash.
• Problems with flash fixed.
• Natives renamed.
• CallBack OnPlayerEnterRadar is now possible to define a single radar.
Version 1.6.0
• Changes in SetTimer time.
Version 1.5.0
• Small fixes.
Version 1.4.0
• Changes in stocks names.
Version 1.3.0
• CallBack OnPlayerEnterRadar now returns speed in which the player was on the radar.
Version 1.2.0
• Pickup can be changed.
• Radiation can be changed.
• Errors with destroy the radar fixed.
• Errors when changing the position of the radar fixed.
Version 1.1.0
• Changes in variables names.
Version 1.0.0
• First release.
Native List (last version):
pawn Код:
native CreateRadar(Float:x, Float:y, Float:z, speedmax, radiation, pickup, activated, virtualword = -1);
native DestroyRadar(lrid);
native RadarExists(lrid);
native SetRadarPos(lrid, Float:x, Float:y, Float:z);
native SetRadarVirtualWorld(lrid, virtualworld);
native SetRadarActivate(lrid, toggle);
native SetRadarMaxSpeed(lrid, speed);
native SetRadarRadius(lrid, Float:radiacao);
native SetRadarPickup(lrid, pickupid);
native GetRadarPos(lrid, &Float:x, &Float:y, &Float:z);
native GetRadarVirtualWorld(lrid);
native LoadStaticRadarsFromFile(const filename[]);
native GetPlayerSpeed(playerid, bool:speed);
native GetVehicleSpeed(vehicleid);
native AttachRadarToPlayer(playerid, speedlimit);
native DettachRadarToPlayer(playerid);
native IsPlayerRadarAttached(playerid);
How to use the flash:
Add function UseFlashRadar(); in your OnGameModeInit/OnFilterScriptInit.

How to use:
Add callback public OnPlayerEnterRadar(playerid, speed, radarid) in your script.
Add LSR_PlayerConnect(playerid); to public OnPlayerConnect(playerid);.

Example to use:
pawn Код:
#include "LSR"
//Includes the functions of the include to your script.
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);//Send a message to the player.
    GivePlayerMoney(playerid, -500);//Gets $500 of the player.
    return 1;
}
Video:


Pictures:

http://www.xfire.com/profile/grandla...view#104460960

Special Thanks to:
Woozie
[VGS]Protioso

Downloads:
[Include] - Pastebin (V2.1.1)
[Filterscript] - Pastebin (V2.1.1)
Scriptfiles

Older Versions:
Include:
[Include] - Pastebin (V2)
[Include] - Pastebin (1.9)
[Include] - Solidfiles (1.8)
[Include] - Pastebin (1.7)
[Include] - Solidfiles (1.7)
FilterScript:
[Filterscript] - Pastebin (V2)
[Filterscript] - Pastebin (1.9)
[Filterscript] - Solidfiles (1.8)
[Filterscript] - Solidfiles (1.7)
[Filterscript] - Pastebin (1.7)
Extras:
[Include] PGD - Protioso Gerenciamento de Dados
[Include] PSF - Protioso String Funзхes
Reply
#2

goow work.
Reply
#3

....
Reply
#4

Very usefull, thanks.
PLS anyone can upload a sample script please? ^^
Reply
#5

in downloads already has a sample script, a filterscript.
[Filterscript] - Solidfiles (1.7)
[Filterscript] - Pastbin (1.7)
there's two radars near hospital to test
Quote:

goow work.

Thanks !!

Quote:

NICE!
god for roleplay servers!

Thank you!

Quote:

Very usefull, thanks.

Thx!
Reply
#6

nice work !
Reply
#7

pictures added...
but, in the video you'll understand better about it.
Reply
#8

Hi !
When i try to compile the include or the filterscript, I have this error :
Код:
C:\SERVEUR - Blackwater\Serveur SAMP - RP 0.3x\pawno\include\LSR.pwn(368) : error 004: function "OnPlayerEnterRadar" is not implemented
Who can I help me ?
Thanks !
Reply
#9

1. Why does the flash display for SO long?
2. Why are there TWO camera flash sounds?
3. Why is there a massive arrow in the road?
4. You do realise what a radar is right? You're not 'attaching a radar' to a player.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)