how to make XP system - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how to make XP system (
/showthread.php?tid=90671)
how to make XP system -
user226 - 09.08.2009
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
Re: how to make XP system -
Weirdosport - 09.08.2009
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.
Re: how to make XP system -
user226 - 09.08.2009
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?
Re: how to make XP system -
user226 - 09.08.2009
close theme
Re: how to make XP system -
Weirdosport - 09.08.2009
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..
Re: how to make XP system -
iLinx - 09.08.2009
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
Re: how to make XP system -
user226 - 10.08.2009
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..