Ich habe ein Skript geschrieben mit dem man Waffen auswählen kann, so ähnlich wie bei Half-Life! Bin noch nicht ganz fertig damit aber ich poste es trotzdem hier mal!
Hier ist es:
//Verschiedene Variablen
var migibtsscho_01 = 0;
var migibtsscho_02 = 0;
var selected_01 = 0;
var selected_02 = 0;
//Diese action dem Player zuweisen und eventuell noch modifizieren!
action player_client
{
MY.FAT = OFF;
MY.NARROW = ON; // set narrow hull
MY._WALKFRAMES = 1; // enable frame name animation
MY._FORCE = 0.5; // He should be not too fast
MY._MOVEMODE = _MODE_WALKING;
MY._BANKING = -0.1;
MY.__JUMP = ON;
MY.__DUCK = ON;
MY.__STRAFE = ON;
MY.__BOB = ON;
MY.__TRIGGER = ON;
MY.ENABLE_DISCONNECT = ON;
MY.EVENT = _actor_connect;
player_move();
if (MY.shadow == OFF) { drop_shadow(); }
while (1) {
if (key_1 == 1) { // Wenn Taste 1 gedrückt...
selected_01 = 1;
selected_02 = 0;
if (migibtsscho_01 == 0) { // Wenn ich noch nicht existiere...
create(<staff.mdl>, NULLVECTOR, waffe_01); // Erstelle mich und weise mir die Funktion waffe_01 zu..
migibtsscho_01 = 1; // Ich bin da!
}
}
if (key_2 == 1) {
selected_01 = 0;
selected_02 = 1;
if (migibtsscho_02 == 0) { // Wenn ich noch nicht existiere...
create(<sword.mdl>, NULLVECTOR, waffe_02); // Erstelle mich und weise mir die Funktion waffe_02 zu..
migibtsscho_02 = 1; // Ich bin da!
}
}
WAIT 1;
}
}
function waffe_01
{
if (you.shadow == on) { my.shadow = on; }
while(1)
{
if (selected_01 == 1) { // Wenn ich gerade ausgewählt bin...
MY.INVISIBLE = OFF; // ..bin ich nicht unsichtbar..
MY.PASSABLE = ON;
vec_set(my.x,you.x);
vec_set(my.pan,you.pan);
my.frame = you.frame;
my.next_frame = you.next_frame;
}
else {
MY.INVISIBLE = ON; // sonst bin ich unsichtbar...
MY.PASSABLE = ON;
MY.SHADOW = OFF;
}
wait(1);
}
}
function waffe_02
{
if (you.shadow == on) { my.shadow = on; }
while(1)
{
if (you == player && person_3rd == 0) {
my.invisible = off;
} else {
my.invisible = off;
}
if (selected_02 == 1) {
MY.INVISIBLE = OFF;
MY.PASSABLE = ON;
vec_set(my.x,you.x);
vec_set(my.pan,you.pan);
my.frame = you.frame;
my.next_frame = you.next_frame;
}
else {
MY.INVISIBLE = ON;
MY.PASSABLE = ON;
MY.SHADOW = OFF;
}
wait(1);
}
}