SA-MP Forums Archive
Question - 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: Question (/showthread.php?tid=476210)



Question - Joe_Goro - 17.11.2013

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 ?


Re: Question - dominik523 - 17.11.2013

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