[HELP]Level
#1

Y Have A Process For Level But when the player gets 8/8 respects he must wrote /levelup to get +Level Can You Give me the code in this public with the /levelup cmd, when the player have 8/8 respect automaticly +Level not to wrote /levelup, Here is The Code
pawn Код:
if (strcmp(cmd, "/levelup", true) == 0)
 {
     if(IsPlayerConnected(playerid))
     {
   if (gPlayerLogged[playerid] != 0)
   {
    if(PlayerInfo[playerid][pLevel] >= 0)
    {
     new nxtlevel = PlayerInfo[playerid][pLevel]+1;
     new expamount = nxtlevel*levelexp;
     new infostring[128];
     if (PlayerInfo[playerid][pExp] < expamount)
     {
      format(infostring, 256, "   Za sledeci level vam treba %d Respekt Poena, a vi imate [%d] !",expamount,PlayerInfo[playerid][pExp]);
      SendClientMessage(playerid, COLOR_GRAD1, infostring);
      return 1;
     }
     else
     {
      format(string, sizeof(string), "~g~LEVEL UP~n~~w~Vi ste sada Level %d", nxtlevel);
      PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
      PlayerPlayMusic(playerid);
      PlayerInfo[playerid][pLevel]++;
      if(PlayerInfo[playerid][pDonateRank] > 0)
      {
          PlayerInfo[playerid][pExp] -= expamount;
          new total = PlayerInfo[playerid][pExp];
          if(total > 0)
          {
              PlayerInfo[playerid][pExp] = total;
          }
          else
          {
              PlayerInfo[playerid][pExp] = 0;
          }
      }
      else
      {
       PlayerInfo[playerid][pExp] = 0;
      }
      PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
      GameTextForPlayer(playerid, string, 5000, 1);
      format(infostring, 256, "   Kupili ste Level %d Ukucajte /upgrade", nxtlevel);
      SendClientMessage(playerid, COLOR_GRAD1, infostring);
      format(infostring, 256, "   Dali ste %d nepotrosene Upgrade Points-e",PlayerInfo[playerid][gPupgrade]);
      SendClientMessage(playerid, COLOR_GRAD2, infostring);
     }
    }
    return 1;
   }
   else
   {
    SendClientMessage(playerid, COLOR_GRAD1, "   Niste logirani !");
   }
  }
  return 1;
 }
My System
pawn Код:
public ITakoProshoJedanMinut()
{
        new i;
   for(i = 0; i < MAX_PLAYERS; i++)
   {
      if(!IsPlayerConnected(i))   continue;
      PlayerInfo[i ][pOdigraniMinuti] ++;  // OBRISI RAZMAK KADA KOPIRAЉ KOD
      if(PlayerInfo [i ][pOdigraniMinuti] == 30)     // OBRISI RAZMAK KADA KOPIRAЉ KOD
      {
         PlayerInfo[i ][pExp] ++;   // OBRISI RAZMAK KADA KOPIRAЉ KOD
         PlayerInfo[i ][pOdigraniMinuti] = 0;   // OBRISI RAZMAK KADA KOPIRAЉ KOD
         ShowClientMesssage(i, COLOR_LIGHTBLUE, "By Mikec: Dobili ste +1 EXP Posto ste igrali 30 minuta na serveru");[/code]
      }
   }
}
Reply
#2

Can Someone Help ?
Reply
#3

That's easy. Create a timer, that updates player's level which check is player's respect high enough, then add a next level here.
Reply
#4

Code ?
Reply
#5

not everyone is gonna give u the code u have to do it urself sometimes to learn lol
Reply
#6

than Help me give me some edvice to do it :@@
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)