Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #include foreach
- #define TD_Hide(%0) TextDrawHideForPlayer(%0)
- #define TD_Show(%0) TextDrawShowForPlayer(%0)
- #define TD_Update(%0) TextDrawSetString(%0)
- #define callback->%0(%1) forward %0(%1); public %0(%1)
- #define Loop(%0) for(new %0;%0<=MAX_PLAYERS;%0++)
- new pName[MAX_PLAYERS][MAX_PLAYER_NAME];
- new Text:StatyBox[7];
- new Text:TD_Nick[MAX_PLAYERS];
- new Text:TD_Exp[MAX_PLAYERS];
- new Text:TD_Level[MAX_PLAYERS];
- new Text:TD_Gang[MAX_PLAYERS];
- new Text:TD_Online[MAX_PLAYERS];
- new Text:Graczy[MAX_PLAYERS];
- new Text:TD_FPS[MAX_PLAYERS];
- new Text:TD_Ping[MAX_PLAYERS];
- new PlayerText: ID_Skin;
- new Administrator[MAX_PLAYERS];
- new AdministratorLevel[MAX_PLAYERS];
- new Vip[MAX_PLAYERS];
- new Players_Online = 0, Admins_Online = 0,Vips_Online = 0;
- new p_Hours[MAX_PLAYERS] = 0, p_Minutes[MAX_PLAYERS] = 0, p_Secounds[MAX_PLAYERS] = 0;
- public OnGameModeInit()
- {
- TextDraw();
- TimersInit();
- }
- public OnPlayerConnect(playerid)
- {
- Players_Online++;
- Vip[playerid] = 0;
- Administrator[playerid] = 0;
- AdministratorLevel[playerid] = 0;
- p_Hours[playerid] = 0;
- p_Minutes[playerid] = 0;
- p_Secounds[playerid] = 0;
- ID_Skin = CreatePlayerTextDraw(playerid, 512.500, 390.500,"_");
- PlayerTextDrawBackgroundColor(playerid, ID_Skin, 0);
- PlayerTextDrawFont(playerid, ID_Skin, TEXT_DRAW_FONT_MODEL_PREVIEW);
- PlayerTextDrawTextSize(playerid, ID_Skin, 100.000, 50.500);
- return 1;
- }
- /*
- [...Logowanie...]
- if(mysql_num_rows())
- {
- new admlvl[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, admlvl, sizeof(admlvl));
- AdministratorLevel[playerid] = mysql_PlayerGetInt(admlvl, "admin");
- if(AdministratorLevel[playerid] >= 1)
- {
- Admins_Online++;
- Administrator[playerid] = 1;
- }
- new vipek[MAX_PLAYER_NAME+1];
- GetPlayerName(playerid, vipek, sizeof(vipek));
- new vipos = mysql_PlayerGetInt(vipek, "ifnull(datediff(vip,now()),'-5')");
- if(vipos >= 0)
- {
- Vips_Online++;
- Vip[playerid] = true;
- }
- [...]
- }
- */
- public OnPlayerDisconnect(playerid, reason)
- {
- TD_Hide(playerid, StatyBox[0]);
- TD_Hide(playerid, StatyBox[1]);
- TD_Hide(playerid, StatyBox[2]);
- TD_Hide(playerid, StatyBox[3]);
- TD_Hide(playerid, StatyBox[4]);
- TD_Hide(playerid, StatyBox[5]);
- TD_Hide(playerid, StatyBox[6]);
- TD_Hide(playerid, TD_Nick[playerid]);
- TD_Hide(playerid, TD_Exp[playerid]);
- TD_Hide(playerid, TD_Level[playerid]);
- TD_Hide(playerid, TD_Gang[playerid]);
- TD_Hide(playerid, TD_Online[playerid]);
- TD_Hide(playerid, Graczy[playerid]);
- TD_Hide(playerid, TD_FPS[playerid]);
- TD_Hide(playerid, TD_Ping[playerid]);
- Players_Online--;
- if(Administrator[playerid] < 1)
- {
- Admins_Online--;
- }
- if(Vip[playerid])
- {
- Vips_Online--;
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TD_Show(playerid, StatyBox[0]);
- TD_Show(playerid, StatyBox[1]);
- TD_Show(playerid, StatyBox[2]);
- TD_Show(playerid, StatyBox[3]);
- TD_Show(playerid, StatyBox[4]);
- TD_Show(playerid, StatyBox[5]);
- TD_Show(playerid, StatyBox[6]);
- TD_Show(playerid, TD_Nick[playerid]);
- TD_Show(playerid, TD_Exp[playerid]);
- TD_Show(playerid, TD_Level[playerid]);
- TD_Show(playerid, TD_Gang[playerid]);
- TD_Show(playerid, TD_Online[playerid]);
- TD_Show(playerid, Graczy[playerid]);
- TD_Show(playerid, TD_FPS[playerid]);
- TD_Show(playerid, TD_Ping[playerid]);
- PlayerTextDrawSetPreviewModel(playerid, ID_Skin, GetPlayerSkin(playerid));
- PlayerTextDrawShow(playerid, ID_Skin);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid != INVALID_PLAYER_ID)
- {
- if(Vip[killerid])
- {
- SetPlayerScore(killerid, GetPlayerScore(killerid) + 2);
- }
- else
- {
- SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
- }
- }
- SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
- SendDeathMessage(killerid, playerid, reason);
- }
- forward CheckOnline();
- public CheckOnline()
- {
- Admins_Online = 0;
- Vips_Online = 0;
- Players_Online = 0;
- Loop(x)
- {
- if(IsPlayerConnected(x))
- {
- Players_Online++;
- if(Administrator[x])
- {
- Admins_Online++;
- }
- if(Vip[x])
- {
- Vips_Online++;
- }
- }
- }
- }
- forward TextDrawUpdate();
- public TextDrawUpdate()
- {
- new string[256];
- foreach(Player, i)
- {
- p_Secounds[i]++;
- if(p_Secounds[i] >= 60)
- {
- p_Secounds[i] = 0;
- p_Minutes[i]++;
- if(p_Minutes[i] >= 60)
- {
- p_Minutes[i] = 0;
- p_Hours[i]++;
- }
- }
- }
- foreach(Player, i)
- {
- if(IsPlayerConnected(i))
- {
- format(string, sizeof(string), "(~y~%d~w~)%s", (i), pName[i]);
- TextDrawSetString(TD_Nick[i], string);
- format(string, sizeof(string), "%d", GetPlayerScore(i));
- TextDrawSetString(TD_Exp[i], string);
- format(string, sizeof(string), "%d", GetPlayerLevel(i));
- TextDrawSetString(TD_Level[i], string);
- format(string, sizeof(string), "%d godz %d min %d sek", p_Hours[i], p_Minutes[i], p_Secounds[i]);
- TextDrawSetString(TD_Online[i], string);
- format(string, sizeof(string), "Ping: ~w~%d", GetPlayerPing(i));
- TextDrawSetString(TD_Ping[i], string);
- format(string, sizeof(string), "FPS: ~w~%d", GetPlayerFPS(i));
- TextDrawSetString(TD_FPS[i], string);
- format(string, sizeof(string), "(%d/~y~%d~w~/~r~%d~w~)", Players_Online, Vips_Online, Admins_Online);
- TextDrawSetString(Graczy[i], string);
- format(string, sizeof(string), "%s"/*, ???*/);
- TextDrawSetString(TD_Gang[i], string);
- }
- }
- }
- TextDraw()
- {
- StatyBox[0] = TextDrawCreate(199.000, 405.500, "LD_POKE:cdback");
- TextDrawFont(StatyBox[0], 4);
- TextDrawTextSize(StatyBox[0], 367.000, 37.000);
- TextDrawColor(StatyBox[0], 799);
- StatyBox[1] = TextDrawCreate(223.575424, 399.499938, "Nick");
- TextDrawLetterSize(StatyBox[1], 0.248535, 1.191666);
- TextDrawAlignment(StatyBox[1], 2);
- TextDrawColor(StatyBox[1], -5963521);
- TextDrawSetShadow(StatyBox[1], 0);
- TextDrawSetOutline(StatyBox[1], 1);
- TextDrawBackgroundColor(StatyBox[1], 51);
- TextDrawFont(StatyBox[1], 2);
- TextDrawSetProportional(StatyBox[1], 1);
- StatyBox[2] = TextDrawCreate(266.211425, 399.083343, "Respekt");
- TextDrawLetterSize(StatyBox[2], 0.248535, 1.191666);
- TextDrawAlignment(StatyBox[2], 1);
- TextDrawColor(StatyBox[2], -5963521);
- TextDrawSetShadow(StatyBox[2], 0);
- TextDrawSetOutline(StatyBox[2], 1);
- TextDrawBackgroundColor(StatyBox[2], 51);
- TextDrawFont(StatyBox[2], 2);
- TextDrawSetProportional(StatyBox[2], 1);
- StatyBox[3] = TextDrawCreate(347.734436, 399.083465, "Level");
- TextDrawLetterSize(StatyBox[3], 0.248535, 1.191666);
- TextDrawAlignment(StatyBox[3], 2);
- TextDrawColor(StatyBox[3], -5963521);
- TextDrawSetShadow(StatyBox[3], 0);
- TextDrawSetOutline(StatyBox[3], 1);
- TextDrawBackgroundColor(StatyBox[3], 51);
- TextDrawFont(StatyBox[3], 2);
- TextDrawSetProportional(StatyBox[3], 1);
- StatyBox[4] = TextDrawCreate(410.054565, 399.083312, "Gang");
- TextDrawLetterSize(StatyBox[4], 0.248535, 1.191666);
- TextDrawAlignment(StatyBox[4], 2);
- TextDrawColor(StatyBox[4], -5963521);
- TextDrawSetShadow(StatyBox[4], 0);
- TextDrawSetOutline(StatyBox[4], 1);
- TextDrawBackgroundColor(StatyBox[4], 51);
- TextDrawFont(StatyBox[4], 2);
- TextDrawSetProportional(StatyBox[4], 1);
- StatyBox[5] = TextDrawCreate(433.942230, 399.083343, "Czas_Gry");
- TextDrawLetterSize(StatyBox[5], 0.248535, 1.191666);
- TextDrawAlignment(StatyBox[5], 1);
- TextDrawColor(StatyBox[5], -5963521);
- TextDrawSetShadow(StatyBox[5], 0);
- TextDrawSetOutline(StatyBox[5], 1);
- TextDrawBackgroundColor(StatyBox[5], 51);
- TextDrawFont(StatyBox[5], 2);
- TextDrawSetProportional(StatyBox[5], 1);
- StatyBox[6] = TextDrawCreate(530.457458, 400.250061, "Online");
- TextDrawLetterSize(StatyBox[6], 0.248535, 1.191666);
- TextDrawAlignment(StatyBox[6], 2);
- TextDrawColor(StatyBox[6], -5963521);
- TextDrawSetShadow(StatyBox[6], 0);
- TextDrawSetOutline(StatyBox[6], 1);
- TextDrawBackgroundColor(StatyBox[6], 51);
- TextDrawFont(StatyBox[6], 2);
- TextDrawSetProportional(StatyBox[6], 1);
- Loop(i)
- {
- TD_Nick[i] = TextDrawCreate(231.819824, 420.666748, ".MefiK");
- TextDrawLetterSize(TD_Nick[i], 0.175907, 0.987496);
- TextDrawAlignment(TD_Nick[i], 2);
- TextDrawColor(TD_Nick[i], -1);
- TextDrawSetShadow(TD_Nick[i], 0);
- TextDrawSetOutline(TD_Nick[i], 1);
- TextDrawBackgroundColor(TD_Nick[i], 51);
- TextDrawFont(TD_Nick[i], 1);
- TextDrawSetProportional(TD_Nick[i], 1);
- TD_Exp[i] = TextDrawCreate(285.231445, 420.083251, "12345");
- TextDrawLetterSize(TD_Exp[i], 0.175907, 0.987496);
- TextDrawAlignment(TD_Exp[i], 2);
- TextDrawColor(TD_Exp[i], -1);
- TextDrawSetShadow(TD_Exp[i], 0);
- TextDrawSetOutline(TD_Exp[i], 1);
- TextDrawBackgroundColor(TD_Exp[i], 51);
- TextDrawFont(TD_Exp[i], 1);
- TextDrawSetProportional(TD_Exp[i], 1);
- TD_Level[i] = TextDrawCreate(343.328399, 420.499847, "11");
- TextDrawLetterSize(TD_Level[i], 0.175907, 0.987496);
- TextDrawAlignment(TD_Level[i], 2);
- TextDrawColor(TD_Level[i], -1);
- TextDrawSetShadow(TD_Level[i], 0);
- TextDrawSetOutline(TD_Level[i], 1);
- TextDrawBackgroundColor(TD_Level[i], 51);
- TextDrawFont(TD_Level[i], 1);
- TextDrawSetProportional(TD_Level[i], 1);
- TD_Gang[i] = TextDrawCreate(378.936187, 420.083221, "_Gunwo_Team_");
- TextDrawLetterSize(TD_Gang[i], 0.175907, 0.987496);
- TextDrawAlignment(TD_Gang[i], 1);
- TextDrawColor(TD_Gang[i], -1);
- TextDrawSetShadow(TD_Gang[i], 0);
- TextDrawSetOutline(TD_Gang[i], 1);
- TextDrawBackgroundColor(TD_Gang[i], 51);
- TextDrawFont(TD_Gang[i], 1);
- TextDrawSetProportional(TD_Gang[i], 1);
- TD_Online[i] = TextDrawCreate(432.816040, 420.916809, "1000 godz 0 min 0 sek");
- TextDrawLetterSize(TD_Online[i], 0.175907, 0.987496);
- TextDrawAlignment(TD_Online[i], 1);
- TextDrawColor(TD_Online[i], -1);
- TextDrawSetShadow(TD_Online[i], 0);
- TextDrawSetOutline(TD_Online[i], 1);
- TextDrawBackgroundColor(TD_Online[i], 51);
- TextDrawFont(TD_Online[i], 1);
- TextDrawSetProportional(TD_Online[i], 1);
- Graczy[i] = TextDrawCreate(526.988891, 420.083221, "(0/~y~0~w~/~r~0~w~)");
- TextDrawLetterSize(Graczy[i], 0.175907, 0.987496);
- TextDrawAlignment(Graczy[i], 2);
- TextDrawColor(Graczy[i], -1);
- TextDrawSetShadow(Graczy[i], 0);
- TextDrawSetOutline(Graczy[i], 1);
- TextDrawBackgroundColor(Graczy[i], 51);
- TextDrawFont(Graczy[i], 1);
- TextDrawSetProportional(Graczy[i], 1);
- TD_Ping[i] = TextDrawCreate(612.231994, 22.750007, "Ping: ~w~100");
- TextDrawLetterSize(TD_Ping[i], 0.161859, 0.870832);
- TextDrawAlignment(TD_Ping[i], 1);
- TextDrawColor(TD_Ping[i], -5963521);
- TextDrawSetShadow(TD_Ping[i], 0);
- TextDrawSetOutline(TD_Ping[i], 1);
- TextDrawBackgroundColor(TD_Ping[i], 51);
- TextDrawFont(TD_Ping[i], 1);
- TextDrawSetProportional(TD_Ping[i], 1);
- TD_FPS[i] = TextDrawCreate(614.105773, 30.916620, "FPS: ~w~100");
- TextDrawLetterSize(TD_FPS[i], 0.161859, 0.870832);
- TextDrawAlignment(TD_FPS[i], 1);
- TextDrawColor(TD_FPS[i], -5963521);
- TextDrawSetShadow(TD_FPS[i], 0);
- TextDrawSetOutline(TD_FPS[i], 1);
- TextDrawBackgroundColor(TD_FPS[i], 51);
- TextDrawFont(TD_FPS[i], 1);
- TextDrawSetProportional(TD_FPS[i], 1);
- }
- }
- TimersInit()
- {
- SetTimer("CheckOnline", 1800, true);
- SetTimer("TextDrawUpdate", 1300, true);
- }
- GetPlayerLevel(playerid)
- {
- new Lvl;
- do {
- Lvl++;
- } while(Lvl*Lvl*6 < GetPlayerScore(playerid));
- return (Lvl-1 < 1) ? 1 : Lvl-1;
- }
- 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 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement