SpeedCamera Script - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SpeedCamera Script (
/showthread.php?tid=205246)
SpeedCamera Script -
Knight 47 - 31.12.2010
Hello i like to make a speedcamera system but he only prob is i dont know a good line for start with it because i have now (that coordinates are places where the cars comes)
this:
Pastebin
Re: SpeedCamera Script -
admantis - 31.12.2010
Under a timer, 1000 or 2000ms.
Re: SpeedCamera Script -
Knight 47 - 31.12.2010
What you mean? (i know how to make timers but)
Re: SpeedCamera Script -
admantis - 31.12.2010
Quote:
Originally Posted by Knight 47
What you mean? (i know how to make timers but)
|
....
run a timer
pawn Код:
forward chekspd(playerid);
public checkspd(playerid)
{
// your code
}
Re: SpeedCamera Script -
Knight 47 - 31.12.2010
it not realy works for me xD
Re: SpeedCamera Script -
admantis - 31.12.2010
Increase the range in 'IsPlayerInRangeOfPoint', make sure u made the timer correctly.. What it does is chek position.
Re: SpeedCamera Script -
Knight 47 - 31.12.2010
I have set the 'IsPlayerInRangeOfPoint' with 1 number after the , and still xD it fails with me. Can you maybe make a example of a corect timer
Re: SpeedCamera Script -
[MW2]Jµ§†пс - 31.12.2010
I know this is offtopic, but I doubt he even knows how to script, he wants to take your "example" of a speedcamera.
Re: SpeedCamera Script -
admantis - 01.01.2011
pawn Код:
// onplayerconnect
SetTimerEx("check_speed",500,true,"i",playerid);
forward check_speed(playerid);
public check_speed(playerid)
{
if (IsPlayerInRangeOfPoint(playerid, 20,1821.9,-1611.5,13.3) || IsPlayerInRangeOfPoint(playerid, 20,1821.6,-1747.4,13.3) || IsPlayerInRangeOfPoint(playerid, 20,1690.2,-1732.1,13.3) || IsPlayerInRangeOfPoint(playerid, 20,1689.0,-1592.3,13.37) || IsPlayerInRangeOfPoint(playerid, 20,1428.96,-1592.07,13.39) || IsPlayerInRangeOfPoint(playerid, 20,1429.64,-1731.93,13.38) || IsPlayerInRangeOfPoint(playerid, 20,1529.63,-1732.95,13.39))
{
if(IsPlayerConnected(playerid))
{
if(!IsPlayerInAnyVehicle(playerid))
{
new speed = GetPlayerSpeed(giveplayerid, true);
if(speed >= 121)
{
if(IsAPDMember(playerid) && PlayerInfo[playerid][pDBanned] == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "Check your speed");
}
if(IsAnFbi(playerid) && PlayerInfo[playerid][pDBanned] == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "Check your speed");
}
if(IsAnNg(playerid) && PlayerInfo[playerid][pDBanned] == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "Check your speed");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Busted: You have been captured by a SpeedCamera");
{WantedPoints[giveplayerid]+= 2; }
}
}
}
}
return 1;
}
Re: SpeedCamera Script -
Knight 47 - 01.01.2011
Quote:
Originally Posted by [MW2]Jµ§†пс
I know this is offtopic, but I doubt he even knows how to script
|
I know how to script but i had fail with my timer
i had set
SetTimerEx("speed1",1000,true,"i",playerid);
forward speed1(playerid);
public speed1(playerid)
{
//blablabla
but i was forgotten that i had to put forward ... for the main[] xD fail of me
But thx for help evryone