Why wont this Gate show up in my Gamemode? -
rangerxxll - 27.10.2011
This is my code right now.
pawn Код:
new Gate, bool:GateClose;
pawn Код:
Gate = CreateObject(971, 1588.699951, 1638.099976, 13.8, 0.0, 0.0, 0.0, 100.0);
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/gate", true)){
if(GateClose){
if(IsPlayerInRangeOfPoint(playerid, 0, 1588.699951, 1638.099976, 13.8)){
GateClose = false;
MoveObject(Gate, 1596.199951, 1638.099976, 13.8, 3.0);
SetObjectRot(Gate, 0.0, 0.0, 0.0);
return SendClientMessage(playerid, 0x00C600FF, "Gate opened");
}
}
else{
if(IsPlayerInRangeOfPoint(playerid, 0, 1588.699951, 1638.099976, 13.8)){
GateClose = true;
MoveObject(Gate, 1588.699951, 1638.099976, 13.8, 3.0);
SetObjectRot(Gate, 0.0, 0.0, 0.0);
return SendClientMessage(playerid, 0x00DC00FF, "Gate closed");
}
}
}
return 0;
}
I got no idea why it's not showing up. Also, when I do /gate it says the command doesn't exist. I have the gamemode in my Server.cfg correctly
Код:
gamemode0 grandlarc 1
Anyone know what I'm doing wrong?
Re: Why wont this Gate show up in my Gamemode? -
serman - 27.10.2011
show us Includes
Re: Why wont this Gate show up in my Gamemode? -
rangerxxll - 27.10.2011
pawn Код:
#include <a_samp>
#include <core>
#include <float>
#include "../include/gl_common.inc"
#include "../include/gl_spawns.inc"
Re: Why wont this Gate show up in my Gamemode? -
spd_sahil - 27.10.2011
try this.. not sure if it will work.. in my automatic gates.. the variable for gateclose is not a boolean.. maybe change that.. and ur doing an if(gateclose) for a value which is not defined before.. maybe it wont enter the loop at all...
and secondly.. is this code in u r gamemode .. ?? or is it a filterscript..
note that if this is a gamemode.. then ur object defination should be in OnGameModeInit()
Re: Why wont this Gate show up in my Gamemode? -
|_ⒾⓇⓄN_ⒹⓄG_| - 27.10.2011
maybe this way
try the code
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/gate", true))
{
if(GateClose)
{
if(IsPlayerInRangeOfPoint(playerid, 0, 1588.699951, 1638.099976, 13.8))
{
GateClose = false;
MoveObject(Gate, 1596.199951, 1638.099976, 13.8, 3.0);
SetObjectRot(Gate, 0.0, 0.0, 0.0);
SendClientMessage(playerid, 0x00C600FF, "Gate opened");
return 1;
}
}
else
{
if(IsPlayerInRangeOfPoint(playerid, 0, 1588.699951, 1638.099976, 13.8))
{
GateClose = true;
MoveObject(Gate, 1588.699951, 1638.099976, 13.8, 3.0);
SetObjectRot(Gate, 0.0, 0.0, 0.0);
SendClientMessage(playerid, 0x00DC00FF, "Gate closed");
return 1;
}
}
return 1;
}
return 0;
}
the code looks weird when i paste lol