Levels - 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)
+--- Thread: Levels (
/showthread.php?tid=514306)
Levels -
Steel_ - 20.05.2014
Where could i get a level system like i do /buylevel and the command /flip unlocks for me and in the TAB it shows my new score? If someone has made something like that please let me know! Or if there is a tutorial send that please
Re: Levels -
Abagail - 20.05.2014
Assuming you have a player system using pInfo or PlayerInfo style... This is very simple, and probably not a very good command but it's just so you get the gist. I'd recommend making it more advanced and such.
pawn Код:
#define MAXIMUM_LEVEL 1000
#define FLIP_LEVEL 2
#define LEVEL_COST 100000
CMD:buylevel(playerid, params[])
{
if(PlayerInfo[playerid][pLevel] >= MAXIMUM_LEVEL) return SCM(playerid, -1, "You have reached the maximum level.");
else {
if(GetPlayerCash(playerid) < LEVEL_COST) return scm(playerid, -1, "You don't have enough money.");
PlayerInfo[playerid][pLevel] =+ 1;
new string[126];
format(string, sizeof(string), "You have bought level %d", PlayerInfo[playerid][pLevel]);
scm(playerid, -1, string);
return 1;
}
CMD:flip(playerid, params[])
{
if(PlayerInfo[playerid][pLevel] < FLIP_LEVEL) return scm(playerid, -1, "Your level isn't high enough to use this command.");
// rest of cmd //
return 1;
}
Re: Levels -
Steel_ - 20.05.2014
Ok thank you for the script i am now working off it and i understood the whole thing
Re: Levels -
Steel_ - 20.05.2014
i didnt want to make another topic but ive got one problem in my teleports i put so i can teleport with vehicle but in chat it keeps showing SERVER:Unknown Command even though i teleported
Re: Levels -
DavidBilla - 20.05.2014
Use return 1; in that case
Re: Levels -
Steel_ - 21.05.2014
Omg i didnt realise that thank you how could i miss something simple like that