trying to make /og 9884 command to open gate wont work what i doing wrong -
wes231 - 02.10.2011
trying to make /og 9884 command to open gate wont work what i doing wrong
Код:
#include <a_samp>
new Gates[1];
new GateState;
public OnFilterScriptInit()
{
Gates[0] = CreateObject(989, 261.86, -1231.52, 74.60, 1.00, -2.00, 322.00);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/gate", cmdtext, true, 10) == 0)
{
if(strcmp("9884", cmdtext, true, 10) == 0)
{
if(GateState == 0)
{
MoveObject(Gates[0], 261.69,-1231.49, 70.53, 10);
GateState = 1;
}
else if (GateState == 1)
{
MoveObject(Gates[0], 261.86, -1231.52, 74.60, 10);
GateState = 0;
}
}
return 1;
}
return 0;
}
im trying to run it as a filterscript the gate comes up but command wont work ? help fix it please
Re: trying to make /og 9884 command to open gate wont work what i doing wrong -
Hal - 02.10.2011
You have to define 9884 as the parameters for the command.
Re: trying to make /og 9884 command to open gate wont work what i doing wrong -
wes231 - 02.10.2011
can you fix it?
Re: trying to make /og 9884 command to open gate wont work what i doing wrong -
wes231 - 02.10.2011
Quote:
#include <a_samp>
new Gates[1];
new GateState;
public OnFilterScriptInit()
{
Gates[0] = CreateObject(989, 261.86, -1231.52, 74.60, 1.00, -2.00, 322.00);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
if(strcmp("/opengate 9884", cmdtext, true, 10) == 0)
{
if(GateState == 0)
{
MoveObject(Gates[0], 261.69,-1231.49, 70.53, 10);
GateState = 1;
}
else if (GateState == 1)
{
MoveObject(Gates[0], 261.86, -1231.52, 74.60, 10);
GateState = 0;
}
}
return 1;
}
return 0;
}
|
like that?
Re: trying to make /og 9884 command to open gate wont work what i doing wrong -
TyThaBomb - 02.10.2011
Код:
#include <a_samp>
new Gates[1];
new GateState;
public OnFilterScriptInit()
{
Gates[0] = CreateObject(989, 261.86, -1231.52, 74.60, 1.00, -2.00, 322.00);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/gate", cmdtext, true, 10) == 0)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 10, 261.86, -1231.52, 74.60))
{
if(GateState == 0)
{
MoveObject(Gates[0], 261.69,-1231.49, 70.53, 10);
GateState = 1;
}
else if (GateState == 1)
{
MoveObject(Gates[0], 261.86, -1231.52, 74.60, 10);
GateState = 0;
}
}
return 1;
}
return 0;
}
Give that a whirl and let me know what happens.
Re: trying to make /og 9884 command to open gate wont work what i doing wrong -
wes231 - 02.10.2011
didnt work
Re: trying to make /og 9884 command to open gate wont work what i doing wrong -
TyThaBomb - 02.10.2011
Quote:
Originally Posted by wes231
didnt work
|
Just edited. Try now.
Re: trying to make /og 9884 command to open gate wont work what i doing wrong -
grand.Theft.Otto - 02.10.2011
Do you use or know how to use DCMD / ZCMD ?
I can make it for you easily, I barely use strcmp because it sucks and I'm not too familiar with it anymore lol.
Re: trying to make /og 9884 command to open gate wont work what i doing wrong -
wes231 - 02.10.2011
thanks bro it worked
Re: trying to make /og 9884 command to open gate wont work what i doing wrong -
TyThaBomb - 02.10.2011
Quote:
Originally Posted by wes231
thanks bro it worked
|
Yeah no problem. Don't forget to add to my rep please!