07.12.2009, 02:54
Hey I am tryign to make this
Make it visible only to cops! The team id is 0
and the cmd to turn it on would ob
/raderon
and to turn it off
/raderoff
thanks!
pawn Код:
//Speedometer v1.2 by: Phento Samp0.3
#include <a_samp>
#define speedcolor 0x008080FF
new VehicleName[212][] = {
"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana",
"Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat",
"Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife",
"Trailer 1", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo",
"Seasparrow", "Pizzaboy", "Tram", "Trailer 2", "Turismo", "Speeder", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair",
"Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale", "Oceanic", "Sanchez", "Sparrow",
"Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX", "Burrito",
"Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper", "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring",
"Sandking", "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin", "Hotring Racer A", "Hotring Racer B",
"Bloodring Banger", "Rancher", "Super GT", "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster","Stunt", "Tanker",
"Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
"Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Freight", "Streak",
"Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck LA", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit",
"Utility", "Nevada", "Yosemite", "Windsor", "Monster A", "Monster B", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance",
"RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway",
"Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer 3", "Emperor", "Wayfarer", "Euros", "Hotdog",
"Club", "Freight Carriage", "Trailer 4", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car (LSPD)", "Police Car (SFPD)",
"Police Car (LVPD)", "Police Ranger", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer A",
"Luggage Trailer B", "Stairs", "Boxville", "Tiller", "Utility Trailer" };
new
PlayerText3D:speedo3Dtext,
Speedoff,
bool:OneCreateTextDraw[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("speedo loaded");
Speedoff = SetTimer("Speed", 800, 1);
return 1;
}
public OnPlayerConnect(playerid)
{
OneCreateTextDraw[playerid] = true;
return 1;
}
forward Speed();
public Speed()
{
new
wplayerid = 0,
GetPlayers = GetMaxPlayers();
while(wplayerid != GetPlayers)
{
if(IsPlayerConnected(wplayerid) && !IsPlayerNPC(wplayerid))
{
new
string[128],
VehicleID = GetPlayerVehicleID(wplayerid);
// printf("Connected wplayerid and No Npc ID: %d", wplayerid);
if(VehicleID)
{
new
Float:X,
Float:Y,
Float:Z,
Float:PointToPoint,
Float:vhealth;
GetVehicleVelocity(VehicleID, X, Y, Z);
PointToPoint = (floatsqroot(floatpower(X, 2) + floatpower(Y, 2) + floatpower(Z, 2)))*100;
GetVehicleHealth(VehicleID, vhealth);
format(string,sizeof string ,"Vehicle: %s\nHealth: %.2f\nSpeed: %ikm/h", VehicleName[GetVehicleModel(VehicleID)-400], vhealth, floatround(PointToPoint, floatround_floor));
if(OneCreateTextDraw[wplayerid] == true)
{
// printf("Create speedo3Dtext wplayerid: %d", wplayerid);
speedo3Dtext = CreatePlayer3DTextLabel(wplayerid, string, speedcolor, 0.0,-1.6,-0.35,20.0, INVALID_PLAYER_ID, VehicleID);
OneCreateTextDraw[wplayerid] = false;
}
UpdatePlayer3DTextLabelText(wplayerid, speedo3Dtext, speedcolor, string);
} else if(wplayerid) {
if(OneCreateTextDraw[wplayerid] == false)
{
// format(string,sizeof string," ");
// UpdatePlayer3DTextLabelText(p,speedo3Dtext, speedcolor, string);
// printf("Delete speedo3Dtext wplayerid: %d", wplayerid);
DeletePlayer3DTextLabel(wplayerid, speedo3Dtext);
OneCreateTextDraw[wplayerid] = true;
}
}
}
wplayerid++;
}
return 1;
}
public OnFilterScriptExit()
{
KillTimer(Speedoff);
for(new forplayerid; forplayerid < MAX_PLAYERS; forplayerid++)
{
DeletePlayer3DTextLabel(forplayerid, speedo3Dtext);
}
return 1;
}
and the cmd to turn it on would ob
/raderon
and to turn it off
/raderoff
thanks!