29.04.2014, 01:33
(
Последний раз редактировалось comanfiss; 01.05.2014 в 04:29.
Причина: speedometer[FS] PPC_trucking
)
to people with a speedometer here only he did not okay according to the speedometer GMtrucking.
160 so it will be possible to put up 240 PF thank all.....
I would like to adapt the speedometer on GMPPC_Trucking.
is [FS]
160 so it will be possible to put up 240 PF thank all.....
I would like to adapt the speedometer on GMPPC_Trucking.
is [FS]
pawn Код:
#include <a_samp>
enum td
{
Text:TDSpeedClock[10]
}
new TextDraws[td];
new Text:TextDrawsd[MAX_PLAYERS][4];
new DeActiveSpeedometer[MAX_PLAYERS];
public OnGameModeExit()
{
return 1;
}
public OnFilterScriptInit()
{
TextDraws[TDSpeedClock][0] = TextDrawCreate(491.000000,393.000000,"~g~20");
TextDraws[TDSpeedClock][1] = TextDrawCreate(487.000000,372.000000,"~g~40");
TextDraws[TDSpeedClock][2] = TextDrawCreate(491.000000,351.000000,"~g~60");
TextDraws[TDSpeedClock][3] = TextDrawCreate(524.000000,338.000000,"~g~80");
TextDraws[TDSpeedClock][4] = TextDrawCreate(564.000000,341.000000,"~g~100");
TextDraws[TDSpeedClock][5] = TextDrawCreate(594.000000,360.500000,"~b~120");
TextDraws[TDSpeedClock][6] = TextDrawCreate(591.000000,383.000000,"~b~140");
TextDraws[TDSpeedClock][7] = TextDrawCreate(578.000000,402.000000,"~b~160");
TextDraws[TDSpeedClock][8] = TextDrawCreate(534.000000,396.000000,"~r~/ \\");
TextDraws[TDSpeedClock][9] = TextDrawCreate(548.000000,401.000000,".");
TextDrawLetterSize(TextDraws[TDSpeedClock][8], 1.059999, 2.100000);
TextDrawLetterSize(TextDraws[TDSpeedClock][9], 0.73, -2.60);
for(new i; i < 10; i++)
{
TextDrawSetShadow(TextDraws[TDSpeedClock][i], 1);
TextDrawSetOutline(TextDraws[TDSpeedClock][i], 0);
}
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext[1], "velocimetroa", false) == 0)
{
new strOptionInfo[2][37]=
{
"* Velocнmetro analуgico ativado!",
"* Velocнmetro analуgico desativado!"
};
DeActiveSpeedometer[playerid] = !DeActiveSpeedometer[playerid];
SendClientMessage(playerid, -1, strOptionInfo[DeActiveSpeedometer[playerid]]);
if(!DeActiveSpeedometer[playerid])
{
for(new i; i < 10; i++)
TextDrawShowForPlayer(playerid, TextDraws[TDSpeedClock][i]);
for(new i; i < 4; i++)
TextDrawsd[playerid][i] = TextDrawCreate(555.0, 402.0, "~r~.");
}
else
{
for(new i; i < 4; i++)
TextDrawHideForPlayer(playerid, TextDrawsd[playerid][i]);
for(new i; i < 10; i++)
TextDrawHideForPlayer(playerid, TextDraws[TDSpeedClock][i]);
}
return 1;
}
return 0;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && !DeActiveSpeedometer[playerid])
{
for(new i; i < 10; i++)
TextDrawShowForPlayer(playerid, TextDraws[TDSpeedClock][i]);
for(new i; i < 4; i++)
TextDrawsd[playerid][i] = TextDrawCreate(555.0, 402.0, "~r~.");
}
else
{
for(new i; i < 4; i++)
TextDrawHideForPlayer(playerid, TextDrawsd[playerid][i]);
for(new i; i < 10; i++)
TextDrawHideForPlayer(playerid, TextDraws[TDSpeedClock][i]);
}
return 1;
}
public OnPlayerUpdate(playerid)
{
new
Float:fPos[3],
Float:Pos[4][2],
Float:fSpeed;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && !DeActiveSpeedometer[playerid])
{
GetVehicleVelocity(GetPlayerVehicleID(playerid), fPos[0], fPos[1], fPos[2]);
fSpeed = floatsqroot(floatpower(fPos[0], 2) + floatpower(fPos[1], 2) +
floatpower(fPos[2], 2)) * 200;
new Float:alpha = 320 - fSpeed;
if(alpha < 60)
alpha = 60;
for(new i; i < 4; i++)
{
TextDrawHideForPlayer(playerid, TextDrawsd[playerid][i]);
TextDrawDestroy(TextDrawsd[playerid][i]);
GetDotXY(548, 401, Pos[i][0], Pos[i][1], alpha, (i + 1) * 8);
TextDrawsd[playerid][i] = TextDrawCreate(Pos[i][0], Pos[i][1], "~r~.");
TextDrawLetterSize(TextDrawsd[playerid][i], 0.73, -2.60);
TextDrawSetOutline(TextDrawsd[playerid][i], 0);
TextDrawSetShadow(TextDrawsd[playerid][i], 1);
TextDrawShowForPlayer(playerid, TextDrawsd[playerid][i]);
}
}
return 1;
}
stock GetDotXY(Float:StartPosX, Float:StartPosY, &Float:NewX, &Float:NewY, Float:alpha, Float:dist)
{
NewX = StartPosX + (dist * floatsin(alpha, degrees));
NewY = StartPosY + (dist * floatcos(alpha, degrees));
}