Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Cool on Nov 05, 2015, 02:46 PM

Title: login and register
Post by: Cool on Nov 05, 2015, 02:46 PM
Hi guys can you help me
i need help in my server players can use cmds if he not registered and he can use cmds if he not login is there any function to solve it
Note:  using fuzzie account system
Title: Re: login and register
Post by: DizzasTeR on Nov 05, 2015, 02:49 PM
function onPlayerCommand( player, cmd, text )
{
    if( cmd.tolower() != "login" || cmd.tolower() != "register" && !pstats[ player.ID ].Logged ) return MessagePlayer( "Error: You must be logged in or registered to use any commands!", player );
}

keep that line on the inside-top of your event.
Title: Re: login and register
Post by: KAKAN on Nov 05, 2015, 02:50 PM
Yea, use this
function onPlayerCommand( player, cmd, text ){
//Your login and register things
if( stats[ player.ID ].Logged ) RegUserCmds( player, cmd.tolower(), text.tolower() )
else PrivMessage( player, "You need to be logged-in and registered to use this command" );
}

Now use this for registered and logged-in players
function RegUserCmds( player, cmd, text ){
//Your cmds here
}
Title: Re: login and register
Post by: Cool on Nov 08, 2015, 05:23 PM
Thanks kakan and dhoom
[mergedate]1446736853[/mergedate]
[EDIT] hi @KAKAN  i added your function its works but i want to add function onadmincmds its not works
Title: Re: login and register
Post by: MacTavish on Nov 08, 2015, 07:02 PM
Use @Doom_Kill3R's code that is an easiest way to go through every command
Title: Re: login and register
Post by: Cool on Nov 08, 2015, 07:03 PM
i try but its says you are not registered or login while i am login and registered
Title: Re: login and register
Post by: Cool on Nov 08, 2015, 08:11 PM
Solved By @Kusanagi