ZCMD - sscanf2
#1

Hey!

Can someone make these CMD to zcmd and sscanf2?

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/gotoambu", cmdtext, true) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
            if(Goto[playerid] == 0 && InAmbu[playerid] == 0)
            {
                if(Watching[playerid] == 0)
                {
                    GetPlayerPos(playerid, Pos[playerid][0], Pos[playerid][1], Pos[playerid][2]);
                    GetPlayerFacingAngle(playerid, Float:Angle[playerid]);
                    SetPlayerPos(playerid, 2003.3, 2284.2, 1011.1);
                    SetPlayerFacingAngle(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                    Interior[playerid] = GetPlayerInterior(playerid);
                    SetPlayerInterior(playerid, 1);
                    Goto[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You have teleported to the ambulance, use /exitambu to exit.");
                }
                else return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You are watching the ambulance, use /watchoff to stop.");
            }
            else return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You are already in the ambulance.");
        }
        return 1;
    }
   
    if(strcmp("/exitambu", cmdtext, true) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
            if(Goto[playerid] == 1)
            {
                if(Watching[playerid] == 0)
                {
                    SetPlayerPos(playerid, Pos[playerid][0], Pos[playerid][1], Pos[playerid][2]);
                    SetCameraBehindPlayer(playerid);
                    SetPlayerFacingAngle(playerid, Float:Angle[playerid]);
                    SetPlayerInterior(playerid, Interior[playerid]);
                    Goto[playerid] = 0;
                }
                else return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You are watching the ambulance, use /watchoff to stop.");
            }
        }
        return 1;
    }
   
    if(strcmp("/watchambu", cmdtext, true) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
            if(InAmbu[playerid] == 0 && Goto[playerid] == 0)
            {
                if(Watching[playerid] == 0)
                {
                    TogglePlayerControllable(playerid, 0);
                    GetPlayerPos(playerid, Pos[playerid][0], Pos[playerid][1], Pos[playerid][2]);
                    GetPlayerFacingAngle(playerid, Float:Angle[playerid]);
                    Interior[playerid] = GetPlayerInterior(playerid);
                    SetPlayerInterior(playerid, 1);
                    SetPlayerPos(playerid, 2005.0, 2283.7, 1020.0);
                    SetPlayerCameraPos(playerid, 2005.0, 2283.3, 1012.5);
                    SetPlayerCameraLookAt(playerid, 2003.0, 2287.0, 1010.8);
                    Watching[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You are now watching the ambulance, use /watchoff to stop.");
                }
                else return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You are already watching the ambulance, use /watchoff to stop.");
            }
            else return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: Exit the ambulance before watching it.");
        }
        return 1;
    }
   
    if(strcmp("/watchoff", cmdtext, true) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
            if(Watching[playerid] == 1)
            {
                SetPlayerPos(playerid, Pos[playerid][0], Pos[playerid][1], Pos[playerid][2]);
                SetPlayerInterior(playerid, Interior[playerid]);
                SetCameraBehindPlayer(playerid);
                SetPlayerFacingAngle(playerid, Float:Angle[playerid]);
                TogglePlayerControllable(playerid, 1);
                Watching[playerid] = 0;
            }
            else return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You are not watching the ambulance.");
        }
        return 1;
    }
   
    if(strcmp("/ambuhelp", cmdtext, true) == 0)
    {
        SendClientMessage(playerid, 0xDDDD2357, "To enter the Ambulance Interior enter an ambulance (VehicleID: 416) as passenger.");
        SendClientMessage(playerid, 0xDDDD2357, "You can lay on the stretcher using /stretcher and /stopanimation to get up.");
        SendClientMessage(playerid, 0xDDDD2357, "To exit the ambulance press the ENTER key.");
        SendClientMessage(playerid, 0xDDDD2357, "Or login as RCON Admin and use /gotoambu to enter and /exitambu to exit.");
        SendClientMessage(playerid, 0xDDDD2357, "You can also watch the ambulance as RCON Admin using /watchambu and /watchoff to stop.");
        return 1;
    }
   
    if(strcmp("/stretcher", cmdtext, true) == 0)
    {
        if(InAmbu[playerid] > 0 || Goto[playerid] == 1)
        {
            SetPlayerPos(playerid, 2003.2, 2286.5, 1011.9);
            SetPlayerFacingAngle(playerid, 163);
            ClearAnimations(playerid);
            ApplyAnimation(playerid, "BEACH", "Lay_Bac_Loop", 4.0, 1, 0, 0, 0, 0);
        }
        return 1;
    }
   
    if(strcmp("/stopanimation", cmdtext, true) == 0)
    {
        if(InAmbu[playerid] > 0 || Goto[playerid] == 1)
        {
            ClearAnimations(playerid);
        }
        return 1;
    }
    return 0;
}
Reply
#2

Help?
Reply
#3

like this try
pawn Код:
First on top of script
#inculde <zcmd>

then
CMD:gotoambu(playerid, params[])
 {
        if(IsPlayerAdmin(playerid))
        {
            if(Goto[playerid] == 0 && InAmbu[playerid] == 0)
            {
                if(Watching[playerid] == 0)
                {
                    GetPlayerPos(playerid, Pos[playerid][0], Pos[playerid][1], Pos[playerid][2]);
                    GetPlayerFacingAngle(playerid, Float:Angle[playerid]);
                    SetPlayerPos(playerid, 2003.3, 2284.2, 1011.1);
                    SetPlayerFacingAngle(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                    Interior[playerid] = GetPlayerInterior(playerid);
                    SetPlayerInterior(playerid, 1);
                    Goto[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You have teleported to the ambulance, use /exitambu to exit.");
                }
                else return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You are watching the ambulance, use /watchoff to stop.");
            }
            else return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You are already in the ambulance.");
        }
        return 1;
    }
pawn Код:
CMD:exitambu(playerid, params[])
    {
        if(IsPlayerAdmin(playerid))
        {
            if(Goto[playerid] == 1)
            {
                if(Watching[playerid] == 0)
                {
                    SetPlayerPos(playerid, Pos[playerid][0], Pos[playerid][1], Pos[playerid][2]);
                    SetCameraBehindPlayer(playerid);
                    SetPlayerFacingAngle(playerid, Float:Angle[playerid]);
                    SetPlayerInterior(playerid, Interior[playerid]);
                    Goto[playerid] = 0;
                }
                else return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You are watching the ambulance, use /watchoff to stop.");
            }
        }
        return 1;
    }
pawn Код:
CMD:watchambu(playerid, params[])
    {
        if(IsPlayerAdmin(playerid))
        {
            if(InAmbu[playerid] == 0 && Goto[playerid] == 0)
            {
                if(Watching[playerid] == 0)
                {
                    TogglePlayerControllable(playerid, 0);
                    GetPlayerPos(playerid, Pos[playerid][0], Pos[playerid][1], Pos[playerid][2]);
                    GetPlayerFacingAngle(playerid, Float:Angle[playerid]);
                    Interior[playerid] = GetPlayerInterior(playerid);
                    SetPlayerInterior(playerid, 1);
                    SetPlayerPos(playerid, 2005.0, 2283.7, 1020.0);
                    SetPlayerCameraPos(playerid, 2005.0, 2283.3, 1012.5);
                    SetPlayerCameraLookAt(playerid, 2003.0, 2287.0, 1010.8);
                    Watching[playerid] = 1;
                    SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You are now watching the ambulance, use /watchoff to stop.");
                }
                else return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You are already watching the ambulance, use /watchoff to stop.");
            }
            else return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: Exit the ambulance before watching it.");
        }
        return 1;
    }
pawn Код:
CMD:watchoff(playerid, params[])
    {
        if(IsPlayerAdmin(playerid))
        {
            if(Watching[playerid] == 1)
            {
                SetPlayerPos(playerid, Pos[playerid][0], Pos[playerid][1], Pos[playerid][2]);
                SetPlayerInterior(playerid, Interior[playerid]);
                SetCameraBehindPlayer(playerid);
                SetPlayerFacingAngle(playerid, Float:Angle[playerid]);
                TogglePlayerControllable(playerid, 1);
                Watching[playerid] = 0;
            }
            else return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: You are not watching the ambulance.");
        }
        return 1;
    }
pawn Код:
CMD:ambuhelp(playerid, params[])
    {
        SendClientMessage(playerid, 0xDDDD2357, "To enter the Ambulance Interior enter an ambulance (VehicleID: 416) as passenger.");
        SendClientMessage(playerid, 0xDDDD2357, "You can lay on the stretcher using /stretcher and /stopanimation to get up.");
        SendClientMessage(playerid, 0xDDDD2357, "To exit the ambulance press the ENTER key.");
        SendClientMessage(playerid, 0xDDDD2357, "Or login as RCON Admin and use /gotoambu to enter and /exitambu to exit.");
        SendClientMessage(playerid, 0xDDDD2357, "You can also watch the ambulance as RCON Admin using /watchambu and /watchoff to stop.");
        return 1;
    }
pawn Код:
CMD:stretcher(playerid, params[])
    {
        if(InAmbu[playerid] > 0 || Goto[playerid] == 1)
        {
            SetPlayerPos(playerid, 2003.2, 2286.5, 1011.9);
            SetPlayerFacingAngle(playerid, 163);
            ClearAnimations(playerid);
            ApplyAnimation(playerid, "BEACH", "Lay_Bac_Loop", 4.0, 1, 0, 0, 0, 0);
        }
        return 1;
    }
pawn Код:
CMD:stopanimation(playerid, params[])    
    {
        if(InAmbu[playerid] > 0 || Goto[playerid] == 1)
        {
            ClearAnimations(playerid);
        }
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)