Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- // 3D Info by O.K.Style™
- new PlayerText3D:Info[MAX_PLAYERS][5];
- new
- string_3D1[50],
- string_3D2[50],
- string_3D3[50],
- string_3D4[50],
- string_3D5[50]
- ;
- new Float:HP,Float:AP;
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- if(!IsPlayerAdmin(forplayerid)) return 1;
- if(IsPlayerAdmin(playerid)) return 1;
- if(IsPlayerNPC(playerid)) return 1;
- Info[playerid][0] = CreatePlayer3DTextLabel(forplayerid, "Health: 0.0", -1, 0.0, 0.0, 0.35, 30.0, playerid, INVALID_VEHICLE_ID, 0);
- Info[playerid][1] = CreatePlayer3DTextLabel(forplayerid, "Armour: 0.0", -1, 0.0, 0.0, 0.30, 30.0, playerid, INVALID_VEHICLE_ID, 0);
- Info[playerid][2] = CreatePlayer3DTextLabel(forplayerid, "Ping: 0", -1, 0.0, 0.0, 0.25, 30.0, playerid, INVALID_VEHICLE_ID, 0);
- Info[playerid][3] = CreatePlayer3DTextLabel(forplayerid, "FPS: 0", -1, 0.0, 0.0, 0.20, 30.0, playerid, INVALID_VEHICLE_ID, 0);
- Info[playerid][4] = CreatePlayer3DTextLabel(forplayerid, "Money: 0", -1, 0.0, 0.0, 0.15, 30.0, playerid, INVALID_VEHICLE_ID, 0);
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- GetPlayerHealth(playerid, HP);
- GetPlayerArmour(playerid, AP);
- format(string_3D1, sizeof(string_3D1), "{FFFFFF}Health: {FDE39D}%.0f", HP);
- format(string_3D2, sizeof(string_3D2), "{FFFFFF}Armour: {FDE39D}%.0f", AP);
- format(string_3D3, sizeof(string_3D3), "{FFFFFF}Ping: {FDE39D}%d", GetPlayerPing(playerid));
- format(string_3D4, sizeof(string_3D4), "{FFFFFF}FPS: {FDE39D}%d", GetPlayerFPS(playerid));
- format(string_3D5, sizeof(string_3D5), "{FFFFFF}Money: {FDE39D}%d", GetPlayerMoney(playerid));
- for(new i, j = GetMaxPlayers(); i != j; i++)
- {
- if(!IsPlayerConnected(i)) continue;
- if(IsPlayerNPC(i)) continue;
- if(!IsPlayerAdmin(i)) continue;
- if(IsPlayerAdmin(playerid)) continue;
- UpdatePlayer3DTextLabelText(i, Info[playerid][0], -1, string_3D1);
- UpdatePlayer3DTextLabelText(i, Info[playerid][1], -1, string_3D2);
- UpdatePlayer3DTextLabelText(i, Info[playerid][2], -1, string_3D3);
- UpdatePlayer3DTextLabelText(i, Info[playerid][3], -1, string_3D4);
- UpdatePlayer3DTextLabelText(i, Info[playerid][4], -1, string_3D5);
- }
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- if(IsPlayerNPC(playerid)) return 1;
- if(!IsPlayerAdmin(forplayerid)) return 1;
- if(IsPlayerAdmin(playerid)) return 1;
- for(new i; i < 6; i++) DeletePlayer3DTextLabel(forplayerid, Info[playerid][i]);
- return 1;
- }
- stock GetPlayerFPS(playerid)
- {
- SetPVarInt(playerid, "DrunkL", GetPlayerDrunkLevel(playerid));
- if(GetPVarInt(playerid, "DrunkL") < 100) SetPlayerDrunkLevel(playerid, 2000);
- else
- {
- if(GetPVarInt(playerid, "LDrunkL") != GetPVarInt(playerid, "DrunkL"))
- {
- SetPVarInt(playerid, "FPS", (GetPVarInt(playerid, "LDrunkL") - GetPVarInt(playerid, "DrunkL")));
- SetPVarInt(playerid, "LDrunkL", GetPVarInt(playerid, "DrunkL"));
- if((GetPVarInt(playerid, "FPS") > 0) && (GetPVarInt(playerid, "FPS") < 256)) return GetPVarInt(playerid, "FPS") - 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement