How can i create experience point system in y_ini
#1

I want to create an experience point system which will give experience point like score .. But not will be score .. It would be an enum which get saved in a file.ini, but i don't know how to create that type of system.. There is one but using dini and i want in y_ini. And player need to be get experience on every robbery. I also tried to do it many times.. But never get success.. So suggest me how can i do it .
Reply
#2

Firstly, follow SA-MPs number one rule (to me anyway) SEARCH and then POST. There are a lot of systems that are alike this, guides that can show you how to do it and from those, you can just vary the way you do the systems to get the one you want.

I'd advise reading this: https://sampforum.blast.hk/showthread.php?tid=175565

It's very easy when you know what to do. I'd suggest searching around first, if not, you can always ask a friend or post a more clear thread on what you want.

Reply
#3

I have read out this topic many times.. But not getting that how to update experience variable ... I mean that: i already creates a system which allows to give experience points but there is a silly mistake ... That is when i use GiveExperienceToPlayer(playerid, 20); then it set experience only once to 20 and after it doesn't add experience .. Again It set experience value to 20 ...so i want to know what i need to do to +experience value ...
Reply
#4

Simple...
pawn Код:
stock GiveExperienceToPlayer(playerid, value)
    {
    PlayerInfo[playerid][pExp] = value //change that to match your enum
    return 1;
    }
Then use Y_INI to save it as normal, in the thread that Cali posted
Reply
#5

Quote:
Originally Posted by Mattakil
Посмотреть сообщение
Simple...
pawn Код:
stock GiveExperienceToPlayer(playerid, value)
    {
    PlayerInfo[playerid][pExp] = value //change that to match your enum
    return 1;
    }
Then use Y_INI to save it as normal, in the thread that Cali posted
but it will not + experience value::
like when u use GiveExperienceToPlayer(playerid, 20);
u see in ur user.ini file it will show u
Experience = 20
n if you again use giveexperience...(playerid, 20);
it will show u in ur user.ini
Experience = 20
coz it will set the value of experience not add the value of experience previous value to new value ... N it is the main problem .. I want that next time it show me ..
Experience = 40 instead of 20
n i don't know how to do this..
Reply
#6

OOHHHHH

Thats easy as well :P

pawn Код:
stock GiveExperienceToPlayer(playerid, value)
    {
    PlayerInfo[playerid][pExp] = +value //change that to match your enum
    return 1;
    }
If you want to add or remove, just use + or - before the value, for example, if you wanna add 2 to the persons score, just do SetPlayerScore(playerid, +2) and etc.
Reply
#7

Quote:
Originally Posted by Mattakil
Посмотреть сообщение
OOHHHHH

Thats easy as well :P

pawn Код:
stock GiveExperienceToPlayer(playerid, value)
    {
    PlayerInfo[playerid][pExp] = +value //change that to match your enum
    return 1;
    }
If you want to add or remove, just use + or - before the value, for example, if you wanna add 2 to the persons score, just do SetPlayerScore(playerid, +2) and etc.
its PlayerInfo[playerid][pExp] += value;
and not
PlayerInfo[playerid][pExp] = +value
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)