DCMD Problem
#1

if i will type /hgate the gate automatically open/close even i put the wrong or none password it keeps Gate moving im tired fixing this shit -.-

pawn Код:
dcmd_movegate(playerid, params[])
{
    for(new h=1; h<MAX_GATES; h++)
    {
        if(GateInfo[h][gModel] && IsPlayerInRangeOfPoint(playerid, 8, GateInfo[h][gCX], GateInfo[h][gCY], GateInfo[h][gCZ]))
        {
            if(strlen(GateInfo[h][gPassword]))
            {
                new gatepw[3219];
                if (sscanf(params, "s", gatepw)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /hgate [password]");
                if(strcmp(params, GateInfo[h][gPassword])) return SendClientMessage(playerid, COLOR_GREY, "Invalid gate password.");
                if(!GateInfo[h][gStatus])
                {
                    GateInfo[h][gStatus] = 1;
                    MoveDynamicObject(GateInfo[h][gGate], GateInfo[h][gOX], GateInfo[h][gOY], GateInfo[h][gOZ], GateInfo[h][gSpeed]);
                    SetDynamicObjectRot(GateInfo[h][gGate], GateInfo[h][gORX], GateInfo[h][gORY], GateInfo[h][gORZ]);
                }
                else
                {
                    GateInfo[h][gStatus] = 0;
                    MoveDynamicObject(GateInfo[h][gGate], GateInfo[h][gCX], GateInfo[h][gCY], GateInfo[h][gCZ], GateInfo[h][gSpeed]);
                    SetDynamicObjectRot(GateInfo[h][gGate], GateInfo[h][gCRX], GateInfo[h][gCRY], GateInfo[h][gCRZ]);
                }
            }
            else
            {
                if(!GateInfo[h][gStatus])
                {
                    GateInfo[h][gStatus] = 1;
                    MoveDynamicObject(GateInfo[h][gGate], GateInfo[h][gOX], GateInfo[h][gOY], GateInfo[h][gOZ], GateInfo[h][gSpeed]);
                    SetDynamicObjectRot(GateInfo[h][gGate], GateInfo[h][gORX], GateInfo[h][gORY], GateInfo[h][gORZ]);
                }
                else
                {
                    GateInfo[h][gStatus] = 0;
                    MoveDynamicObject(GateInfo[h][gGate], GateInfo[h][gCX], GateInfo[h][gCY], GateInfo[h][gCZ], GateInfo[h][gSpeed]);
                    SetDynamicObjectRot(GateInfo[h][gGate], GateInfo[h][gCRX], GateInfo[h][gCRY], GateInfo[h][gCRZ]);
                }
            }
            h = MAX_GATES;
            return 1;
        }
    }
    return 1;
}
Reply


Messages In This Thread
DCMD Problem - by ToiletDuck - 07.07.2012, 10:42
Re: DCMD Problem - by ToiletDuck - 07.07.2012, 11:02
Re: DCMD Problem - by ToiletDuck - 08.07.2012, 04:43
Re: DCMD Problem - by .FuneraL. - 08.07.2012, 04:47

Forum Jump:


Users browsing this thread: 2 Guest(s)