SA-MP Forums Archive
How do I do this? - 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 do I do this? (/showthread.php?tid=484411)



How do I do this? - rakshith122 - 30.12.2013

Well, I created a new faction on my cops and robbers gamemode. Everything was good and it compiled without any warnings or errors. My faction name is NironB, Now I want to know how to I save the permissions on the user file.
When I have CIA stats, ON player file it shows CIA=1337, Like that I need it for this. When I give someone this faction stats it should save on the user data like NironB=1337.

Hope someone would help me!
Thanks.


Re: How do I do this? - iDuckling - 31.12.2013




Re: How do I do this? - newbie scripter - 31.12.2013

No code =================== No help.


Re: How do I do this? - rakshith122 - 31.12.2013

Well, Seems none understood that first post. I'll explain it clearly now..
I have my server installed with SFCRRPG gamemode. A modified one. As you might know, That gamemode has 2 factions namely CIA and Army. When I give someone CIA stats, It will save the CIA stats on his user file. (Playername.dudb file)
Sample userfile :
Код:
password_hash=74777030
Money=7500
Bankcash=5000
Score=-6
Adminlevel=1337
Nameban=0
Army=1337
CIA=1337 ( When I give someone CIA stats, It's automatically saved here )
RegularPlayer=0
Now, I have created a new faction on this gamemode. But, I have to save the stats of it in this user file. But how?
Example : ** On user file it should be added like this **
Код:
password_hash=74777030
Money=7500
Bankcash=5000
Score=6
Adminlevel=1337
Nameban=0
Army=1337
HERE(FactionName)=1337 ( I want that new faction stats saved here )
CIA=1337
RegularPlayer=0
I hope you understood it now. Help me now!


Re: How do I do this? - iDuckling - 31.12.2013

What does the 1337 next to CIA mean? A rank?


Re: How do I do this? - HK - 31.12.2013

Are you using SII to save INI?


Re: How do I do this? - iDuckling - 31.12.2013

Quote:
Originally Posted by HK
Посмотреть сообщение
Are you using SII to save INI?
Looks like he uses dudb, so I guess INI


Re: How do I do this? - rakshith122 - 31.12.2013

Quote:
Originally Posted by iDuckling
Посмотреть сообщение
What does the 1337 next to CIA mean? A rank?
Its the rank.

Quote:
Originally Posted by HK
Посмотреть сообщение
Are you using SII to save INI?
To save the ranks, It uses this format
pawn Код:
dUserSetINT(PlayerName(playerid)).("CIA",CanUseCIA[playerid]);
yeah, I use .dudb


Re: How do I do this? - HK - 31.12.2013

Then you need one that writes the rank when registering and one loading on login


Re: How do I do this? - rakshith122 - 31.12.2013

When a new player registers,
pawn Код:
if (udb_Create(PlayerName(playerid),inputtext))
BLA BLA BLA BLA All the code goes and in the middle my code is entered.
        dUserSetINT(PlayerName(playerid)).("NironB",0);
When an old player logins
pawn Код:
if(PLAYERLIST_authed[playerid] == 1)
BLA BLA BLA BLA All the code goes and in the middle my code is entered.
dUserSetINT(PlayerName(playerid)).("NironB",CanUseNironB[playerid]);
Still it doesn't save the stats on my .dudb file.