Posts: 107
Threads: 27
Joined: Jun 2014
Reputation:
0
Hi all!
I try to make a level system using y_ini. I don't wanna have payday, players can only earn respect points working at jobs.
Anyone can help me with /buylevel?
Sorry for my englis, RO right there.
Posts: 920
Threads: 113
Joined: Nov 2009
Reputation:
0
Use a variable to store every player's level. Save the value of the variable to the player's y_ini file when the player disconnects. And load the value of the player's y_ini file to your variable when the player logs on.
Posts: 107
Threads: 27
Joined: Jun 2014
Reputation:
0
Already make that but...i don't have no idea how to make /buylevel command.
Posts: 155
Threads: 41
Joined: Feb 2014
Reputation:
0
Try to do something like that:
// On top of your script
new level[MAX_PLAYERS];
// Command
CMD:buylevel(playerid, params[])
{
GivePlayerMoney(playerid, -200);
level[playerid]=1;
return 1;
}
Sorry I don't know why [PAWN] [PAWN] not working.
Posts: 107
Threads: 27
Joined: Jun 2014
Reputation:
0
Thx a lot guys! It works! edit a little bit but it works!
CMD:buylevel(playerid, params[])
{
if(PlayerInfo[playerid][pRP] >= 50)
{
GivePlayerMoney(playerid, -200);
PlayerInfo[playerid][pLevel] += 1;
}
return 1;
}