Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Кај дефинициите најгоре во скриптата додавате
- Код: [Избери]
- #define EXPIRE_MINUTES 5
- Потоа под new каде што ви се дефинирани textdrawite додадете
- Код: [Избери]
- new Text:exp[MAX_PLAYERS];
- После, под било кој forward додавате
- Код: [Избери]
- forward OneMinute();
- forward ExpTimer();
- Исто така под new(во некои gamemodes околу 1000 линија)
- Код: [Избери]
- new levelexp = 240;
- Под enum pInfo додавате
- Код: [Избери]
- pExp,
- Кај textdrawite под public OnPlayerConnect додаваме
- Код: [Избери]
- //TEXTDRAW POD PARITE
- exp[playerid] = TextDrawCreate(553.000000, 102.000000, "_");
- TextDrawAlignment(exp[playerid], 2);
- TextDrawBackgroundColor(exp[playerid], 255);
- TextDrawFont(exp[playerid], 1);
- TextDrawLetterSize(exp[playerid], 0.299998, 1.499999);
- TextDrawColor(exp[playerid], -1);
- TextDrawSetOutline(exp[playerid], 1);
- TextDrawSetProportional(exp[playerid], 0);
- TextDrawUseBox(exp[playerid], 1);
- TextDrawBoxColor(exp[playerid], 36);
- TextDrawTextSize(exp[playerid], 318.000000, 110.000000);
- Исто така под OnPlayerConnect подоле додаваме
- Код: [Избери]
- PlayerInfo[playerid][pExp] = 0;
- кај тајмерите додавате
- Код: [Избери]
- exptimer = SetTimer("ExpTimer", 100, 1);
- oneminute = SetTimer("OneMinute", 60000, 1);
- под public OnPlayerRegister додавате
- Код: [Избери]
- format(var, 64, "Respect=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
- исто така и под OnPlayerLogin(EXRP gamemode под sacuvajigraca)
- Код: [Избери]
- format(var, 64, "Respect=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
- исто така под OnPlayerLogin
- Код: [Избери]
- if( strcmp( key , "Respect" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pExp] = strval( val ); }
- Кај текстот кога ќе се логирате(особено Вашиот донатор ранк е тој и тој)
- Код: [Избери]
- new string[128];
- new nxtlevel = PlayerInfo[playerid][pLevel]+1;
- new expamount = nxtlevel*levelexp;
- format(string, sizeof(string), "%d / %d",PlayerInfo[playerid][pExp],expamount);
- TextDrawSetString(exp[playerid], string);
- TextDrawShowForPlayer(playerid, exp[playerid]);
- Би требало да излгеда вака
- Код: [Избери]
- new drank[128];
- if(PlayerInfo[playerid][pDonateRank] == 1) { drank = "Easy User"; }
- else if(PlayerInfo[playerid][pDonateRank] == 2) { drank = "Medium User"; }
- else if(PlayerInfo[playerid][pDonateRank] == 3) { drank = "Hard User"; }
- else { drank = "0"; }
- new string[128];
- new nxtlevel = PlayerInfo[playerid][pLevel]+1;
- new expamount = nxtlevel*levelexp;
- format(string, sizeof(string), "%d / %d",PlayerInfo[playerid][pExp],expamount);
- TextDrawSetString(exp[playerid], string);
- TextDrawShowForPlayer(playerid, exp[playerid]);
- if(PlayerInfo[playerid][pDonateRank] >= 1)
- {
- format(string2, sizeof(string2), "{37F906}INFO:{FFFFFF}Vasiot donator level e %s.", drank);
- SCM(playerid, WHITE, string2);
- }
- На крајот од gamemodot додаваме
- Код: [Избери]
- public ExpTimer()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if (gPlayerLogged[i] != 0)
- {
- if(PlayerInfo[i][pLevel] >= 0)
- {
- new nxtlevel = PlayerInfo[i][pLevel]+1;
- new expamount = nxtlevel*levelexp;
- new infostring[128];
- new string[128];
- if (PlayerInfo[i][pExp] < expamount)
- {
- return 1;
- }
- else
- {
- format(string, sizeof(string), "~y~POKACIVTE ~y~ LEVEL !");
- GameTextForPlayer(i, string, 5000, 4);
- PlayerPlaySound(i, 1052, 0.0, 0.0, 0.0);
- PlayerInfo[i][pLevel]++;
- if(PlayerInfo[i][pDonateRank] > 0)
- {
- PlayerInfo[i][pExp] -= expamount;
- new total = PlayerInfo[i][pExp];
- if(total > 0)
- {
- PlayerInfo[i][pExp] = total;
- }
- else
- {
- PlayerInfo[i][pExp] = 0;
- }
- }
- else
- {
- PlayerInfo[i][pExp] = 0;
- }
- }
- }
- return 1;
- }
- else
- {
- }
- }
- }
- }
- public OneMinute()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- PlayerInfo[i][pExp]++;
- new string[128];
- new nxtlevel = PlayerInfo[i][pLevel]+1;
- new expamount = nxtlevel*levelexp;
- format(string, sizeof(string), "%d / %d",PlayerInfo[i][pExp],expamount);
- TextDrawSetString(exp[i], string);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement