SA-MP Forums Archive
How would 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How would I do this? (/showthread.php?tid=97386)



How would I do this? - _Vortex - 14.09.2009

Ok, I'm trying to store my player's level securley, by making it in a diffrent area other than "Level" and if they login sucsfully, then it sets their level to what ever is in the "pLevel" area within their playerfile..

I'm using dini and I was thinking something like when they login, it gets their "pLevel" from their file and sets that to their "Level" in their file.. but how would I do this..

Better explination

Players "pLevel" is set to 5 (in their file (ex. "pLevel=5")
Player logs in sucsfully
Players "Level" is set to what their "pLevel" is

and then (i know how to do this)
Player disconnects and "Level" is set to 0, so they no one can go on their account, not login and use admin commands.

Sorry, I'm not the best at explaining things..


Re: How would I do this? - andreportugal - 14.09.2009

so what you are trying to do is: making a spawn area for each player level per example:

lvl 1 - lsairport
lvl 2 - desert air
lvl 3 - the strip
lvl 4 - grove st
lvl 5 - maddog mansion

is it something like this


Re: How would I do this? - Calgon - 14.09.2009

Use dini_IntSet() to set their level OnPlayerDisconnect, then when they reconnect, use dini_Int().


Re: How would I do this? - _Vortex - 14.09.2009

Quote:
Originally Posted by Calgon
Use dini_IntSet() to set their level OnPlayerDisconnect, then when they reconnect, use dini_Int().
This would be a problem, if they didn't login, and they disconnected, their level would be set to 0 when they connect.


Re: How would I do this? - Calgon - 14.09.2009

Make your own callback, fire it when they attempt to authenticate. It checks their password with the one defined in their file, and then loads the required variables, such as level.


Re: How would I do this? - _Vortex - 14.09.2009

Quote:
Originally Posted by Calgon
Make your own callback, fire it when they attempt to authenticate. It checks their password with the one defined in their file, and then loads the required variables, such as level.
Nvm I got it.

when they login

Код:
dini_IntSet(PlayerFile,"Level",pInfo[playerid][pLevel]);
pInfo[playerid][Level] = pInfo[playerid][pLevel];



Re: How would I do this? - Annihalation - 14.09.2009

I dont get what you mean by setting a level so that people cant use their admin controls ect. Like each person has their own number? or a number that is basically what their rank is, admin wise. Seems like you solved your problem though, ask if you need help with anything else


Re: How would I do this? - _Vortex - 14.09.2009

If I just have in their player file "Level" and then the commands are set like if(pinfo[playerid][Level] < 3 and someone goes on an admins name, and they dont login they can still use admin commands.

Having something to store the admin level, then loading it once they login is safer.