How would I do this?
#1

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..
Reply
#2

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
Reply
#3

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

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.
Reply
#5

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.
Reply
#6

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];
Reply
#7

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
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)