18.07.2012, 20:40
PHP код:
#include <a_samp>
#define Click 789
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == Click) {
new string[256];
if (response == 1) {
new nome[24];
GetPlayerName(playerid, nome, MAX_PLAYER_NAME);
format(string, sizeof(string), "{FFFF00}%s \n {33AA33}Ping: {FFFFFF}%d {33AA33}FPS: {FFFFFF}%d ", nome, GetPlayerPing(playerid), GetPlayerFPS(playerid));
ShowPlayerDialog(playerid, Click, DIALOG_STYLE_MSGBOX, "Informaзхes", string, "Refresh", "Cancelar");
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source) {
new string[256];
format(string, sizeof(string), "{33AA33}Ping: {FFFFFF}%d {33AA33}FPS: {FFFFFF}%d ", GetPlayerPing(playerid), GetPlayerFPS(playerid));
ShowPlayerDialog(playerid, Click, DIALOG_STYLE_MSGBOX, "Informaзхes", string, "Refresh", "Cancelar");
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;
}