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