Moveable Gates
#3

I mean that i dont need put Coordinates to gates would be in that place what i want but do it with mouse, like Liberty City RP.

PHP код:
    if(strcmp(cmd"/editgate"true) == 0)
    {
        if(
PlayerInfo[playerid][pAdmin] >= 1339)
        {
            new 
gateidFloat:ofloat;
            
tmp strtok(cmdtextidx); // x_job, gateid, ofloat
            
if(!strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, gate");
                return 
1;
            }
            if(
strcmp(tmp"hid"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                
ofloat floatstr(tmp);
                new 
value floatround(ofloatfloatround_round);
                if(
value MAX_HOUSES) return SendClientMessage(playeridCOLOR_WHITE"* Invalid House ID!");
                
GateInfo[gateid][gHID] = value;
                
format(stringsizeof(string), "Gate HID assigned to %d"GateInfo[gateid][gHID]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"model"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
value floatround(ofloatfloatround_round);
                if(
value == 0)
                {
                    
GateInfo[gateid][gPosX] = 0.0;
                    
GateInfo[gateid][gPosY] = 0.0;
                    
GateInfo[gateid][gPosZ] = 0.0;
                    
GateInfo[gateid][gRotX] = 0.0;
                    
GateInfo[gateid][gRotY] = 0.0;
                    
GateInfo[gateid][gRotZ] = 0.0;
                    
GateInfo[gateid][gPosXM] = 0.0;
                    
GateInfo[gateid][gPosYM] = 0.0;
                    
GateInfo[gateid][gPosZM] = 0.0;
                    
GateInfo[gateid][gRotXM] = 0.0;
                    
GateInfo[gateid][gRotYM] = 0.0;
                    
GateInfo[gateid][gRotZM] = 0.0;
                }
                
GateInfo[gateid][gModel] = value;
                
format(stringsizeof(string), "Gate Model assigned to %d"GateInfo[gateid][gModel]);
                
CreateGate(gateid);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"range"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
value floatround(ofloatfloatround_round);
                
GateInfo[gateid][gRange] = value;
                
format(stringsizeof(string), "Gate Range assigned to %d"GateInfo[gateid][gRange]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"speed"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
value floatround(ofloatfloatround_round);
                
GateInfo[gateid][gSpeed] = value;
                
format(stringsizeof(string), "Gate Speed assigned to %d"GateInfo[gateid][gSpeed]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"posx"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
Float:value ofloat;
                
GateInfo[gateid][gPosX] = value;
                
format(stringsizeof(string), "Gate PosX assigned to %f"GateInfo[gateid][gPosX]);
                
SetDynamicObjectPos(GateInfo[gateid][gID], GateInfo[gateid][gPosX], GateInfo[gateid][gPosY], GateInfo[gateid][gPosZ]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"posy"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
Float:value ofloat;
                
GateInfo[gateid][gPosY] = value;
                
format(stringsizeof(string), "Gate PosY assigned to %f"GateInfo[gateid][gPosY]);
                
SetDynamicObjectPos(GateInfo[gateid][gID], GateInfo[gateid][gPosX], GateInfo[gateid][gPosY], GateInfo[gateid][gPosZ]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"posz"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
Float:value ofloat;
                
GateInfo[gateid][gPosZ] = value+1.7;
                
format(stringsizeof(string), "Gate PosZ assigned to %f"GateInfo[gateid][gPosZ]);
                
SetDynamicObjectPos(GateInfo[gateid][gID], GateInfo[gateid][gPosX], GateInfo[gateid][gPosY], GateInfo[gateid][gPosZ]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"posxm"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
Float:value ofloat;
                
GateInfo[gateid][gPosXM] = value;
                
format(stringsizeof(string), "Gate PosXM assigned to %f"GateInfo[gateid][gPosXM]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
CreateGate(gateid);
                
SaveGates();
            }
            else if(
strcmp(tmp"posym"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
Float:value ofloat;
                
GateInfo[gateid][gPosYM] = value;
                
format(stringsizeof(string), "Gate PosYM assigned to %f"GateInfo[gateid][gPosYM]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
CreateGate(gateid);
                
SaveGates();
            }
            else if(
strcmp(tmp"poszm"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
Float:value ofloat;
                
GateInfo[gateid][gPosZM] = value;
                
format(stringsizeof(string), "Gate PosZM assigned to %f"GateInfo[gateid][gPosZM]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
CreateGate(gateid);
                
SaveGates();
            }
            else if(
strcmp(tmp"rotx"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
Float:value ofloat;
                
GateInfo[gateid][gRotX] = value;
                
format(stringsizeof(string), "Gate RotX assigned to %f"GateInfo[gateid][gRotX]);
                
SetDynamicObjectRot(GateInfo[gateid][gID], GateInfo[gateid][gRotX],GateInfo[gateid][gRotY],GateInfo[gateid][gRotZ]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"roty"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
Float:value ofloat;
                
GateInfo[gateid][gRotY] = value;
                
format(stringsizeof(string), "Gate RotY assigned to %f"GateInfo[gateid][gRotY]);
                
SetDynamicObjectRot(GateInfo[gateid][gID], GateInfo[gateid][gRotX],GateInfo[gateid][gRotY],GateInfo[gateid][gRotZ]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"rotz"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
Float:value ofloat;
                
GateInfo[gateid][gRotZ] = value;
                
format(stringsizeof(string), "Gate RotZ assigned to %f"GateInfo[gateid][gRotZ]);
                
SetDynamicObjectRot(GateInfo[gateid][gID], GateInfo[gateid][gRotX],GateInfo[gateid][gRotY],GateInfo[gateid][gRotZ]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"rotxm"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
Float:value ofloat;
                
GateInfo[gateid][gRotXM] = value;
                
format(stringsizeof(string), "Gate RotXM assigned to %f"GateInfo[gateid][gRotXM]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"rotym"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
Float:value ofloat;
                
GateInfo[gateid][gRotYM] = value;
                
format(stringsizeof(string), "Gate RotYM assigned to %f"GateInfo[gateid][gRotYM]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"rotzm"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
ofloat floatstr(tmp);
                new 
Float:value ofloat;
                
GateInfo[gateid][gRotZM] = value;
                
format(stringsizeof(string), "Gate RotZM assigned to %f"GateInfo[gateid][gRotZM]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
SaveGates();
            }
            else if(
strcmp(tmp"tome"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate tome [gateid]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
GetPlayerPos(playerid,GateInfo[gateid][gPosX],GateInfo[gateid][gPosY], GateInfo[gateid][gPosZ]);
                
GateInfo[gateid][gPosZ] += 1.7;
                
format(stringsizeof(string), "Gate Pos moved to %f %f %f"GateInfo[gateid][gPosX], GateInfo[gateid][gPosY], GateInfo[gateid][gPosZ]+1.7);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                if(
GateInfo[gateid][gModel] == 0)
                {
                    
GateInfo[gateid][gModel] = 980;
                    
GateInfo[gateid][gRange] = 10;
                    
GateInfo[gateid][gSpeed] = 5;
                }
                
//if(IsValidDynamicObject(GateInfo[gateid][gID])) DestroyDynamicObject(GateInfo[gateid][gID]);
                
CreateGate(gateid);
                
SaveGates();
            }
            else if(
strcmp(tmp"tomem"true) == 0)
            {
                
tmp strtok(cmdtextidx);
                
gateid strvalEx(tmp);
                if(
gateid || gateid >= MAX_GATES)
                {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate tomem [gateid]]");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, VW, Int, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                    
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, status, gate, renderhq");
                    return 
1;
                }
                
GetPlayerPos(playerid,GateInfo[gateid][gPosXM],GateInfo[gateid][gPosYM], GateInfo[gateid][gPosZM]);
                
format(stringsizeof(string), "Gate PosM moved to %f %f %f"GateInfo[gateid][gPosXM], GateInfo[gateid][gPosYM], GateInfo[gateid][gPosZM]);
                
SendClientMessage(playeridCOLOR_WHITEstring);
                
CreateGate(gateid);
                
SaveGates();
            }
            else
            {
                
SendClientMessage(playeridCOLOR_WHITE"USAGE: /editgate [name] [gateid] [value]");
                
SendClientMessage(playeridCOLOR_GREY"Available names: HID, Model, PosX(M), PosY(M), PosZ(M), RotX(M), RotZ(M)");
                
SendClientMessage(playeridCOLOR_GREY"Available names: tome(m), range, speed, gate");
                return 
1;
            }
        }
        else
        {
      
SendClientMessage(playeridCOLOR_GRAD2"You are not authorized to use that command!");
            return 
1;
        }
        return 
1;
    } 
This is the real /editgate command, sorry. Want to make it easier to place gates editing them with mouse.
Reply


Messages In This Thread
Moveable Gates - by FaZeRs - 10.02.2013, 16:51
Re: Moveable Gates - by batonsa - 10.02.2013, 16:53
Re: Moveable Gates - by FaZeRs - 10.02.2013, 16:56
Re: Moveable Gates - by batonsa - 10.02.2013, 17:47
Re: Moveable Gates - by FaZeRs - 10.02.2013, 18:37

Forum Jump:


Users browsing this thread: 2 Guest(s)