SA-MP Forums Archive
How can i create experience point system in y_ini - 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: How can i create experience point system in y_ini (/showthread.php?tid=466643)



How can i create experience point system in y_ini - PrinceKumar - 28.09.2013

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 .


Re: How can i create experience point system in y_ini - Tropicali - 29.09.2013

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.




Re: How can i create experience point system in y_ini - PrinceKumar - 01.10.2013

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 ...


Re: How can i create experience point system in y_ini - Mattakil - 01.10.2013

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


Re: How can i create experience point system in y_ini - PrinceKumar - 01.10.2013

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..


Re: How can i create experience point system in y_ini - Mattakil - 01.10.2013

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.


Re: How can i create experience point system in y_ini - Lidor124 - 01.10.2013

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