SA-MP Forums Archive
Some help please :) :p - 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: Some help please :) :p (/showthread.php?tid=594117)



Some help please :) :p - ahmedraed - 13.11.2015

Quote:

CMDetlevel(playerid, params[])
{
new string[SOS];
new toplayerid, level;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "ERROR: You Aren't High Level Enough To Use This Command");
if(sscanf(params, "ui", toplayerid, level)) return SendClientMessage(playerid, RED, "ERROR: /setlevel [ID] [Level]");
if(!IsPlayerConnected(toplayerid)) return SendClientMessage(playerid, RED, "ERROR: The player is not connected");
if(level < 0 || level > 7) return SendClientMessage(playerid, RED, "ERROR: The level must be beetwen 0 & 7");
format(string, SOS, "***%s has been set as administator level %i", pInfo[toplayerid][Name], level);
SendClientMessage(playerid, GREEN, string);
format(string, SOS, "You have been set as administrator level %i by %s", level, pInfo[playerid][Name]);
SendClientMessage(toplayerid, GREEN, string);
pInfo[playerid][Admin]=level;
return 1;
}

i want to add pInfo[playerid][Admin]>5 at the same line of IsPlayerAdmin


Re: Some help please :) :p - Ritzy2K - 13.11.2015

Код:
If(!IsPlayerAdmin(playerid) || pInfo[playerid][Admin] > 5)
This will check if player is RCON admin OR An admin higher than level 5.


Re: Some help please :) :p - ahmedraed - 13.11.2015

gonna checking it


Re: Some help please :) :p - Ritzy2K - 13.11.2015

what? does this produce error? it should not, but if it does can you show me what you added and how?


Re: Some help please :) :p - ahmedraed - 13.11.2015

Not working saying you aren't high level admin in game


Re: Some help please :) :p - Ritzy2K - 14.11.2015

So you must not be Higher than level 5.


Re: Some help please :) :p - Karan007 - 14.11.2015

PHP код:
If(!IsPlayerAdmin(playerid) || pInfo[playerid][Admin] < 5
Try this. This will check if the player is RCON logged in or will check if the player is level 5 or more.


Re: Some help please :) :p - Ritzy2K - 14.11.2015

Nvm internet lag double posted.


Re: Some help please :) :p - Ritzy2K - 14.11.2015

Quote:
Originally Posted by Karan007
Посмотреть сообщение
PHP код:
If(!IsPlayerAdmin(playerid) || pInfo[playerid][Admin] < 5
Try this. This will check if the player is RCON logged in or will check if the player is level 5 or more.
If you dont know what you're doing :/ better don't help lol. M8 your code will check if the player is econ or an admin LESS THAN LEVEL 5! He asked for the code of more than level 5 which I already gave but I don't know what he is doing which is causing issues. You claimed that it will check if player is level 5 or more. For that the code should be. pInfo[playerid][Admin] >= 5.


Re: Some help please :) :p - Karan007 - 14.11.2015

Quote:
Originally Posted by [ND]xXZeusXx.
Посмотреть сообщение
If you dont know what you're doing :/ better don't help lol. M8 your code will check if the player is econ or an admin LESS THAN LEVEL 5! He asked for the code of more than level 5 which I already gave but I don't know what he is doing which is causing issues.
Well, i know what i'm doing. The full code is below.

PHP код:
If(!IsPlayerAdmin(playerid) || pInfo[playerid][Admin] < 5) return SendClientMessage(playeridRED"ERROR: You Aren't High Level Enough To Use This Command"); 
Well this will check if the player is not RCON admin or if he is less than level 5 then it'll return the following message!