how to make XP system
#1

hello!
i needed in XP system.
As in the GTO, you know?
tell me please, is possible anywhere to download finished XP system? XP SYSTEM AND NOT RANK / LEVEL sys!

or tell me please, how to make, xp system, i need: GivePlayerXp,GetPlayerXp,SetPlayerXp
Reply
#2

You may aswell just use the score system built into SA-MP.

SetPlayerScore(playerid, score);
GetPlayerScore(playerid);

You can add to these yourself, with things like:

pawn Код:
stock GivePlayerScore(playerid, score)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) + score);
    return GetPlayerScore(playerid); //added for the sake of it.
}
On top of this you'll need the help of a script like dudb to save the score when a player disconnects, and reload it upon their (safe) return.
Reply
#3

Quote:
Originally Posted by Weirdosport
You may aswell just use the score system built into SA-MP.

SetPlayerScore(playerid, score);
GetPlayerScore(playerid);

You can add to these yourself, with things like:

pawn Код:
stock GivePlayerScore(playerid, score)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) + score);
    return GetPlayerScore(playerid); //added for the sake of it.
}
On top of this you'll need the help of a script like dudb to save the score when a player disconnects, and reload it upon their (safe) return.
am .. a how to rename GivePlayerScore GetPlayerScore SetPlayerScore in GivePlayerXP GetPlayerXP SetPlayerXP
Really?
Reply
#4

close theme
Reply
#5

If you really want to rename them you can do this:

pawn Код:
stock SetPlayerXp(playerid, Xp)
{
return SetPlayerScore(playerid, Xp);
}
But it's fairly pointless..
Reply
#6

you could also just make a player variable
Код:
new PlayerXP[MAX_PLAYERS];
and then when someone gets more exp you could do something like this ( lets say its 50 exp)
Код:
PlayerXP[playerid] += 50;
Dont forget to set the xp to 0 on disconnect
Код:
OnPlayerDisconnect(playerid) {
PlayerXP[playerid] = 0;
return 1;
}
and you could save it however you want in dudb or dutils or wev
Reply
#7

Quote:
Originally Posted by Weirdosport
If you really want to rename them you can do this:

pawn Код:
stock SetPlayerXp(playerid, Xp)
{
return SetPlayerScore(playerid, Xp);
}
But it's fairly pointless..
Quote:
Originally Posted by iLinx
you could also just make a player variable
Код:
new PlayerXP[MAX_PLAYERS];
and then when someone gets more exp you could do something like this ( lets say its 50 exp)
Код:
PlayerXP[playerid] += 50;
Dont forget to set the xp to 0 on disconnect
Код:
OnPlayerDisconnect(playerid) {
PlayerXP[playerid] = 0;
return 1;
}
and you could save it however you want in dudb or dutils or wev
thanks, but i already created script..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)