[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


Messages In This Thread
Speed Radar - by Shelby - 20.09.2010, 13:44
Re: Speed Radar - by mr.snk - 20.09.2010, 13:47
Re: Speed Radar - by Eirikm - 20.09.2010, 13:47
Re: Speed Radar - by Silent.Hunter - 20.09.2010, 15:30
Re: Speed Radar - by Shelby - 20.09.2010, 15:43
Re: Speed Radar - by Hip-hop - 20.09.2010, 18:31
Re: Speed Radar - by Shelby - 20.09.2010, 20:48
Re : Speed Radar - by Romaindu14930 - 15.05.2013, 18:34
Re: Speed Radar - by MP2 - 15.05.2013, 19:46

Forum Jump:


Users browsing this thread: 1 Guest(s)