Moving gate problem
#1

i tried to make moving gate, but this gate all the time stay on same place

Код:
// kapije
new pdkapija;
new pktimer[MAX_PLAYERS];
Код:
pdkapija = CreateDynamicObject(968, 1544.6999511719, -1630.8000488281, 13.199999809265, 0, 90, 90); //object(barrierturn) (1)
Код:
CMD:pdo(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] < 1)return SendClientMessage(playerid, COLOR_WHITE, ""#COL_RED"| "COL_LIGHTBLUE"WS:DM "#COL_RED"| "#COL_WHITE" Samo  Admini i V.I.P igraci");
	else if(PlayerInfo[playerid][VIP] == 1)return SendClientMessage(playerid, COLOR_WHITE, ""#COL_RED"| "COL_LIGHTBLUE"WS:DM "#COL_RED"| "#COL_WHITE" Samo  Admini i V.I.P igraci");
	{
		MoveObject(pdkapija, 1544.6999511719, -1630.8000488281, 13.14999961853, 5, 0, 0, 90);
		pktimer[playerid] = SetTimer("pdzatvori", 5000, 0);
		SendClientMessage(playerid, COLOR_WHITE, "("#COL_ORANGE"Paznja!) Otvorio si (IME KAPIJE) kapiju, "#COL_ORANGE"automatski ce se zatvorit!");
	}
	return 1;
}
Код:
forward pdzatvori(); //Defines our 'gateclose' timer when a player types /open, and what we want the gate to do
public pdzatvori()
{
    MoveObject(pdkapija, 1544.6999511719, -1630.8000488281, 13, 5); // 
    
}
Reply
#2

It's because you returned the second 'if' statement and also opened brackets from it.
pawn Код:
CMD:pdo(playerid, params[])
{
    if (PlayerInfo[playerid][pAdmin] < 1)return SendClientMessage(playerid, COLOR_WHITE, ""#COL_RED"| "COL_LIGHTBLUE"WS:DM "#COL_RED"| "#COL_WHITE" Samo  Admini i V.I.P igraci");
    else if(PlayerInfo[playerid][VIP] == 1)return SendClientMessage(playerid, COLOR_WHITE, ""#COL_RED"| "COL_LIGHTBLUE"WS:DM "#COL_RED"| "#COL_WHITE" Samo  Admini i V.I.P igraci");
    MoveObject(pdkapija, 1544.6999511719, -1630.8000488281, 13.14999961853, 5, 0, 0, 90);
    pktimer[playerid] = SetTimer("pdzatvori", 5000, 0);
    SendClientMessage(playerid, COLOR_WHITE, "("#COL_ORANGE"Paznja!) Otvorio si (IME KAPIJE) kapiju, "#COL_ORANGE"automatski ce se zatvorit!");
    return 1;
}
Would be better if you've translated to english which makes me sense on those messages too.
Reply
#3

but it still doesnt move my gate, i dont know why, i make everything right

it gave me:
Код:
    SendClientMessage(playerid, COLOR_WHITE, "("#COL_ORANGE"Paznja!) Otvorio si (IME KAPIJE) kapiju, "#COL_ORANGE"automatski ce se zatvorit!");
but it doesnt move :/
Reply
#4

Just like in the other topic, use MoveDynamicObject instead of MoveObject, or replace CreateDynamicObject with CreateObject. CreateObject creates a static object, CreateDynamicObject creates a dynamic object... MoveObject moves ONLY static objects. MoveDynamicObject moves ONLY dynamic objects... simple.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)