Can anyone help me with this
#5

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(movegate,8,cmdtext);
    return 1;
}

dcmd_movegate(playerid,params[])
{
    for(new idx=1; idx<MAX_GATES; idx++)
    {
        if(GateInfo[idx][gModel] && IsPlayerInRangeOfPoint(playerid, 8, GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ]))
        {
            if(strlen(GateInfo[idx][gPassword]))
            {
                if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /movegate [password]");
                if(strcmp(params, GateInfo[idx][gPassword])) return SendClientMessage(playerid, COLOR_GREY, "Invalid gate password.");
                if(!GateInfo[idx][gStatus])
                {
                    GateInfo[idx][gStatus] = 1;
                    MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ], GateInfo[idx][gSpeed]);
                    SetDynamicObjectRot(GateInfo[idx][gGate], GateInfo[idx][gORX], GateInfo[idx][gORY], GateInfo[idx][gORZ]);
                }
                else
                {
                    GateInfo[idx][gStatus] = 0;
                    MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], GateInfo[idx][gSpeed]);
                    SetDynamicObjectRot(GateInfo[idx][gGate], GateInfo[idx][gCRX], GateInfo[idx][gCRY], GateInfo[idx][gCRZ]);
                }
            }
            else
            {
                if(!GateInfo[idx][gStatus])
                {
                    GateInfo[idx][gStatus] = 1;
                    MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gOX], GateInfo[idx][gOY], GateInfo[idx][gOZ], GateInfo[idx][gSpeed]);
                    SetDynamicObjectRot(GateInfo[idx][gGate], GateInfo[idx][gORX], GateInfo[idx][gORY], GateInfo[idx][gORZ]);
                }
                else
                {
                    GateInfo[idx][gStatus] = 0;
                    MoveDynamicObject(GateInfo[idx][gGate], GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], GateInfo[idx][gSpeed]);
                    SetDynamicObjectRot(GateInfo[idx][gGate], GateInfo[idx][gCRX], GateInfo[idx][gCRY], GateInfo[idx][gCRZ]);
                }
            }
            idx = MAX_GATES;
            return 1;
        }
    }
    else SendClientMessage(playerid, COLOR_GREY, "You aren't near in any Gate.");
    return 1;
}
Not exactly sure how DCMD works, but this should be capable of a conversion.
Post any errors you get.
Also he need to define DCMD!
Reply


Messages In This Thread
Can anyone help me with this - by ToiletDuck - 11.07.2012, 10:22
Re: Can anyone help me with this - by RedJohn - 11.07.2012, 10:26
Re: Can anyone help me with this - by ToiletDuck - 11.07.2012, 10:26
Re: Can anyone help me with this - by clarencecuzz - 11.07.2012, 10:27
Re: Can anyone help me with this - by RedJohn - 11.07.2012, 10:37
Re: Can anyone help me with this - by clarencecuzz - 11.07.2012, 10:52
Re: Can anyone help me with this - by ToiletDuck - 11.07.2012, 11:04
Re: Can anyone help me with this - by ToiletDuck - 11.07.2012, 11:14

Forum Jump:


Users browsing this thread: 1 Guest(s)