Szerző Téma: XP Rendszer  (Megtekintve 2999 alkalommal)

Nem elérhető huhboy

  • 894
  • huhboy
    • Profil megtekintése
XP Rendszer
« Dátum: 2014. Április 04. - 22:56:44 »
+4 Show voters
ÜDv! Nemrég készítettem egy egyszerû xp rendszert, amibõl a végén egy xp include lett.....
Szükséges fájlok:
scriptfiles-ban egy Users mappa.
Összesen 30 szint van, 99-ig növelhetõ. ( A szintek eléréséhez szükséges xp szám az include-ban van megadva)
Az include automatikusan létrehoz egy kis textdrawot a map felett, ami mutatja az xp számot, és a szintet.
Biztos van, akinek jól jön :)
Mod elejére: #include <xpinc>
funkciók:
 

GiveXp(playerid, XP);// az XP az érték
SetXp(playerid, XP); //az XP szintén az érték
GetPlayerXP(playerid);
GetPlayerXpLevel(playerid);

 
a Módba/fs-be behelyezendõ dolgok:
 

/*Az OnGameModeInit alá:*/
betoltendo();
/*OnPlayerConnect(playerid) alá:*/
Connect_xp(playerid);
/*OnPlayerDisconnect(playerid) alá: */
Disconnect_xp(playerid);

 
a kis textdraw, ami azért nincs túlszerkesztgetve, mert aki akar, az úgyis csinál olyat, amilyet szeretne :D
\"width=500http://kepfeltoltes.hu/140405/xp_www.kepfeltoltes.hu_.jpg[/img]
Letöltés: http://www.solidfiles.com/d/56c1c173d9/xpinc.inc
INC:
 
#include <a_samp>
#include <sscanf>
#include <dini>
//===================================================================================
//======================================scriptbe=====================================
//===================================================================================
/*
OnGameModeInit:  betoltendo();
OnPlayerConnect: Connect_xp(playerid);
OnPlayerDisconnect: Disconnect_xp(playerid);
 
*/
#define MAX_XP_LEVEL 99
#define Szin_RED 0xFF0000AA
#define Szin_YELLOW 0xFFFF00AA
 
#define zoold 0x00ff00AA
new PlayerText:XPTD[MAX_PLAYERS];
 
stock betoltendo()
{
SetTimer(\"XPUpdate\", 200, 1);
SetTimer(\"XP_Level\", 200, 1);
return 1;
}
//===================================================================================
//=========================================Szintek===================================
//===================================================================================
forward XP_Level(playerid);
public XP_Level(playerid)
{
if(GetPVarInt(playerid, \"XP\") < 100) SetPVarInt(playerid, \"xplvl\", 1); else
if(GetPVarInt(playerid, \"XP\") < 250 && GetPVarInt(playerid, \"XP\") > 99) SetPVarInt(playerid, \"xplvl\", 2); else
if(GetPVarInt(playerid, \"XP\") < 500 && GetPVarInt(playerid, \"XP\") > 244) SetPVarInt(playerid, \"xplvl\", 3); else
if(GetPVarInt(playerid, \"XP\") < 800 && GetPVarInt(playerid, \"XP\") > 499) SetPVarInt(playerid, \"xplvl\", 4); else
if(GetPVarInt(playerid, \"XP\") < 1200 && GetPVarInt(playerid, \"XP\") > 799) SetPVarInt(playerid, \"xplvl\", 5); else
if(GetPVarInt(playerid, \"XP\") < 1800 && GetPVarInt(playerid, \"XP\") > 1199) SetPVarInt(playerid, \"xplvl\", 6); else
if(GetPVarInt(playerid, \"XP\") < 2500 && GetPVarInt(playerid, \"XP\") > 1799) SetPVarInt(playerid, \"xplvl\", 7); else
if(GetPVarInt(playerid, \"XP\") < 3200 && GetPVarInt(playerid, \"XP\") > 2499) SetPVarInt(playerid, \"xplvl\", 8); else
if(GetPVarInt(playerid, \"XP\") < 4000 && GetPVarInt(playerid, \"XP\") > 3199) SetPVarInt(playerid, \"xplvl\", 9); else
if(GetPVarInt(playerid, \"XP\") < 4800 && GetPVarInt(playerid, \"XP\") > 3999) SetPVarInt(playerid, \"xplvl\", 10); else
if(GetPVarInt(playerid, \"XP\") < 5900 && GetPVarInt(playerid, \"XP\") > 4799) SetPVarInt(playerid, \"xplvl\", 11); else
if(GetPVarInt(playerid, \"XP\") < 7000 && GetPVarInt(playerid, \"XP\") > 5899) SetPVarInt(playerid, \"xplvl\", 12); else
if(GetPVarInt(playerid, \"XP\") < 9000 && GetPVarInt(playerid, \"XP\") > 6999) SetPVarInt(playerid, \"xplvl\", 13); else
if(GetPVarInt(playerid, \"XP\") < 11000 && GetPVarInt(playerid, \"XP\") > 8999) SetPVarInt(playerid, \"xplvl\", 14); else
if(GetPVarInt(playerid, \"XP\") < 13500 && GetPVarInt(playerid, \"XP\") > 10999) SetPVarInt(playerid, \"xplvl\", 15); else
if(GetPVarInt(playerid, \"XP\") < 16000 && GetPVarInt(playerid, \"XP\") > 13499) SetPVarInt(playerid, \"xplvl\", 16); else
if(GetPVarInt(playerid, \"XP\") < 17000 && GetPVarInt(playerid, \"XP\") > 15999) SetPVarInt(playerid, \"xplvl\", 17); else
if(GetPVarInt(playerid, \"XP\") < 20000 && GetPVarInt(playerid, \"XP\") > 16999) SetPVarInt(playerid, \"xplvl\", 18); else
if(GetPVarInt(playerid, \"XP\") < 23000 && GetPVarInt(playerid, \"XP\") > 19999) SetPVarInt(playerid, \"xplvl\", 19); else
if(GetPVarInt(playerid, \"XP\") < 28000 && GetPVarInt(playerid, \"XP\") > 22999) SetPVarInt(playerid, \"xplvl\", 20); else
if(GetPVarInt(playerid, \"XP\") < 35000 && GetPVarInt(playerid, \"XP\") > 27999) SetPVarInt(playerid, \"xplvl\", 21); else
if(GetPVarInt(playerid, \"XP\") < 40000 && GetPVarInt(playerid, \"XP\") > 34999) SetPVarInt(playerid, \"xplvl\", 22); else
if(GetPVarInt(playerid, \"XP\") < 45000 && GetPVarInt(playerid, \"XP\") > 39999) SetPVarInt(playerid, \"xplvl\", 23); else
if(GetPVarInt(playerid, \"XP\") < 50000 && GetPVarInt(playerid, \"XP\") > 44999) SetPVarInt(playerid, \"xplvl\", 24); else
if(GetPVarInt(playerid, \"XP\") < 52000 && GetPVarInt(playerid, \"XP\") > 49999) SetPVarInt(playerid, \"xplvl\", 25); else
if(GetPVarInt(playerid, \"XP\") < 58000 && GetPVarInt(playerid, \"XP\") > 51999) SetPVarInt(playerid, \"xplvl\", 26); else
if(GetPVarInt(playerid, \"XP\") < 62000 && GetPVarInt(playerid, \"XP\") > 57999) SetPVarInt(playerid, \"xplvl\", 27); else
if(GetPVarInt(playerid, \"XP\") < 70000 && GetPVarInt(playerid, \"XP\") > 61999) SetPVarInt(playerid, \"xplvl\", 28); else
if(GetPVarInt(playerid, \"XP\") < 80000 && GetPVarInt(playerid, \"XP\") > 69999) SetPVarInt(playerid, \"xplvl\",29); else
if(GetPVarInt(playerid, \"XP\") < 100000 && GetPVarInt(playerid, \"XP\") > 79999) SetPVarInt(playerid, \"xplvl\", 30);
return 1;
}
forward XPUpdate();
public XPUpdate()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
new string[256];
format(string, sizeof(string), \"%d/XP~n~%d/LvL\", GetPVarInt(i, \"XP\"), GetPVarInt(i, \"xplvl\"));
PlayerTextDrawSetString(i,XPTD, string);
}
return true;
}
stock Connect_xp(playerid)
{
XPTD[playerid] = CreatePlayerTextDraw(playerid,10.000, 320.000, \"x/XP~n~x/LvL\");
PlayerTextDrawLetterSize(playerid,XPTD[playerid], 0.5, 1.0);
PlayerTextDrawColor(playerid,XPTD[playerid], zoold);
SetPVarInt(playerid, \"XP\", 0);  //XP[playerid]=0;
SetPVarInt(playerid, \"xplvl\", 0); //lvl[playerid]=0;
new file[128], vardas[128];
GetPlayerName(playerid, vardas, 128);
format(file,128,\"Users/%s.ini\",vardas);
SetPVarInt(playerid, \"XP\", dini_Int(file, \"XP\"));
SetPVarInt(playerid, \"xplvl\", dini_Int(file, \"LVL\"));
return true;
}
stock Disconnect_xp(playerid)
{
new file[128], vardas[128];
GetPlayerName(playerid, vardas, 128);
format(file,128,\"Users/%s.ini\",vardas);
if(!dini_Exists(file))
{
dini_Create(file);
}
dini_IntSet(file,\"XP\",GetPVarInt(playerid, \"XP\"));
dini_IntSet(file,\"LVL\",GetPVarInt(playerid, \"xplvl\"));
return true;
}
stock GiveXp(playerid, xp)
{
SetPVarInt(playerid, \"XP\", GetPVarInt(playerid, \"XP\") + xp);
return true;
}
stock SetXp(playerid, xp)
{
SetPVarString(playerid, \"XP\", xp);
return 1;
}
stock GetPlayerXP(playerid) return GetPVarInt(playerid, \"XP\");
stock GetPlayerXpLevel(playerid) return GetPVarInt(playerid, \"xplvl\");

 
[gmod]Javítottam a

tageket

tagekre![/gmod]
« Utoljára szerkesztve: 2014. Október 22. - 00:17:00 írta Dfoglalo »

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
XP Rendszer
« Válasz #1 Dátum: 2014. Április 04. - 23:54:44 »
0 Show voters
[gmod]Helló! Kérlek rakj hozzá egy képet majd az includet kérlek írd code tagok közé mivel mostanában elég hibás szokott lenni az ilyen feltöltõ linkek.  ;)[/gmod]

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
XP Rendszer
« Válasz #2 Dátum: 2014. Április 05. - 09:30:25 »
0 Show voters
Nem is rossz!
Tetszik hogy PVar-al dolgoztál, viszont a scriptben még bõven lehetne mit egyszerûsíteni, de tetszik! :)

Nem elérhető Loren

  • 1401
  • Ex Moderátor
    • Profil megtekintése
XP Rendszer
« Válasz #3 Dátum: 2014. Április 05. - 10:06:17 »
0 Show voters
Tetszik. Kezdõknek jól jön ;)!


Ha folytatnám a Clear Life mód írását, ezt használnám XP rendszerként :D

XP Rendszer
« Válasz #4 Dátum: 2014. Április 05. - 16:51:30 »
0 Show voters
Ment a plusz, grat  :thumbsup:

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
XP Rendszer
« Válasz #5 Dátum: 2014. Április 05. - 17:27:38 »
+1 Show voters
Nagyon jó kis dolog .Fel fogom használni kösz a megosztást.

XP Rendszer
« Válasz #6 Dátum: 2014. Április 08. - 10:29:12 »
0 Show voters
Nekem nem jeleniti meg a textdrawot

Nem elérhető KovaNovik

  • 1121
  • KovaNovik
    • Profil megtekintése
XP Rendszer
« Válasz #7 Dátum: 2014. Április 08. - 11:54:52 »
0 Show voters
Jó lett! Kaptál tõlem (is) egy pluszt!
Én még annyit elmondanék, hogy ezt a sok ifet jobb lenne helyettesíteni casekkel, vagy csak simán egy szorzót használni hozzá. Mindjárt írok részleteket.
Elsõ megoldás (switch, case):
 

forward XP_Level(playerid);
public XP_Level(playerid)
{
switch(GetPVarInt(playerid, \"XP\"))
{
case 0..100: SetPVarInt(playerid, \"xplvl\", 1);
case 100..250: SetPVarInt(playerid, \"xplvl\", 2);
case 250..500: SetPVarInt(playerid, \"xplvl\", 3);
case 500..800: SetPVarInt(playerid, \"xplvl\", 4);
case 800..1200: SetPVarInt(playerid, \"xplvl\", 5);
case 1200..1800: SetPVarInt(playerid, \"xplvl\", 6);
case 1800..2500: SetPVarInt(playerid, \"xplvl\", 7);
case 2500..3200: SetPVarInt(playerid, \"xplvl\", 8);
case 3200..4000: SetPVarInt(playerid, \"xplvl\", 9);
case 4000..4800: SetPVarInt(playerid, \"xplvl\", 10);
case 4800..5900: SetPVarInt(playerid, \"xplvl\", 11);
case 5900..7000: SetPVarInt(playerid, \"xplvl\", 12);
case 7000..9000: SetPVarInt(playerid, \"xplvl\", 13);
case 9000..11000: SetPVarInt(playerid, \"xplvl\", 14);
case 11000..13500: SetPVarInt(playerid, \"xplvl\", 15);
case 13500..16000: SetPVarInt(playerid, \"xplvl\", 16);
case 16000..17000: SetPVarInt(playerid, \"xplvl\", 17);
case 17000..20000: SetPVarInt(playerid, \"xplvl\", 18);
case 20000..23000: SetPVarInt(playerid, \"xplvl\", 19);
case 23000..28000: SetPVarInt(playerid, \"xplvl\", 20);
case 28000..35000: SetPVarInt(playerid, \"xplvl\", 21);
case 35000..40000: SetPVarInt(playerid, \"xplvl\", 22);
case 40000..45000: SetPVarInt(playerid, \"xplvl\", 23);
case 45000..50000: SetPVarInt(playerid, \"xplvl\", 24);
case 50000..52000: SetPVarInt(playerid, \"xplvl\", 25);
case 52000..58000: SetPVarInt(playerid, \"xplvl\", 26);
case 58000..62000: SetPVarInt(playerid, \"xplvl\", 27);
case 62000..70000: SetPVarInt(playerid, \"xplvl\", 28);
case 70000..80000: SetPVarInt(playerid, \"xplvl\", 29);
case 80000..100000: SetPVarInt(playerid, \"xplvl\", 30);
default:/*Ha semelyik nem igaz rá (<0 vagy >100000)*/SetPVarInt(playerid, \"xplvl\", 9999);
}
}

 
Második megoldás (ciklusos):
 

forward XP_Level(playerid);
public XP_Level(playerid)
{
new szinthatar[] =
{0, 100, 250, 500, 800, 1200, 1800, 2500, 3200, 4000, 4800, 5900,
7000, 9000, 11000, 13500, 16000, 17000, 20000, 23000, 28000, 35000,
40000, 45000, 50000, 52000, 58000, 62000, 70000, 80000, 100000};
for(new a = 0; a < sizeof(szinthatar), a++)
{
if(szinthatar[a] <= GetPVarInt(playerid, \"XP\") < szinthatar[a+1]) SetPVarInt(playerid, \"xplvl\", a);
}
}

 
Harmadik megoldás (coming soon, valami misztikus szorzóval lesz megoldva 1-2 sorban):
 

forward XP_Level(playerid);
public XP_Level(playerid)
{
new xplvl = GetPVarInt(playerid, \"xplvl\"), XP = GetPVarInt(playerid, \"XP\"), kelloxp = (floatround(floatsqroot(XP)*xplvl/(XP/12)*XP);
if(XP >= kelloxp) SetPVarInt(playerid, \"xplvl\", xplvl+1);
}

 
... vagy valami hasonló. :D Remélem nem írtam oltári nagy hülyeséget, a vége felé már nagyon bekavarodtam, de azért felteszem, hátha hasznát veszi valaki.
Mindenesetre sok szerencsét, további jó scriptelést(és még 1000 ilyen (kis hasznos) scriptet)! :thumbsup:
U.i.: Helyes code tag:
 
[ c o d e = p a w n ]  [ / c o d e ]
« Utoljára szerkesztve: 2014. Április 08. - 13:11:26 írta KovaNovik »

Nem elérhető Thomas_Jonson

  • 560
  • Thomas_Jonson
    • Profil megtekintése
XP Rendszer
« Válasz #8 Dátum: 2014. Április 08. - 13:53:16 »
+1 Show voters
Tetszik. :)

Nem elérhető huhboy

  • 894
  • huhboy
    • Profil megtekintése
XP Rendszer
« Válasz #9 Dátum: 2014. Április 04. - 22:56:44 »
0 Show voters
ÜDv! Nemrég készítettem egy egyszerû xp rendszert, amibõl a végén egy xp include lett.....
Szükséges fájlok:
scriptfiles-ban egy Users mappa.
Összesen 30 szint van, 99-ig növelhetõ. ( A szintek eléréséhez szükséges xp szám az include-ban van megadva)
Az include automatikusan létrehoz egy kis textdrawot a map felett, ami mutatja az xp számot, és a szintet.
Biztos van, akinek jól jön :)
Mod elejére: #include <xpinc>
funkciók:
 

GiveXp(playerid, XP);// az XP az érték
SetXp(playerid, XP); //az XP szintén az érték
GetPlayerXP(playerid);
GetPlayerXpLevel(playerid);

 
a Módba/fs-be behelyezendõ dolgok:
 

/*Az OnGameModeInit alá:*/
betoltendo();
/*OnPlayerConnect(playerid) alá:*/
Connect_xp(playerid);
/*OnPlayerDisconnect(playerid) alá: */
Disconnect_xp(playerid);

 
a kis textdraw, ami azért nincs túlszerkesztgetve, mert aki akar, az úgyis csinál olyat, amilyet szeretne :D
\"width=500http://kepfeltoltes.hu/140405/xp_www.kepfeltoltes.hu_.jpg[/img]
Letöltés: http://www.solidfiles.com/d/56c1c173d9/xpinc.inc
INC:
 
#include <a_samp>
#include <sscanf>
#include <dini>
//===================================================================================
//======================================scriptbe=====================================
//===================================================================================
/*
OnGameModeInit:  betoltendo();
OnPlayerConnect: Connect_xp(playerid);
OnPlayerDisconnect: Disconnect_xp(playerid);
 
*/
#define MAX_XP_LEVEL 99
#define Szin_RED 0xFF0000AA
#define Szin_YELLOW 0xFFFF00AA
 
#define zoold 0x00ff00AA
new PlayerText:XPTD[MAX_PLAYERS];
 
stock betoltendo()
{
SetTimer(\"XPUpdate\", 200, 1);
SetTimer(\"XP_Level\", 200, 1);
return 1;
}
//===================================================================================
//=========================================Szintek===================================
//===================================================================================
forward XP_Level(playerid);
public XP_Level(playerid)
{
if(GetPVarInt(playerid, \"XP\") < 100) SetPVarInt(playerid, \"xplvl\", 1); else
if(GetPVarInt(playerid, \"XP\") < 250 && GetPVarInt(playerid, \"XP\") > 99) SetPVarInt(playerid, \"xplvl\", 2); else
if(GetPVarInt(playerid, \"XP\") < 500 && GetPVarInt(playerid, \"XP\") > 244) SetPVarInt(playerid, \"xplvl\", 3); else
if(GetPVarInt(playerid, \"XP\") < 800 && GetPVarInt(playerid, \"XP\") > 499) SetPVarInt(playerid, \"xplvl\", 4); else
if(GetPVarInt(playerid, \"XP\") < 1200 && GetPVarInt(playerid, \"XP\") > 799) SetPVarInt(playerid, \"xplvl\", 5); else
if(GetPVarInt(playerid, \"XP\") < 1800 && GetPVarInt(playerid, \"XP\") > 1199) SetPVarInt(playerid, \"xplvl\", 6); else
if(GetPVarInt(playerid, \"XP\") < 2500 && GetPVarInt(playerid, \"XP\") > 1799) SetPVarInt(playerid, \"xplvl\", 7); else
if(GetPVarInt(playerid, \"XP\") < 3200 && GetPVarInt(playerid, \"XP\") > 2499) SetPVarInt(playerid, \"xplvl\", 8); else
if(GetPVarInt(playerid, \"XP\") < 4000 && GetPVarInt(playerid, \"XP\") > 3199) SetPVarInt(playerid, \"xplvl\", 9); else
if(GetPVarInt(playerid, \"XP\") < 4800 && GetPVarInt(playerid, \"XP\") > 3999) SetPVarInt(playerid, \"xplvl\", 10); else
if(GetPVarInt(playerid, \"XP\") < 5900 && GetPVarInt(playerid, \"XP\") > 4799) SetPVarInt(playerid, \"xplvl\", 11); else
if(GetPVarInt(playerid, \"XP\") < 7000 && GetPVarInt(playerid, \"XP\") > 5899) SetPVarInt(playerid, \"xplvl\", 12); else
if(GetPVarInt(playerid, \"XP\") < 9000 && GetPVarInt(playerid, \"XP\") > 6999) SetPVarInt(playerid, \"xplvl\", 13); else
if(GetPVarInt(playerid, \"XP\") < 11000 && GetPVarInt(playerid, \"XP\") > 8999) SetPVarInt(playerid, \"xplvl\", 14); else
if(GetPVarInt(playerid, \"XP\") < 13500 && GetPVarInt(playerid, \"XP\") > 10999) SetPVarInt(playerid, \"xplvl\", 15); else
if(GetPVarInt(playerid, \"XP\") < 16000 && GetPVarInt(playerid, \"XP\") > 13499) SetPVarInt(playerid, \"xplvl\", 16); else
if(GetPVarInt(playerid, \"XP\") < 17000 && GetPVarInt(playerid, \"XP\") > 15999) SetPVarInt(playerid, \"xplvl\", 17); else
if(GetPVarInt(playerid, \"XP\") < 20000 && GetPVarInt(playerid, \"XP\") > 16999) SetPVarInt(playerid, \"xplvl\", 18); else
if(GetPVarInt(playerid, \"XP\") < 23000 && GetPVarInt(playerid, \"XP\") > 19999) SetPVarInt(playerid, \"xplvl\", 19); else
if(GetPVarInt(playerid, \"XP\") < 28000 && GetPVarInt(playerid, \"XP\") > 22999) SetPVarInt(playerid, \"xplvl\", 20); else
if(GetPVarInt(playerid, \"XP\") < 35000 && GetPVarInt(playerid, \"XP\") > 27999) SetPVarInt(playerid, \"xplvl\", 21); else
if(GetPVarInt(playerid, \"XP\") < 40000 && GetPVarInt(playerid, \"XP\") > 34999) SetPVarInt(playerid, \"xplvl\", 22); else
if(GetPVarInt(playerid, \"XP\") < 45000 && GetPVarInt(playerid, \"XP\") > 39999) SetPVarInt(playerid, \"xplvl\", 23); else
if(GetPVarInt(playerid, \"XP\") < 50000 && GetPVarInt(playerid, \"XP\") > 44999) SetPVarInt(playerid, \"xplvl\", 24); else
if(GetPVarInt(playerid, \"XP\") < 52000 && GetPVarInt(playerid, \"XP\") > 49999) SetPVarInt(playerid, \"xplvl\", 25); else
if(GetPVarInt(playerid, \"XP\") < 58000 && GetPVarInt(playerid, \"XP\") > 51999) SetPVarInt(playerid, \"xplvl\", 26); else
if(GetPVarInt(playerid, \"XP\") < 62000 && GetPVarInt(playerid, \"XP\") > 57999) SetPVarInt(playerid, \"xplvl\", 27); else
if(GetPVarInt(playerid, \"XP\") < 70000 && GetPVarInt(playerid, \"XP\") > 61999) SetPVarInt(playerid, \"xplvl\", 28); else
if(GetPVarInt(playerid, \"XP\") < 80000 && GetPVarInt(playerid, \"XP\") > 69999) SetPVarInt(playerid, \"xplvl\",29); else
if(GetPVarInt(playerid, \"XP\") < 100000 && GetPVarInt(playerid, \"XP\") > 79999) SetPVarInt(playerid, \"xplvl\", 30);
return 1;
}
forward XPUpdate();
public XPUpdate()
{
for(new i=0;i<MAX_PLAYERS;i++)
{
new string[256];
format(string, sizeof(string), \"%d/XP~n~%d/LvL\", GetPVarInt(i, \"XP\"), GetPVarInt(i, \"xplvl\"));
PlayerTextDrawSetString(i,XPTD, string);
}
return true;
}
stock Connect_xp(playerid)
{
XPTD[playerid] = CreatePlayerTextDraw(playerid,10.000, 320.000, \"x/XP~n~x/LvL\");
PlayerTextDrawLetterSize(playerid,XPTD[playerid], 0.5, 1.0);
PlayerTextDrawColor(playerid,XPTD[playerid], zoold);
SetPVarInt(playerid, \"XP\", 0);  //XP[playerid]=0;
SetPVarInt(playerid, \"xplvl\", 0); //lvl[playerid]=0;
new file[128], vardas[128];
GetPlayerName(playerid, vardas, 128);
format(file,128,\"Users/%s.ini\",vardas);
SetPVarInt(playerid, \"XP\", dini_Int(file, \"XP\"));
SetPVarInt(playerid, \"xplvl\", dini_Int(file, \"LVL\"));
return true;
}
stock Disconnect_xp(playerid)
{
new file[128], vardas[128];
GetPlayerName(playerid, vardas, 128);
format(file,128,\"Users/%s.ini\",vardas);
if(!dini_Exists(file))
{
dini_Create(file);
}
dini_IntSet(file,\"XP\",GetPVarInt(playerid, \"XP\"));
dini_IntSet(file,\"LVL\",GetPVarInt(playerid, \"xplvl\"));
return true;
}
stock GiveXp(playerid, xp)
{
SetPVarInt(playerid, \"XP\", GetPVarInt(playerid, \"XP\") + xp);
return true;
}
stock SetXp(playerid, xp)
{
SetPVarString(playerid, \"XP\", xp);
return 1;
}
stock GetPlayerXP(playerid) return GetPVarInt(playerid, \"XP\");
stock GetPlayerXpLevel(playerid) return GetPVarInt(playerid, \"xplvl\");

 
[gmod]Javítottam a

tageket

tagekre![/gmod]
« Utoljára szerkesztve: 2014. Október 22. - 00:17:00 írta Dfoglalo »

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
XP Rendszer
« Válasz #10 Dátum: 2014. Április 04. - 23:54:44 »
0 Show voters
[gmod]Helló! Kérlek rakj hozzá egy képet majd az includet kérlek írd code tagok közé mivel mostanában elég hibás szokott lenni az ilyen feltöltõ linkek.  ;)[/gmod]

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
XP Rendszer
« Válasz #11 Dátum: 2014. Április 05. - 09:30:25 »
0 Show voters
Nem is rossz!
Tetszik hogy PVar-al dolgoztál, viszont a scriptben még bõven lehetne mit egyszerûsíteni, de tetszik! :)

Nem elérhető Loren

  • 1401
  • Ex Moderátor
    • Profil megtekintése
XP Rendszer
« Válasz #12 Dátum: 2014. Április 05. - 10:06:17 »
0 Show voters
Tetszik. Kezdõknek jól jön ;)!


Ha folytatnám a Clear Life mód írását, ezt használnám XP rendszerként :D

XP Rendszer
« Válasz #13 Dátum: 2014. Április 05. - 16:51:30 »
0 Show voters
Ment a plusz, grat  :thumbsup:

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
XP Rendszer
« Válasz #14 Dátum: 2014. Április 05. - 17:27:38 »
0 Show voters
Nagyon jó kis dolog .Fel fogom használni kösz a megosztást.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal