How can i get rid of this ? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How can i get rid of this ? (
/showthread.php?tid=555055)
How can i get rid of this ? -
killing - 06.01.2015
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 ?
Re: How can i get rid of this ? -
Dignity - 06.01.2015
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;
Re: How can i get rid of this ? -
killing - 06.01.2015
Thanks
Re: How can i get rid of this ? -
Threshold - 06.01.2015
Or you could reset all variables OnPlayerConnect and load them when the player logs in... that would be a much safer option...
Re: How can i get rid of this ? -
Dignity - 06.01.2015
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.
Re: How can i get rid of this ? -
Djole1337 - 06.01.2015
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.
AW: How can i get rid of this ? -
Nero_3D - 06.01.2015
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
Re: How can i get rid of this ? -
killing - 07.01.2015
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 ..