15.07.2010, 09:25
Hi there, i want to know how to open and close a gate using the same command. At the moment im using /open and /close to activate the gate. Could someone please help? Thanks.
new
bool:gObjVar; // Global boolean variable.
if(!strcmp(cmdtext, "/gate", true))
{
if(gObjVar == false)
{
/* Open. */
MoveObject(...);
gObjVar = true;
}
else // It's true.
{
/* Close. */
MoveObject(...);
gObjVar = false;
}
return true;
}
Basically here, https://sampforum.blast.hk/showthread.php?tid=159604
|