Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <YSI\y_hooks>
- #include <dini>
- #include <zcmd>
- new skaicius[MAX_PLAYERS];
- new Text:horTD[3];
- hook OnGameModeInit(playerid)
- {
- /* Horizontalaus textdraw'o juodas box'as*/
- horTD[0] = TextDrawCreate(430.000000, 210.000000, "horizantalus-1");
- TextDrawFont(horTD[0], 1);
- TextDrawLetterSize(horTD[0], 0.000000, 1.000000);
- TextDrawUseBox(horTD[0], 1);
- TextDrawBoxColor(horTD[0], 255);
- TextDrawTextSize(horTD[0], 526.000000, 0.000000);
- /* Horizontalaus textdraw'o tamsus raduonas box'as*/
- horTD[1] = TextDrawCreate(431.000000, 211.000000, "horizontalus-2");
- TextDrawFont(horTD[1], 1);
- TextDrawLetterSize(horTD[1], 0.000000, 0.799999);
- TextDrawUseBox(horTD[1], 1);
- TextDrawBoxColor(horTD[1], 0x5a0c0eFF);
- TextDrawTextSize(horTD[1], 525.000000, 0.000000);
- /* Horizontalaus textdraw'o raduonas box'as - progressbar'as */
- horTD[2] = TextDrawCreate(431.000000, 211.000000, "horizantalus-3");
- TextDrawFont(horTD[2], 1);
- TextDrawLetterSize(horTD[2], 0.000000, 0.799999);
- TextDrawUseBox(horTD[2], 1);
- TextDrawBoxColor(horTD[2], 0xb4191dFF);
- TextDrawTextSize(horTD[2], 476.000000, 0.000000);
- return 1;
- }
- stock baras(playerid)
- {
- new Float:amount; // kintamasis į kuri įrašysim rezultatą
- /* Horizontalus progressbar'as */
- amount = (427.0 + (0 * 0.98));
- TextDrawTextSize(horTD[2], amount, 0.0);
- TextDrawShowForPlayer(playerid, horTD[2]);
- return 1;
- }
- hook OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (newkeys & KEY_SPRINT)
- {
- TextDrawShowForPlayer(playerid, horTD[2]);
- SetTimerEx ( "hideTD" , 1000 , 1 , "i" , playerid );
- }
- return 1;
- }
- forward hideTD ( playerid );
- public hideTD ( playerid )
- {
- skaicius[playerid] += 100;
- new string[20];
- new Float:amount;
- TextDrawShowForPlayer(playerid, horTD[2]);
- amount = (427.0 + skaicius[playerid] * 0.98);
- TextDrawTextSize(horTD[2], amount, 0.0);
- TextDrawShowForPlayer(playerid, horTD[2]);
- format(string,sizeof(string), "%d", skaicius[playerid]);
- TextDrawSetString(horTD[2], string);
- {
- if(amount == (427.0 + 100 * 0.98)) SendClientMessage(playerid, 0xFFFFFFAA, "{E74C3C}progressbaras pilnas:");
- }
- }
- CMD:asd( playerid, params[] )
- {
- baras(playerid);
- TextDrawShowForPlayer(playerid, horTD[0]);
- TextDrawShowForPlayer(playerid, horTD[1]);
- TextDrawShowForPlayer(playerid, horTD[2]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement