01.04.2011, 09:50
Introduction
Hi there :> This is my first English section release. It's very easy to work with this include. Basically you just need to add. and it's closed and you move and it opens and you move again it closes again. Have fun ^^
Functions
Credits
Miki - Include
Icognito - Streamer
Mommy - Me
SAMP Dev team - SA-MP
Downloads
http://pastebin.com/8Ayge1Lm
Hi there :> This is my first English section release. It's very easy to work with this include. Basically you just need to add. and it's closed and you move and it opens and you move again it closes again. Have fun ^^
Functions
PHP код:
forward AddNewGate(gateid, modelid, Float:oX, Float:oY, Float:oZ, Float:RoX, Float:RoY, Float:RoZ, Float:cX, Float:cY, Float:cZ, Float:Speed);
forward MoveGate(gateid);
Miki - Include
Icognito - Streamer
Mommy - Me
SAMP Dev team - SA-MP
Downloads
PHP код:
#include <a_samp>
#include <streamer>
#define MAX_GATES 10
#define GATE_DRAW_DISTANCE 200
#define GATE_INFO_X_OPENED 0
#define GATE_INFO_Y_OPENED 1
#define GATE_INFO_Z_OPENED 2
#define GATE_INFO_X_CLOSED 3
#define GATE_INFO_Y_CLOSED 4
#define GATE_INFO_Z_CLOSED 5
#define GATE_INFO_SPEED 6
forward AddNewGate(gateid, modelid, Float:oX, Float:oY, Float:oZ, Float:RoX, Float:RoY, Float:RoZ, Float:cX, Float:cY, Float:cZ, Float:Speed);
forward MoveGate(gateid);
new aGates[MAX_GATES];
new Float:aGateInfo[MAX_GATES][7];
new aGateCreate[MAX_GATES];
new aGateMoved[MAX_GATES];
public AddNewGate(gateid, modelid, Float:oX, Float:oY, Float:oZ, Float:RoX, Float:RoY, Float:RoZ, Float:cX, Float:cY, Float:cZ, Float:Speed)
{
new iLoop;
while(iLoop <= MAX_GATES)
{
if(aGates[iLoop] == 0)
{
aGates[iLoop] = true;
aGateInfo[iLoop][GATE_INFO_X_OPENED] = oX;
aGateInfo[iLoop][GATE_INFO_Y_OPENED] = oY;
aGateInfo[iLoop][GATE_INFO_Z_OPENED] = oZ;
aGateInfo[iLoop][GATE_INFO_X_CLOSED] = cX;
aGateInfo[iLoop][GATE_INFO_Y_CLOSED] = cY;
aGateInfo[iLoop][GATE_INFO_Z_CLOSED] = cZ;
aGateInfo[iLoop][GATE_INFO_SPEED] = Speed;
aGateCreate[iLoop] = CreateDynamicObject(modelid, oX, oY, oZ, RoX, RoY, RoZ, -1 , -1, -1, GATE_DRAW_DISTANCE );
printf(" --- Miki!Gates: You have sucessfully defined gate ID:%d. Now, It's ready to be moved", gateid);
break;
}
else iLoop++;
}
}
public MoveGate(gateid)
{
if(aGates[gateid])
{
if(!aGateMoved[gateid])
{
MoveDynamicObject(gateid, aGateInfo[gateid][GATE_INFO_X_CLOSED], aGateInfo[gateid][GATE_INFO_Y_CLOSED], aGateInfo[gateid][GATE_INFO_Z_CLOSED], aGateInfo[gateid][GATE_INFO_SPEED] );
aGateMoved[gateid] = true;
}
else
{
MoveDynamicObject(gateid, aGateInfo[gateid][GATE_INFO_X_OPENED], aGateInfo[gateid][GATE_INFO_Y_OPENED], aGateInfo[gateid][GATE_INFO_Z_OPENED], aGateInfo[gateid][GATE_INFO_SPEED] );
aGateMoved[gateid] = false;
}
}
else printf(" --- Miki!Gates: The Gate ID:%d isn't defined. If you want to move it, add it first!", gateid);
}