15.07.2010, 20:13
pawn Код:
if(!IsPlayerInAnyVehicle(i))
{
new LocationZone[MAX_ZONE_NAME],String[128];
GetPlayer2DZone(i, LocationZone, MAX_ZONE_NAME);
GetPlayerPos(i, X, Y, Z);
format(String,sizeof(String),"Gps~g~: ~y~%s", LocationZone);
}
pawn Код:
public CheckStatus()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i))
{
if(Speed_Text_Show_For_CB_Player[i] == false)
{
Speed_Text_Show_For_CB_Player[i] = true;
}
new Float:Speed;
new String[128];
GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z);
Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)), floatpower(Z, 2))), 200.0); //100.0
new LocationZone[MAX_ZONE_NAME];
GetPlayer2DZone(i, LocationZone, MAX_ZONE_NAME);
GetPlayerPos(i, X, Y, Z);
new PlayerVehicleModelID = GetVehicleModel(GetPlayerVehicleID(i));
PlayerVehicleModelID -= 400;
format(String,sizeof(String),"~n~~R~Vehicle~g~: ~y~%s ~b~- ~r~Gps~g~: ~y~%s ~r~Speed~g~: ~y~%i", PlayerVehicle[PlayerVehicleModelID], LocationZone,floatround(floatdiv(Speed, 1.609344), floatround_floor), floatround(Speed, floatround_floor));
if(Vehicle_Speed_StringCreated[i] == true)
{
TextDrawDestroy(Vehicle_Speed_String[i]);
}
Vehicle_Speed_String[i] = TextDrawCreate(150.000000,420.000000,String);
TextDrawAlignment(Vehicle_Speed_String[i],0);
TextDrawTextSize(Vehicle_Speed_String[i],600.000000,0.000000);
TextDrawBackgroundColor(Vehicle_Speed_String[i],0x000000ff);
TextDrawFont(Vehicle_Speed_String[i],1);
TextDrawLetterSize(Vehicle_Speed_String[i],0.299999,1.000000);
TextDrawColor(Vehicle_Speed_String[i],0xffffffff);
TextDrawSetOutline(Vehicle_Speed_String[i],1);
TextDrawSetProportional(Vehicle_Speed_String[i],1);
TextDrawSetShadow(Vehicle_Speed_String[i],1);
TextDrawShowForPlayer(i, Vehicle_Speed_String[i]);
Vehicle_Speed_StringCreated[i] = true;
}
else
{
if(Speed_Text_Show_For_CB_Player[i] == true)
{
Speed_Text_Show_For_CB_Player[i] = false;
}
TextDrawHideForPlayer(i, Text:Vehicle_Speed_String[i]);
}
if(!IsPlayerInAnyVehicle(i))
{
new LocationZone[MAX_ZONE_NAME],String[128];
GetPlayer2DZone(i, LocationZone, MAX_ZONE_NAME);
GetPlayerPos(i, X, Y, Z);
format(String,sizeof(String),"Gps~g~: ~y~%s", LocationZone);
}
}
}
}