[HELP] /gate
#1

So, I've almost got this blasted dynamic gate system working, but there's an issue.

PHP код:
command(gateplayeridparams[])
{
    new 
string[128];
    for(new 
0MAX_GATESi++)
    {
        if(
IsPlayerInRangeOfPoint(playeridGates[i][GateRange], Gates[i][GateX], Gates[i][GateY], Gates[i][GateZ]))
        {
            print(
"0");
            if(
Gates[i][UseF] >= 1) return 1;
            print(
"1");
            
            if(
Gates[i][GateStatus] == 0)
            {
                print(
"2");
                
MoveDynamicObject(Gates[i][GateID], Gates[i][GateXM], Gates[i][GateYM], Gates[i][GateZM], Gates[i][GateSpeed], Gates[i][GateRXM], Gates[i][GateRYM], Gates[i][GateRZM]);
                
Gates[i][GateStatus] = 1;
                
                
format(stringsizeof(string), "%s uses their remote to open the gates."GetName(playerid));
                
SetPlayerChatBubble(playeridstringPURPLE15.05000);
            }
            else if(
Gates[i][GateStatus] == 1)
            {
                print(
"3");
                
MoveDynamicObject(Gates[i][GateID], Gates[i][GateX], Gates[i][GateY], Gates[i][GateZ], Gates[i][GateSpeed], Gates[i][GateRX], Gates[i][GateRY], Gates[i][GateRZ]);
                 
Gates[i][GateStatus] = 0;
                
                
format(stringsizeof(string), "%s uses their remote to close the gates."GetName(playerid));
                
SetPlayerChatBubble(playeridstringPURPLE15.05000);
            }
            else
            {
                return 
1;
            }
        }
    }
    return 
1;

The gate will not move, however every print will show up for some odd reason. I'm not exactly sure why that is, but I will REP+++++ you if you can figure this out. Thanks!
Reply


Messages In This Thread
[HELP] /gate - by BornHuman - 15.01.2016, 19:34
Re: [HELP] /gate - by d1git - 15.01.2016, 19:53
Re: [HELP] /gate - by BornHuman - 15.01.2016, 19:55
Re: [HELP] /gate - by Sk1lleD - 15.01.2016, 20:14

Forum Jump:


Users browsing this thread: 2 Guest(s)