Police Speed Radar!
#1

Ok, SO I was thinking of making a Radar for the Police so they could see the speed of a player. Like in some admin Scripts. It Syas something like " Admin warning: Playername is going 133 miles an hour" or what ever. I have attempted 2 times and have failed both times.

Any help is appreciated
Reply
#2

** BUMP **
Reply
#3

Anyone?

OFF TOPIC:

Yes sometime's I am In patiant
Reply
#4

Wow, you are impatient.. Nope sorry can't help you.. Well, maybe I can :O

Code:
stock GetPlayerSpeed(playerid) // bottom of your script
{
    new Float:X, Float:Y, Float:Z;
    if(IsPlayerInAnyVehicle(playerid))
    {
        GetVehicleVelocity(GetPlayerVehicleID(playerid), X, Y, Z);
        return floatround(floatmul(floatmul(floatsqroot(floatpower(floatabs(X), 2) + floatpower(floatabs(Y), 2) + floatpower(floatabs(Z), 2)), 100), 1.621371192), floatround_round);
    }
    else
    {
        GetPlayerVelocity(playerid, X, Y, Z);
        return floatround(floatmul(floatmul(floatsqroot(floatpower(floatabs(X), 2) + floatpower(floatabs(Y), 2) + floatpower(floatabs(Z), 2)), 100), 1.621371192), floatround_round);
    }
}
You can add this somewhere, at a command or something, I'm sure you understand this
Code:
new Str[128];
format(Str, sizeof(Str), "You are driving %d km/hour!", GetPlayerSpeed(playerid));
SendClientMessage(playerid, Str);
return 1;
THIS IS NOT MADE BY ME, AND I DIDN'T TEST IT! IT HAS BEEN MADE BY "WANTED".
Reply
#5

FAIL:

You are driving %d km/hour!

He asked that police can see other players speed not his own.
Reply
#6

lol, Thanks for teh attempt tho!
Reply
#7

Quote:
Originally Posted by addinol
FAIL:

You are driving %d km/hour!

He asked that police can see other players speed not his own.
He could tweak it, smartass..

Code:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[128], idx;
	cmd = strtok(cmdtext, idx);
	new tmp[128];
	if(strcmp(cmd, "/speed", true) == 0)
	{
	  if(gteam == TEAM_LSPD)
	  {
		  tmp = strtok(cmdtext, idx);
		  if(!strlen(tmp)) return SendClientMessage(playerid,0xFF0000AA, "USAGE: /speed [id]");
	    new Str[128], iName[MAX_PLAYER_NAME], id;
	    id = strval(tmp);
			format(Str, sizeof(Str), "%s is driving %d km/hour.", iName, GetPlayerSpeed(id));
			SendClientMessage(playerid, 0xFF0000AA, Str);
		}
		else
		{
		  SendClientMessage(playerid,0xFF0000AA, "You are not a cop!");
		}
		return 1;
	}
	return 0;
}
UNTESTED
Reply
#8

Quote:
Originally Posted by VonLeeuwen
Code:
stock GetPlayerSpeed(playerid)
{
  new Float:X, Float:Y, Float:Z;
  if(IsPlayerInAnyVehicle(playerid))
  {
    GetVehicleVelocity(GetPlayerVehicleID(playerid), X, Y, Z);
    return floatround(floatmul(floatmul(floatsqroot(floatpower(floatabs(X), 2) + floatpower(floatabs(Y), 2) + floatpower(floatabs(Z), 2)), 100), 1.621371192), floatround_round);
  }
  else
  {
    GetPlayerVelocity(playerid, X, Y, Z);
    return floatround(floatmul(floatmul(floatsqroot(floatpower(floatabs(X), 2) + floatpower(floatabs(Y), 2) + floatpower(floatabs(Z), 2)), 100), 1.621371192), floatround_round);
  }
}
Woah, This really returns the players speed/vehicle speed in km/h?
Reply
#9

The guy who made it says so, yes.

The guy who made this is called 'WANTED' and is from the Netherlands. It is not made by me.. (just saying it again :P)
Reply
#10

Quote:
Originally Posted by VonLeeuwen
The guy who made it says so, yes.
Nice


Off Topic:
Quote:
Originally Posted by addinol
FAIL:

You are driving %d km/hour!
He asked that police can see other players speed not his own.
Come up with something better yourself instead of just saying fail...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)