Question
#1

in all my script cmds this line


PartOfCode
pawn Код:
CMD:gotoplayerscar(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdminDuty] != 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this whilst your off Duty!"); // this !
    if(PlayerInfo[playerid][pAdmin] >= 2) // and this
    {

        new
            iTargetID;

        if(sscanf(params, "u", iTargetID)) {
            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gotoplayerscar [playerid]");
        }
        else if(IsPlayerConnected(iTargetID)) {
another part
pawn Код:
CMD:cutterrims(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdminDuty] != 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this whilst your off Duty!"); // this

    if(IsPlayerConnected(playerid)) {
        if(PlayerInfo[playerid][pAdmin] < 2) { // this
            SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
            return 1;
        }
        if(!IsPlayerInAnyVehicle(playerid)) {
question here
is it fine to replace
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdminDuty] != 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this whilst your off Duty!");
to
pawn Код:
if(PlayerInfo[playerid][pAdminDuty] != 1) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this whilst your off Duty!");
in the both codes up ?
Reply
#2

you can use it like this:
Код:
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GREY, "Level 2 + admins only!");
if(PlayerInfo[playerid][pAdminDuty] != 1) return SendClientMessage(playerid, COLOR_GREY, "You must be on duty to use this command!")
// rest of the code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)