Szerző Téma: Szint  (Megtekintve 416 alkalommal)

Szint
« Dátum: 2013. Január 12. - 19:17:22 »
0 Show voters
Hy!
Ez egy szintrendszer!
Írja a pontokat és ha elérek pl: 51-et Level2-re lépek
Szóval azt szeretném megoldani, hogy így Írja Pontok: 1/51 Ha szintet lépek Pontok: 51/101
Remélem érthetõ voltam :P
« Utoljára szerkesztve: 2013. Január 12. - 20:33:55 írta ninjo98 »

Nem elérhető Rupert

  • 2301
    • Profil megtekintése
Szint
« Válasz #1 Dátum: 2013. Január 12. - 20:05:34 »
+1 Show voters
[
    #define FILTERSCRIPT
        #include <a_samp>
      #include <Dini>
      #pragma tabsize 0
        #define PlayerInfo_DB   \"pstats/%s.ini\"
      ///////////////Szint//////////
        #define egy \"Szint:1\"
      #define ketto \"Szint:2\"
      #define harom \"Szint:3\"
      #define negy \"Szint:4\"
      #define ot \"Szint:5\"
      #define hat \"Szint:6\"
        enum PlayerDB
        {
                Kills,
                Deaths,
                bool:Box,
        }
        new PlayerData[MAX_PLAYERS][PlayerDB];
        new Text:PlayerStats[MAX_PLAYERS];
        new Text:Textdraw1[MAX_PLAYERS];
        new Text:Textdraw0[MAX_PLAYERS];
        new Text:Textdraw2[MAX_PLAYERS];
        new Text:Textdraw3[MAX_PLAYERS];
        forward StatsInfromation(playerid);
        public OnGameModeInit()
        {
                return 1;
        }
        public OnGameModeExit()
        {
            for(new i = 0;i < MAX_PLAYERS; i++) {
                TextDrawDestroy(PlayerStats);
                TextDrawDestroy(Textdraw1);
            }
                return 1;
        }
        public OnPlayerConnect(playerid)
        {
            new FileDB[68];
            new Name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Name , sizeof(Name));
            format(FileDB,sizeof(FileDB) , PlayerInfo_DB ,Name);
            if(!dini_Exists(FileDB)) {
                        dini_Create(FileDB);
                        dini_Set(FileDB, \"Name\" ,Name);
                        dini_IntSet(FileDB, \"Kills\" ,0);
                        dini_IntSet(FileDB, \"Deaths\" ,0);
                }
                PlayerData[playerid][Kills] =  dini_Int(FileDB,\"Kills\");
                PlayerData[playerid][Deaths] = dini_Int(FileDB,\"Deaths\");
        /////////////////ÖLÉS,Halál//////////////////////////////////////
                ////////////////////////////////////////////////////////////////
                PlayerStats[playerid] = TextDrawCreate(250.000000, 420.000000,\"-\");
                /*TextDrawUseBox(PlayerStats[playerid],1);
                TextDrawBoxColor(PlayerStats[playerid],0x000000FF);*/
                TextDrawTextSize(PlayerStats[playerid],389.000000,119.000000);
                TextDrawAlignment(PlayerStats[playerid],0);
                TextDrawBackgroundColor(PlayerStats[playerid],0x000000ff);
                TextDrawFont(PlayerStats[playerid],2);
                TextDrawLetterSize(PlayerStats[playerid],0.399999,1.200000);
                TextDrawColor(PlayerStats[playerid],0xffffffff);
                TextDrawSetOutline(PlayerStats[playerid],1);
                TextDrawSetProportional(PlayerStats[playerid],1);
                TextDrawSetShadow(PlayerStats[playerid],1);
                Save(playerid);
                /*Textdraw1[playerid] = TextDrawCreate(369.000000, 390.000000, \"~w~] ~y~stats ~w~]\");
            TextDrawAlignment(Textdraw1[playerid], 3);
            TextDrawBackgroundColor(Textdraw1[playerid], 255);
            TextDrawFont(Textdraw1[playerid], 2);
            TextDrawLetterSize(Textdraw1[playerid], 0.559999, 1.400000);
            TextDrawColor(Textdraw1[playerid],0x00FF00FF);
            TextDrawSetOutline(Textdraw1[playerid], 1);
            TextDrawSetProportional(Textdraw1[playerid], 1);*/
            ///////RANGPONTOK////////////////////////////////
            Textdraw0[playerid] = TextDrawCreate(1.000000, 423.000000, \"_\");
            TextDrawBackgroundColor(Textdraw0[playerid], 255);
            TextDrawFont(Textdraw0[playerid] , 2);
            TextDrawLetterSize(Textdraw0[playerid] , 0.700000, 2.799999);
            TextDrawColor(Textdraw0[playerid] , 0xffffffff);
            TextDrawSetOutline(Textdraw0[playerid] , 0);
            TextDrawSetProportional(Textdraw0[playerid] , 1);
            TextDrawSetShadow(Textdraw0[playerid] , 1);
 
            /////////////////////LEVEL////////////////////////////////////
            Textdraw2[playerid]  = TextDrawCreate(483.000000, 422.000000, \"_\");
            TextDrawBackgroundColor(Textdraw2[playerid] , 255);
            TextDrawFont(Textdraw2[playerid] , 2);
            TextDrawLetterSize(Textdraw2[playerid] , 0.600000, 3.100000);
            TextDrawColor(Textdraw2[playerid] , 0xffffffff);
            TextDrawSetOutline(Textdraw2[playerid] , 0);
            TextDrawSetProportional(Textdraw2[playerid] , 1);
            TextDrawSetShadow(Textdraw2[playerid] , 1);
            ////SZÖVEGDOBOZ//////////////////
            Textdraw3[playerid]  = TextDrawCreate(1.000000, 427.000000, \"_\");
            TextDrawBackgroundColor(Textdraw3[playerid] , 255);
            TextDrawFont(Textdraw3[playerid] , 1);
            TextDrawLetterSize(Textdraw3[playerid] , 0.500000, 2.399999);
            TextDrawColor(Textdraw3[playerid] , -1);
            TextDrawSetOutline(Textdraw3[playerid] , 0);
            TextDrawSetProportional(Textdraw3[playerid] , 1);
            TextDrawSetShadow(Textdraw3[playerid] , 1);
            TextDrawUseBox(Textdraw3[playerid] , 1);
            TextDrawBoxColor(Textdraw3[playerid] , 50529074);
            TextDrawTextSize(Textdraw3[playerid] , 650.000000, 0.000000);
            TextDrawSetSelectable(Textdraw3[playerid] , 0);
            SetTimerEx(\"StatsInformation\", 300, 1, \"i\", playerid);
            SetTimerEx(\"Szamitas\", 1000, 1, \"i\", playerid);
            return 1;
        }
        public OnPlayerDisconnect(playerid, reason)
        {
            new FileDB[68];
                new Name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Name  , sizeof(Name));
            format(FileDB, sizeof(FileDB) , PlayerInfo_DB , Name);
                dini_IntSet(FileDB, \"Kills\" , PlayerData[playerid][Kills]);
                dini_IntSet(FileDB, \"Deaths\" , PlayerData[playerid][Deaths]);
                PlayerData[playerid][Kills] = 0;
                PlayerData[playerid][Deaths] = 0;
                TextDrawHideForPlayer(playerid,PlayerStats[playerid]);
                TextDrawHideForPlayer(playerid,Textdraw0[playerid]);
                TextDrawHideForPlayer(playerid,Textdraw2[playerid]);
                TextDrawHideForPlayer(playerid, Textdraw3[playerid]);
                return 1;
        }
        forward Szamitas(playerid);
        public Szamitas(playerid)
        {
                /////////////////////Szint/////////////////////////////////////////////
            if((GetPlayerScore(playerid) >= 0) && (GetPlayerScore(playerid) <= 50))
            {
            TextDrawSetString(Textdraw2[playerid],egy);
                new string[65],pont = GetPlayerScore(playerid);
                format(string,sizeof(string),\"Pont: %d/51\",pont);
                TextDrawSetString(Textdraw0[playerid], string);
            }
            if((GetPlayerScore(playerid) >= 51) && (GetPlayerScore(playerid) <= 100))
            {
            TextDrawSetString(Textdraw2[playerid],ketto);
                new string[65],pont = GetPlayerScore(playerid);
                format(string,sizeof(string),\"Pont: %d/101\",pont);
                TextDrawSetString(Textdraw0[playerid], string);
            }
            if((GetPlayerScore(playerid) >= 101) && (GetPlayerScore(playerid) <= 140))
            {
            TextDrawSetString(Textdraw2[playerid],harom);
                new string[65],pont = GetPlayerScore(playerid);
                format(string,sizeof(string),\"Pont: %d/141\",pont);
                TextDrawSetString(Textdraw0[playerid], string);
            }
            if((GetPlayerScore(playerid) >= 141) && (GetPlayerScore(playerid) <= 180))
            {
            TextDrawSetString(Textdraw2[playerid],negy);
                new string[65],pont = GetPlayerScore(playerid);
                format(string,sizeof(string),\"Pont: %d/181\",pont);
                TextDrawSetString(Textdraw0[playerid], string);
            }
            if((GetPlayerScore(playerid) >= 181) && (GetPlayerScore(playerid) <= 201))
            {
            TextDrawSetString(Textdraw2[playerid],ot);
                new string[65],pont = GetPlayerScore(playerid);
                format(string,sizeof(string),\"Pont: %d/202\",pont);
                TextDrawSetString(Textdraw0[playerid], string);
            }
            if((GetPlayerScore(playerid) >= 202) && (GetPlayerScore(playerid) <= 300))
            {
            TextDrawSetString(Textdraw2[playerid],hat);
                new string[65],pont = GetPlayerScore(playerid);
                format(string,sizeof(string),\"Pont: %d/301\",pont);
                TextDrawSetString(Textdraw0[playerid], string);
            }
            return 1;
        }
        public OnPlayerSpawn(playerid)
        {
            TextDrawShowForPlayer(playerid, PlayerStats[playerid]);
                TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
                TextDrawShowForPlayer(playerid,Textdraw0[playerid]);
            TextDrawShowForPlayer(playerid,Textdraw2[playerid]);
            TextDrawShowForPlayer(playerid, Textdraw3[playerid]);
                return 1;
        }
        public OnPlayerDeath(playerid, killerid, reason)
        {
            new FileDB[68];
                new Name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Name , sizeof(Name));
            format(FileDB,sizeof(FileDB) , PlayerInfo_DB , Name);
                dini_IntSet(FileDB, \"Kills\" , PlayerData[playerid][Kills]);
                dini_IntSet(FileDB, \"Deaths\" , PlayerData[playerid][Deaths]);
                PlayerData[killerid][Kills] ++;
                PlayerData[playerid][Deaths] ++;
                return 1;
        }
        public OnPlayerCommandText(playerid, cmdtext[])
        {
                if (strcmp(\"/StatsOff\", cmdtext, true) == 0) {
                        if(PlayerData[playerid][box] == false)
                        {
                    PlayerData[playerid][box] = true;
                        TextDrawHideForPlayer(playerid, PlayerStats[playerid]);
                        TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
                                GameTextForPlayer(playerid,\"~w~Stats ~r~Off ~n~~y~to turn On ~g~Type ~n~~r~(~w~/Statson ~r~)\",4000, 3);
                        }
                        return 1;
                }
                        if (strcmp(\"/Statson\", cmdtext, true) == 0)
                        {
                          if(PlayerData[playerid][box] == true)
                          {
                    PlayerData[playerid][box] = false;
                            TextDrawShowForPlayer(playerid, PlayerStats[playerid]);
                        TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
                    GameTextForPlayer(playerid,\"~w~Stats ~r~On ~n~~y~to turn off ~g~Type ~n~~r~(~w~/StatsOff ~r~)\",4000, 3);
                        }
                        return 1;
                       
                }
                return 0;
        }
        public StatsInfromation() {
            new str[128];
                for(new i=0;i<MAX_PLAYERS;i++)
                {
                        if (IsPlayerConnected(i))
                    {
                        format(str, sizeof(str), \"~r~kills: ~w~%d  ~n~~r~deaths: ~w~%d\" , PlayerData[Kills], PlayerData[Deaths]);
                        TextDrawSetString(PlayerStats,str);
                }
                }
                return 1;
        }
        stock Save(playerid){
                new FileDB[68];
                new Name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Name  , sizeof(Name));
            format(FileDB, sizeof(FileDB) , PlayerInfo_DB , Name);
                dini_IntSet(FileDB, \"Kills\" , PlayerData[playerid][Kills]);
                dini_IntSet(FileDB, \"Deaths\" , PlayerData[playerid][Deaths]);
        }

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal