How to Convert This?? (rep++++)
#1

===> I have made this /onduty and /offduty cmd. But i don't no how to write it in zcmd?? Like "dcmd_onduy"??
Can please anyone Convert this??
pawn Код:
//------------------------------------------------------------------------------
    if(strcmp(cmd, "/onduty", true) == 0)    {
    if(PlayerInfo[playerid][Level] >= 2) {
        CMDMessageToAdmins(playerid,"Now On Duty");   GetPlayerName(playerid, adminname, sizeof(adminname));
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i) == 1)   {
        SetPlayerSkin(playerid,217); GivePlayerWeapon(playerid,38,500000); SetPlayerHealth(playerid,100000); SetPlayerColor(playerid,pink); format(string,256,"Administrator %s Has Now On Admin Duty",adminname);  SendClientMessage(i,pink,string);   }
        }
    } else  {
    SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");   }
    return 1;   }

//------------------------------------------------------------------------------
    if(strcmp(cmd, "/offduty", true) == 0)
{
    if(PlayerInfo[playerid][Level] >= 2)
{
        CMDMessageToAdmins(playerid,"Now Off Duty");   GetPlayerName(playerid, adminname, sizeof(adminname));
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i) == 1)   {

ResetPlayerWeapons(playerid);
ForceClassSelection(playerid);
SetPlayerHealth(playerid,0);
format(string,256,"Administrator %s Has End With His Admin Duty",adminname);
SendClientMessage(i,pink,string);   }
        }
    } else  {
    SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");   }
    return 1;   }
Reply
#2

pawn Код:
CMD:onduty(playerid, params[])
{
    if(PlayerInfo[playerid][Level] < 2)return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    CMDMessageToAdmins(playerid,"Now On Duty");
    GetPlayerName(playerid, adminname, sizeof(adminname));
    SetPlayerSkin(playerid,217);
    GivePlayerWeapon(playerid,38,500000);
    SetPlayerHealth(playerid,100000);
    SetPlayerColor(playerid,pink);
    format(string,256,"Administrator %s Has Now On Admin Duty",adminname);
    SendClientMessage(i,pink,string);
    return 1;
}

CMD:offduty(playerid, params[])
{
    if(PlayerInfo[playerid][Level] < 2)return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    CMDMessageToAdmins(playerid,"Now On Duty");
    GetPlayerName(playerid, adminname, sizeof(adminname));
    ResetPlayerWeapons(playerid);
    ForceClassSelection(playerid);
    SetPlayerHealth(playerid,0);
    format(string,256,"Administrator %s Has End With His Admin Duty",adminname);
    SendClientMessage(i,pink,string);
    return 1;
}
And I removed some unnecessary stuff you had.
Reply
#3

Well find it out yourself we are not your Scripting slaves...

CMDnduty(playerid,params[])
Reply
#4

pawn Код:
// InOnPlayerCommandText
dcmd(offduty, 7, cmdtext);
dcmd(onduty,  6, cmdtext);
   


// Any part of script
dcmd_offduty(playerid, params[]){
{
    if(PlayerInfo[playerid][Level] >= 2)
    {
        CMDMessageToAdmins(playerid,"Now Off Duty");   GetPlayerName(playerid, adminname, sizeof(adminname));
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) == 1)
            {
                ResetPlayerWeapons(playerid);
                ForceClassSelection(playerid);
                SetPlayerHealth(playerid,0);
                format(string,256,"Administrator %s Has End With His Admin Duty",adminname);
                SendClientMessage(i,pink,string);
            }
        }
    }
    else
    {
        SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");   }
        return 1;
    }
    return true;
}


dcmd_onduty(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 2)
    {
        CMDMessageToAdmins(playerid,"Now On Duty");   GetPlayerName(playerid, adminname, sizeof(adminname));
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) == 1)
            {
                SetPlayerSkin(playerid,217); GivePlayerWeapon(playerid,38,500000); SetPlayerHealth(playerid,100000); SetPlayerColor(playerid,pink); format(string,256,"Administrator %s Has Now On Admin Duty",adminname);  SendClientMessage(i,pink,string);   }
            }
        }
        else
        {
            SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");   }
            return 1;
        }
    }
    return true;

}
Reply
#5

pawn Код:
dcmd(dutyoff, 7, cmdtext);
dcmd(dutyon,  6, cmdtext);
   


dcmd_dutyoff(playerid, params[]){
{
    if(PlayerInfo[playerid][Level] >= 4)
    {
        CMDMessageToAdmins(playerid,"Now Off Duty");   GetPlayerName(playerid, adminname, sizeof(adminname));
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) == 1)
            {
                ResetPlayerWeapons(playerid);
                ForceClassSelection(playerid);
                format(string,256,"Administrator %s is not anymore Admin Duty",adminname);
                SendClientMessage(i,pink,string);
            }
        }
    }
    else
    {
        SendClientMessage(playerid,red,"ERROR: You are not allowed to use this command");   }
        return 1;
    }
    return true;
}


dcmd_dutyon(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 4)
    {
        CMDMessageToAdmins(playerid,"Now On Duty");   GetPlayerName(playerid, adminname, sizeof(adminname));
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) == 1)
            {
          SetPlayerHealth(playerid,100000); SetPlayerColor(playerid,white); format(string,256,"Administrator %s is on duty now",adminname);  SendClientMessage(i,pink,string);   }
            }
        }
        else
        {
            SendClientMessage(playerid,red,"ERROR: You are not allowed use this command");   }
            return 1;
        }
    }
    return true;

}
iam using something like this :P
Reply
#6

Thnx All. I gave rep all of you except dereck...
@Dereck what the hell are u?? Why are u posting in my topic if you don't know anything. Getoff. I know you are just increasing your post. Sa-mp is platform for helping. All player post here and c00l guys help them. But like you..............................
Reply
#7

Well i support whatever iOmar Said.
Reply
#8

tHnx Bro
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)