I want a help about this
if ( player.name !== Shovon^ ) MessagePlayer("u r not authorized ",player);
Now I want this to be two or more names how do I do it??
@Shovon^ the thing you are doing is going to give error. Your name needs to be a string. and its player.
Name not player.name.
Use like this
example:
if ( player.Name != "Shovon^" || player.Name != "[DS]Anik" || player.Name != "Anik" || player.Name != "Another_name_here" || player.Name != "Just_repeat_like_this") MessagePlayer("u r not authorized ",player);
Thnx Anik my problem solved
Another problem is that you were using !== mark teh 2nd =, in JS, it is an alias for equality check In squirrel, idk what it does.
:edit: Thanks to Thijn, I've corrected it. In squirrel too, it does the same.
you shouldnt be using if player.Name security
what if someone joins as your nick and uses your commands
Quote from: Kewun on Sep 29, 2016, 02:00 PMyou shouldnt be using if player.Name security
what if someone joins as your nick and uses your commands
Wrong every server has security no server allow cmd using if he is not login
Did not understand your english but i think you do not know what i mean.
Quote from: Kewun on Sep 29, 2016, 02:11 PMDid not understand your english but i think you do not know what i mean.
Two players can't join with the same nick. And don't you think he would have something to do? Like changing the name...
but i mean when he leaves the server, other troll can join with his name, and troll plrs
Quote from: KAKAN on Sep 29, 2016, 01:19 PMAnother problem is that you were using !== mark teh 2nd =, in JS, it is an alias for instanceof. In squirrel, idk what it does.
!== most certainly does not mean instanceof in any language, including JS.
For weakly typed (https://en.wikipedia.org/wiki/Strong_and_weak_typing) languages (like JS and squirrel, but also PHP) the === operator means equal value AND equal type.
For example:
if ( "1" == 1 ) will return true
if ( "1" === 1) will return false, since the type (string vs int) does not match.
Quote from: Thijn on Sep 29, 2016, 04:38 PMQuote from: KAKAN on Sep 29, 2016, 01:19 PMAnother problem is that you were using !== mark teh 2nd =, in JS, it is an alias for instanceof. In squirrel, idk what it does.
!== most certainly does not mean instanceof in any language, including JS.
Oh yeah, I forgot, it was something like equality check :D
But, still then do you think someone would care for it (http://forum.vc-mp.org/?topic=3766.msg28230#msg28230)?