Changing gate texture and making it movable ?
#1

Hello guys, I am looking for help because I am trying to make gate which texture is changed, but its movable at the same time and it needs to be only for the group number I want, this is what the command which makes the gate move looks like:



Код:
new
	FDGates [2][2];

Код:
CMD:bay1(playerid, params[])
{
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 10.0, -2212.2202,-2279.4954,30.6250))
        {
            switch(FDGates[0][1])
            {
                case 0:
                {
                    MoveDynamicObject(FDGates[0][0], -2213.0356, -2280.7808, 38.2505, 1.0);
                    FDGates[0][1] = 1;
                    SendClientMessage(playerid, COLOR_RED, "Bay 1 is open.");
                    
                }
                case 1:
                {
                    MoveDynamicObject(FDGates[0][0],-2213.0356, -2280.7808, 32.4608, 1.0);
                    FDGates[0][1] = 0;
                    SendClientMessage(playerid, COLOR_GREEN, "Bay 1 is closed.");

				}   
            }
        }
    }
    return 1;
}
This is the other lines which is under public OnGameModeInit, without this the gates won't move:

Код:
FDGates[0][0] = CreateDynamicObject(11319, -2213.0356, -2280.7808, 32.4650,   0.0000, 0.0000, 51.2074, 0, 0, _, 200.0);
	FDGates[1][0] = CreateDynamicObject(11319, -2206.2378, -2286.2102, 32.4650,   0.0000, 0.0000, 51.2074, 0, 0, _, 200.0);
This is how I changed the texture for the gates :

Код:
new Gate1[MAX_PLAYERS];
new Gate2[MAX_PLAYERS];

public OnPlayerSpawn(playerid) {
    Gate1[playerid] = CreatePlayerObject(playerid, 11319, -2213.0356, -2280.7808, 32.4650,   0.0000, 0.0000, 51.2074);
	SetPlayerObjectMaterial(playerid, Gate1[playerid], 0, 11008, "firehouse_sfse", "ws_rollerdoor_fire", 0);

	Gate2[playerid] = CreatePlayerObject(playerid, 11319, -2206.2378, -2286.2102, 32.4650,   0.0000, 0.0000, 51.2074);
	SetPlayerObjectMaterial(playerid, Gate2[playerid], 0, 11008, "firehouse_sfse", "ws_rollerdoor_fire", 0);

Now, how could I make it in a way that the gate has the texture changed and its moving too, because I can't let it this way because then there are 2 gates on top of each other.
Reply
#2

No one can help me?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)