Gate Problem!!! -
coolmark1995 - 04.01.2013
I am trying to make a gate that auto opens with rcon the gate model I am using is 10841 but I am not sure how to script this the coords I have are
X:2890.6000976563
Y:-1963.5
Z:16.5
Rotation is z:270
is there any way someone could help me ive looked at all the tutorials but I dont understand them.
someone gave me this and implemented it but gate appears sideways and command dosent work in a filterscript help please
Код:
new
g_gate,
g_gateTog;
public OnGameModeInit()
{
g_gate = CreateObject(10841, 2890.60, -1963.5, 17.2, 0.0, 0.0, 270.0);
SetTimer("gateCheck", 1000, 1);
return 1;
}
forward gateCheck();
public gateCheck()
{
new p_count;
for(new i; i<MAX_PLAYERS; i++) {
if(IsPlayerAdmin(i)) {
if(IsPlayerInRangeOfPoint(i, 5.0, 2890.60, -1963.5, 17.2)) {
p_count++;
break;
}
}
}
if(p_count) {
g_gateTog = 1;
MoveObject(g_gate, 2890.60, -1963.5, 17.2-5.0, 1.0, 0.0, 0.0, 0.0);
}
else {
g_gateTog = 0;
MoveObject(g_gate, 2890.60, -1963.5, 17.2, 1.0, 0.0, 0.0, 0.0);
}
return 1;
}
Re: Gate Problem!!! -
InActtive™ - 04.01.2013
Change this:
Код:
if(p_count) {
g_gateTog = 1;
MoveObject(g_gate, 2890.60, -1963.5, 17.2-5.0, 1.0, 0.0, 0.0, 0.0);
}
To this:
Код:
if(p_count) {
g_gateTog = 1;
MoveObject(g_gate, 2890.60, -1963.5, 17.2, -5.0 , 0.0, 0.0, 0.0);
}
There was a little flaw in your coords. It should be fixed now. If not, let me know n' post the compile results.
Re: Gate Problem!!! -
coolmark1995 - 04.01.2013
Quote:
Originally Posted by InActtive™
Change this:
Код:
if(p_count) {
g_gateTog = 1;
MoveObject(g_gate, 2890.60, -1963.5, 17.2-5.0, 1.0, 0.0, 0.0, 0.0);
}
To this:
Код:
if(p_count) {
g_gateTog = 1;
MoveObject(g_gate, 2890.60, -1963.5, 17.2, -5.0 , 0.0, 0.0, 0.0);
}
There was a little flaw in your coords. It should be fixed now. If not, let me know n' post the compile results.
|
C:\Users\GamerzAss\Desktop\Flat Files Roleplay (OLD)\filterscripts\gate.pwn(27) : warning 217: loose indentation
C:\Users\GamerzAss\Desktop\Flat Files Roleplay (OLD)\filterscripts\gate.pwn(32) : warning 217: loose indentation
C:\Users\GamerzAss\Desktop\Flat Files Roleplay (OLD)\filterscripts\gate.pwn(36) : warning 217: loose indentation
C:\Users\GamerzAss\Desktop\Flat Files Roleplay (OLD)\filterscripts\gate.pwn(33) : warning 204: symbol is assigned a value that is never used: "g_gateTog"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Warnings.
Gate is also still sideways
Re: Gate Problem!!! -
gtakillerIV - 04.01.2013
pawn Код:
C:\Users\GamerzAss\Desktop\Flat Files Roleplay (OLD)\filterscripts\gate.pwn(27) : warning 217: loose indentation
C:\Users\GamerzAss\Desktop\Flat Files Roleplay (OLD)\filterscripts\gate.pwn(32) : warning 217: loose indentation
C:\Users\GamerzAss\Desktop\Flat Files Roleplay (OLD)\filterscripts\gate.pwn(36) : warning 217: loose indentation
Use this
Tutorial.
Re: Gate Problem!!! -
coolmark1995 - 05.01.2013
Quote:
Originally Posted by gtakillerIV
pawn Код:
C:\Users\GamerzAss\Desktop\Flat Files Roleplay (OLD)\filterscripts\gate.pwn(27) : warning 217: loose indentation C:\Users\GamerzAss\Desktop\Flat Files Roleplay (OLD)\filterscripts\gate.pwn(32) : warning 217: loose indentation C:\Users\GamerzAss\Desktop\Flat Files Roleplay (OLD)\filterscripts\gate.pwn(36) : warning 217: loose indentation
Use this Tutorial.
|
I read this and it dosent help i still get same problem with gate being sideways and not moving
Re: Gate Problem!!! -
SchurmanCQC - 05.01.2013
If the gate is sideways, then change the rotation! don't be lazy and make us code everything for you.
Re: Gate Problem!!! -
hydravink - 05.01.2013
If I'm not wrong, indentation errors happen because you are writing something like this:
pawn Код:
new x;
if(x)
{
return b+a;
}
When it should look like this....
pawn Код:
new x;
if(x)
{
return a+b;
}
Make your brakets under your brakets and leave 1 TAB after the bracket.. my suggestion
Re: Gate Problem!!! -
coolmark1995 - 05.01.2013
Quote:
Originally Posted by Schurman
If the gate is sideways, then change the rotation! don't be lazy and make us code everything for you.
|
dude in mta map editor the rotation is in the right direction but in samp it appears sideways
Re: Gate Problem!!! -
coolmark1995 - 05.01.2013
Quote:
Originally Posted by hydravink
If I'm not wrong, indentation errors happen because you are writing something like this:
pawn Код:
new x;
if(x) { return b+a; }
When it should look like this....
pawn Код:
new x;
if(x) { return a+b; }
Make your brakets under your brakets and leave 1 TAB after the bracket.. my suggestion
|
still get
Код:
C:\Users\GamerzAss\Desktop\Flat Files Roleplay (OLD)\filterscripts\gate.pwn(42) : warning 204: symbol is assigned a value that is never used: "g_gateTog"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
Re: Gate Problem!!! -
coolmark1995 - 05.01.2013
Quote:
Originally Posted by InActtive™
Change this:
Код:
if(p_count) {
g_gateTog = 1;
MoveObject(g_gate, 2890.60, -1963.5, 17.2-5.0, 1.0, 0.0, 0.0, 0.0);
}
To this:
Код:
if(p_count) {
g_gateTog = 1;
MoveObject(g_gate, 2890.60, -1963.5, 17.2, -5.0 , 0.0, 0.0, 0.0);
}
There was a little flaw in your coords. It should be fixed now. If not, let me know n' post the compile results.
|
ok so your coords work but when I use open command the gate opens and turns side ways im using new command script