Help with admin levels! - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with admin levels! (
/showthread.php?tid=80880)
Help with admin levels! -
coole210 - 07.06.2009
I made a command with my tcash script trying to make it with my aLevel (admin level) thing but it's not working. It saves my admin level but when i make new acc and do only admin commands it does it for anybody!
Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
{
if(PlayerInfo[playerid][aLevel] = 0) return SendClientMessage(playerid, red, "You are not an admin");
GivePlayerTcash(playerid, 1000000);
SendClientMessage(playerid, green, "You got 1 million Tcash!");
return 1;
}
Re: Help with admin levels! -
[CK]Steel - 07.06.2009
Copy and paste that into your script, and try now
pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
{
if(PlayerInfo[playerid][aLevel] = 1) return SendClientMessage(playerid, red, "You are not an admin");
GivePlayerTcash(playerid, 1000000);
SendClientMessage(playerid, green, "You got 1 million Tcash!");
return 1;
}
you had to put a 1 in,
hope this helped!
Re: Help with admin levels! -
[HiC]TheKiller - 07.06.2009
Quote:
Originally Posted by [CK
Steel ]
Copy and paste that into your script, and try now
pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0) { if(PlayerInfo[playerid][aLevel] = 1) return SendClientMessage(playerid, red, "You are not an admin");
GivePlayerTcash(playerid, 1000000);
SendClientMessage(playerid, green, "You got 1 million Tcash!"); return 1; }
|
FAIL +1
pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
{
if(PlayerInfo[playerid][aLevel] == 0/*Note the ==*/) return SendClientMessage(playerid, red, "You are not an admin");
GivePlayerTcash(playerid, 1000000);
SendClientMessage(playerid, green, "You got 1 million Tcash!");
return 1;
}
Re: Help with admin levels! -
[CK]Steel - 07.06.2009
Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by [CK
Steel ]
Copy and paste that into your script, and try now
pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0) { if(PlayerInfo[playerid][aLevel] = 1) return SendClientMessage(playerid, red, "You are not an admin");
GivePlayerTcash(playerid, 1000000);
SendClientMessage(playerid, green, "You got 1 million Tcash!"); return 1; }
|
FAIL +1
pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0) { if(PlayerInfo[playerid][aLevel] == 0/*Note the ==*/) return SendClientMessage(playerid, red, "You are not an admin"); GivePlayerTcash(playerid, 1000000); SendClientMessage(playerid, green, "You got 1 million Tcash!"); return 1; }
|
Dude are you a complete RETARD? Omg, and stop trying to cause flames... He supposed to put 1 cause that is the admin LEVEL. And first of all you do not know how to read damn posts cause he said he wanted it so that it lets ONLY admins type/Do that command. So if he wants admins to do that command then he needs to place a 1 in,
. First of all 1 signifies the admin level. 1, 2, 3, 4, 5 or what ever the Admin level is it in his script. If he puts 0 then it will let everyone use it, those who are not admins. Get me now? Duh.
So use this one...
pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
{
if(PlayerInfo[playerid][aLevel] == 1) return SendClientMessage(playerid, red, "You are not an admin"); // [aLevel] == 1 signifies that level admins +1 will be able to use that command.
GivePlayerTcash(playerid, 1000000);
SendClientMessage(playerid, green, "You got 1 million Tcash!");
return 1;
}
Re: Help with admin levels! -
[HiC]TheKiller - 08.06.2009
Quote:
Originally Posted by [CK
Steel ]
Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by [CK
Steel ]
Copy and paste that into your script, and try now
pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0) { if(PlayerInfo[playerid][aLevel] = 1) return SendClientMessage(playerid, red, "You are not an admin");
GivePlayerTcash(playerid, 1000000);
SendClientMessage(playerid, green, "You got 1 million Tcash!"); return 1; }
|
FAIL +1
pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0) { if(PlayerInfo[playerid][aLevel] == 0/*Note the ==*/) return SendClientMessage(playerid, red, "You are not an admin"); GivePlayerTcash(playerid, 1000000); SendClientMessage(playerid, green, "You got 1 million Tcash!"); return 1; }
|
Dude are you a complete RETARD? Omg, and stop trying to cause flames... He supposed to put 1 cause that is the admin LEVEL. And first of all you do not know how to read damn posts cause he said he wanted it so that it lets ONLY admins type/Do that command. So if he wants admins to do that command then he needs to place a 1 in, . First of all 1 signifies the admin level. 1, 2, 3, 4, 5 or what ever the Admin level is it in his script. If he puts 0 then it will let everyone use it, those who are not admins. Get me now? Duh.
So use this one...
pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0) { if(PlayerInfo[playerid][aLevel] == 1) return SendClientMessage(playerid, red, "You are not an admin"); // [aLevel] == 1 signifies that level admins +1 will be able to use that command. GivePlayerTcash(playerid, 1000000); SendClientMessage(playerid, green, "You got 1 million Tcash!"); return 1; }
|
Wow, you really are a noob!
pawn Код:
if(PlayerInfo[playerid][aLevel] == 1/*Which means that the player is admin? Correct?*/) return SendClientMessage(playerid, red, "You are not an admin"); /*This then returns the player is NOT admin.*/
So which is it? Player is admin or isn't? The one above will return "You are not an admin" if they are equal to the variable one which is probably level 1.
pawn Код:
if(PlayerInfo[playerid][aLevel] == 0/*Which means that the player is not admin? Correct?*/) return SendClientMessage(playerid, red, "You are not an admin"); /*This then returns the player is NOT admin.*/
This one will return the correct thing.