Why this script doesnt work ? -
bustern - 28.08.2013
PHP код:
CMD:gopen(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1587.4438, -1637.8878, 15.0000)){
MoveObject(lspdgate, 1579.0056, -1638.1981, 15.0000, 3, 0, 0, 0.0);
return 1;
}
return 0;
}
CMD:gclose(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1587.4438, -1637.8878, 15.0000)){
MoveObject(lspdgate, 1587.4438, -1637.8878, 15.0000, 3, 0, 0, 0.0);
return 1;
}
return 0;
}
When i go ingame and type
/gopen /gclose server says:Unknown command
I have included ZCMD !!!
Re: Why this script doesnt work ? -
CrazyChoco - 28.08.2013
Because you are returning false. Instead of return 0; do return 1;
It shall be like this:
pawn Код:
CMD:gopen(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1587.4438, -1637.8878, 15.0000))
{
MoveObject(lspdgate, 1579.0056, -1638.1981, 15.0000, 3, 0, 0, 0.0);
}
return 1;
}
CMD:gclose(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1587.4438, -1637.8878, 15.0000))
{
MoveObject(lspdgate, 1587.4438, -1637.8878, 15.0000, 3, 0, 0, 0.0);
}
return 1;
}
Re: Why this script doesnt work ? -
Konstantinos - 28.08.2013
You're simply not in a range so it returns 0 "SERVER: Unknown command".
Re: Why this script doesnt work ? -
bustern - 28.08.2013
Thx you
Re: Why this script doesnt work ? -
Kutter - 28.08.2013
PHP код:
CMD:gopen(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1587.4438, -1637.8878, 15.0000)){
MoveObject(lspdgate, 1579.0056, -1638.1981, 15.0000, 3, 0, 0, 0.0);
return 1;
else{ SendClientMessage(playerid,-1,"You need to be around a gate"); return 1; }
}
return 0;
}
CMD:gclose(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 10, 1587.4438, -1637.8878, 15.0000)){
MoveObject(lspdgate, 1587.4438, -1637.8878, 15.0000, 3, 0, 0, 0.0);
else{ SendClientMessage(playerid,-1,"You need to be around a gate"); return 1; }
return 1;
}
return 0;
}
I suggest you to use a variable like 'gOpen', and write a condition like 'if(gOpen == true) { ...'
Re: Why this script doesnt work ? -
CrazyChoco - 28.08.2013
Yeah I actually see that I also forgot to do like if he wasn't in range, it would post a client message in my reply.