Question to LADMIN - 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: Question to LADMIN (
/showthread.php?tid=225730)
Question to LADMIN -
Julian12345 - 14.02.2011
Hello. I have Lethals Adminsystem and a question.
How to set a command for 1 level only?
Example: /kick for level 1 (Level 2-5 can't use this command anymore)
It was only an example.
AW: Question to LADMIN -
Julian12345 - 15.02.2011
*bump*
Re: Question to LADMIN -
Libra_PL - 15.02.2011
Original command of /kick is:
Код:
dcmd_kick(playerid,params[]) {
if(PlayerInfo[playerid][LoggedIn] == 1) {
if(PlayerInfo[playerid][Level] >= 3) {
new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /kick [playerid] [reason]");
new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) {
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
CMDMessageToAdmins(playerid,"KICK");
if(!strlen(tmp2)) {
format(string,sizeof(string),"%s has been kicked by Administrator %s [no reason given] ",playername,adminname); SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string); print(string); return Kick(player1);
} else {
format(string,sizeof(string),"%s has been kicked by Administrator %s [reason: %s] ",playername,adminname,params[2]); SendClientMessageToAll(grey,string);
SaveToFile("KickLog",string); print(string); return Kick(player1); }
} else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin");
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
} else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
There where is:
Код:
if(PlayerInfo[playerid][Level] >= 3) {
Change to:
Код:
if(PlayerInfo[playerid][Level] = 1) {
= - only with this level (>= means this level or higher)
1 - only with level 1
AW: Question to LADMIN -
Julian12345 - 15.02.2011
Hello and thanks for your answer!
I tried it with the command /setskin and could compile it, but I got a warning:
pawn Код:
warning 211: possibly unintended assignment
I edited the command as follows:
pawn Код:
dcmd_setskin(playerid,params[]) {
if(PlayerInfo[playerid][Level] = 4) {
The problem is, that I could still use the command as level 5, although I made it for level 4 only.
Re: Question to LADMIN -
spedico - 15.02.2011
Try == instead of =
Re: Question to LADMIN -
Libra_PL - 15.02.2011
Oh yeah, my fail. Use ==, not =.
Re: Question to LADMIN -
HyperZ - 15.02.2011
It should be:
pawn Код:
if(PlayerInfo[playerid][Level] < 1) {
Re: Question to LADMIN - XFlawless - 15.02.2011
Ask this question in LAdmin Topic ?
They would help you.
Re: Question to LADMIN -
HyperZ - 15.02.2011
Quote:
Originally Posted by Meyer
Ask this question in LAdmin Topic ?
They would help you.
|
Why?
Scripting Discussion Topic isn't for help?
AW: Question to LADMIN -
Julian12345 - 15.02.2011
Quote:
Originally Posted by spedico
Try == instead of =
|
Quote:
Originally Posted by Libra_PL
Oh yeah, my fail. Use ==, not =.
|
That works! Thank you very much!
Topic can be locked.