Pokretna kapija
Tutorial nije moj, samo sam ga preveo jer mislim da ce pomoci mnogima :D
new Gate;//This will create your object/gate name <-- To pišemo na pocetku skripte
Gate = CreateObject(2587, X, Y, Z, Xr, Yr, Zr); <-- Definiramo kapiju
Citat2587 ---ID of the Object
2001.195679 ----X Position
1547.113892 ----Y Position
14.283400 ----Z Position
0.0, 0.0, 96.0 ---- X,Y,Z Rotations of the object
X,Y,Z POZICIJU MOZEMO PRONACI LAKO -
/save
Sada pravimo da se kapija mice.
Ovo pisemo iza OnPlayerCommandText:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/pgate", cmdtext, true, 10) == 0)
{
MoveObject(Gate,X, Y, Z+/-3,0.97);//This will move the gate
}
return 1;
}
if (strcmp("/pgateclose", cmdtext, true, 10) == 0)
{
MoveObject(Gate,X, Y, Z,3,0.97);//This will move the gate back to the old position
}
return 1;
}
return 1;
}
Vaše komande ce pomicati kapiju gore/dole !
To je bio jednostavni sistem pokretne kapije. Ako zelite sistem automatskog otvaranja -
public OnPlayerCommandText(...)
{
if (strcmp("/pgate", cmdtext, true, 10) == 0)
{
MoveObject(Gate,X, Y, Z+/-3,0.97);//This will move the gate
SendClientMessage(playerid,COLOR_BLUE,"You have opened the gate,it will be closed in 7 seconds!");//This will send an message announcing the gate Stats!
SetTimer("GateClose", 7000, 0);//This will start the counting till the gate will be closed!
}
return 1;
}
return 1;
}
forward GateClose(playerid)//This will forward the closing gate function
public GateClose(playerid)//This will define the closing gate function
{
MoveObject(Gate,X, Y, Z-/+3,0.97);//This will move the gate
PlayerPlaySound(playerid, 1153, x,y,z);// This will play the gate sound near the gate
return 1;
Odlicno, posluzit ce nekom. :)
Trebo si malo bolje objasniti ali dobro je :D :D
Mogao si malo bolje da objasnis ,vamo pise objasnjenje na engleskom da si to bar preveo bilo bi okej :)
dobro je :D
Odlicno :D