28.08.2011, 17:27
Код:
public CheckStatus() { for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(IsPlayerInAnyVehicle(i)) { if(TextShow[i] == false) { /*TextDrawShowForPlayer(i, Text:Black0); TextDrawShowForPlayer(i, Text:Black1); TextDrawShowForPlayer(i, Text:Black2); TextDrawShowForPlayer(i, Text:Black3); TextDrawShowForPlayer(i, Text:LightBlack);*/ TextShow[i] = true; } new String[128]; new Float:X, Float:Y, Float:Z, Float:Speed; new vehicle = GetPlayerVehicleID(i); GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z); Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)), floatpower(Z, 2))), 100.0); format(String,sizeof(String),"~w~Fuel: ~w~%i ~w~Speed: ~w~%i", Gas[vehicle], floatround(Speed, floatround_floor)); if(VHSCreated[i] == true) { TextDrawDestroy(VHS[i]); } VHS[i] = TextDrawCreate(260.000000,420.000000,String); TextDrawAlignment(VHS[i],0); //TextDrawBackgroundColor(VHS[i],0x000000ff); TextDrawFont(VHS[i],1); TextDrawLetterSize(VHS[i],0.299999,1.000000); //TextDrawColor(VHS[i],0xffffffff); //TextDrawSetOutline(VHS[i],1); //TextDrawSetProportional(VHS[i],1); //TextDrawSetShadow(VHS[i],1); TextDrawShowForPlayer(i, VHS[i]); VHSCreated[i] = true; } else { if(TextShow[i] == true) { TextDrawHideForPlayer(i, Text:Black0); TextDrawHideForPlayer(i, Text:Black1); TextDrawHideForPlayer(i, Text:Black2); TextDrawHideForPlayer(i, Text:Black3); TextDrawHideForPlayer(i, Text:LightBlack); TextDrawHideForPlayer(i, Text:VHS[i]); TextShow[i] = false; } } } } }