Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Timer
- new CheckStatusTimer;
- //4all
- new Text:Black0;
- new Text:Black1;
- new Text:Black2;
- new Text:Black3;
- new Text:LightBlack;
- forward CheckStatus();
- //4player
- new Text:VHS[MAX_PLAYERS];
- //Speed
- new Float:OldX[MAX_PLAYERS];
- new Float:OldY[MAX_PLAYERS];
- new Float:OldZ[MAX_PLAYERS];
- public OnGameModeInit()
- {
- CheckStatusTimer = SetTimer("CheckStatus", 1000, 1);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TextDrawsShown[playerid] = false;
- return false;
- }
- public CheckStatus()
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(IsPlayerInAnyVehicle(i))
- {
- if(TextDrawsShown[i] == false)
- {
- TextDrawShowForPlayer(i, Text:Black0);
- TextDrawShowForPlayer(i, Text:Black1);
- TextDrawShowForPlayer(i, Text:Black2);
- TextDrawShowForPlayer(i, Text:Black3);
- TextDrawShowForPlayer(i, Text:LightBlack);
- TextDrawsShown[i] = true;
- }
- new String[256];
- new Float:X, Float:Y, Float:Z, Float:Distance;
- GetPlayerPos(i, X, Y, Z);
- Distance = floatsqroot(floatadd(floatadd(floatpower(floatsub(X, OldX[i]), 2), floatpower(floatsub(Y, OldY[i]), 2)), floatpower(floatsub(Z, OldZ[i]), 2)));
- format(String,sizeof(String),"~b~Velocidade:~n~ ~r~%i km/h~n~~b~Combustivel:~n~ ~r~%i", floatround(((Distance/1000.0)*60.0)*60.0), Petrol[i]);
- if(VHSCreated[i] == true)
- {
- TextDrawDestroy(VHS[i]);
- }
- VHS[i] = TextDrawCreate(515.000000,100.000000,String);
- TextDrawAlignment(VHS[i],0);
- TextDrawBackgroundColor(VHS[i],0x000000ff);
- TextDrawFont(VHS[i],1);
- TextDrawLetterSize(VHS[i],0.444444,2.000000);
- TextDrawColor(VHS[i],0xffffffff);
- TextDrawSetOutline(VHS[i],1);
- TextDrawSetProportional(VHS[i],1);
- TextDrawSetShadow(VHS[i],1);
- TextDrawShowForPlayer(i, VHS[i]);
- VHSCreated[i] = true;
- OldX[i] = X; OldY[i] = Y; OldZ[i] = Z;
- Velocidade[i] = floatround(((Distance/1000.0)*60.0)*60.0);
- if(Velocidade[i] > 210 && GetPlayerState(i) == PLAYER_STATE_DRIVER && VeloMulta == 1){
- SendClientMessage(i,COLOR_RED,"[MULTA] Você foi pego dirigindo acima da velocidade, e levou multa.");
- GivePlayerMoney(i,-50);
- }
- }
- else
- {
- if(TextDrawsShown[i] == true)
- {
- TextDrawHideForPlayer(i, Text:Black0);
- TextDrawHideForPlayer(i, Text:Black1);
- TextDrawHideForPlayer(i, Text:Black2);
- TextDrawHideForPlayer(i, Text:Black3);
- TextDrawHideForPlayer(i, Text:LightBlack);
- TextDrawsShown[i] = false;
- }
- TextDrawHideForPlayer(i, Text:VHS[i]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement