![]() |
|
In-game access rights - Printable Version +- Las Venturas Playground (https://forum.sa-mp.nl) +-- Forum: Main Talk (https://forum.sa-mp.nl/forum-3.html) +--- Forum: Development (https://forum.sa-mp.nl/forum-16.html) +--- Thread: In-game access rights (/thread-5486.html) |
In-game access rights - Peter - 01-23-2008 In the new gamemode, everything will be based on access rights (which are per-player) rather than the current "admin"/"moderator" way. This allows us to give any kind of rights to anyone who we thing is worthy to have these specific rights. Meaning admin rights who can't do everything a loyal player can! [table] [tr] [td]Right ID [/td] [td]Right Tag [/td] [td]Description[/td] [td] [/td] [/tr] [tr] [td]1[/td] [td]CAN_JOIN[/td] [td]Indicates that this player is allowed to join the server. [/td] [td][all][/td] [/tr] [/table] The tags can be used in server-side scripts (access related stuff shouldn't occur in client-side scripts anyway) using the following syntax. All tags are automatically registered using the LVP Core and have the ID associated with the right, as described above. It does not matter whether you use the ID or the enum-value. echoMessage ( "Value of the CAN_JOIN right is: " .. LVP_RIGHTS.CAN_JOIN ) Mind the dot in the middle of the right-value. When you use it in the LVP C++ Core, whatever you might be doing there in the first place, that dot has to become another underscore so the define would be LVP_RIGHTS_CAN_JOIN, carrying the same value as the LUA value. Coloured Circle value's: [all] Indicates that all players get this right by default Re: In-game access rights - Badeend - 01-23-2008 Would it be a good idea to give these rights certain short notations such as, in this case, CAN_JOIN or something? Imho that would be making stuff a lot clearer. Re: In-game access rights - Peter - 01-23-2008 (01-23-2008, 09:09 PM)Badeend link Wrote: Would it be a good idea to give these rights certain short notations such as, in this case, CAN_JOIN or something? Imho that would be making stuff a lot clearer. Ideally yes, but unfortunately LUA does not support defines like Pawn does. Enums would be ideal, but that would have to be programmed in the Core itself. Syntax would become like LVP_RIGHT_* and it would be used internally as well. I'll think about it. Edit: Has been implented. Syntax described in the first post. Re: In-game access rights - Badeend - 01-24-2008 Current right tag list: (more to be added later) Code: CAN_ANNOUNCERe: In-game access rights - Sander - 01-24-2008 Do you really want to go that "basic", to deny/allow people to chat/bank/buy weapons? Or, maybe a better question: What are the default rights a new player should get? Re: In-game access rights - tomozj - 01-24-2008 Well the chat right would be something with mutes, right? So instead of another var for mute, just turn their chat 'off', and send them a message. The bank is a little extreme, but I guess a lot of these won't be used too much. Re: In-game access rights - Badeend - 01-25-2008 I just want every right to be controllable, even if we'll (almost) never use it. Commands such as help and other player-specific text-only commands are the only things (maybe some others that i haven't thought of yet) that don't really need to be controlled. |