How can i get rid of this ?
#1

when player connects he can type before he login. Players use to copy admin names and connect to server when login dialog appears they press f6 and type start using admin commands . How to fix this ?

Tell me which code to show ?
Reply
#2

Use a boolean to determine whether the player is logged in. If they're not, make the command return false.

pawn Код:
// Below your includes, outside any callback/function.
new bool: Logged[MAX_PLAYERS];

// After logging in:
Logged[playerid] = true;

// Under the commands:
if(!Logged[playerid]) return false;
Reply
#3

Thanks
Reply
#4

Or you could reset all variables OnPlayerConnect and load them when the player logs in... that would be a much safer option...
Reply
#5

Quote:
Originally Posted by Turn
Посмотреть сообщение
why the fuck do you use booleans over nothing
Why not? Booleans don't use more space than a regular integer, the only difference being that it only allows two values to be set. There's really no reason to not use them if you are only checking if a variable is true or false.
Reply
#6

Quote:
Originally Posted by Mionee
Посмотреть сообщение
Why not? Booleans don't use more space than a regular integer, the only difference being that it only allows two values to be set. There's really no reason to not use them if you are only checking if a variable is true or false.
Why not char-arrays?
pawn Код:
new bool:Logged[MAX_PLAYERS char];
You're saving up to 1500 bytes.
Reply
#7

the better question is why does these commands even work if the player hasn't logged in ?

Normally you set the admin variable to true if an admin account logs in and not if someone joined with some special name

=> You should rewrite your admin system
Reply
#8

its bugging again , now different problem. Only the admin who logins 1st in server only he can use cmds , other admin who login after him he can't use ..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)