1
1
//
2
2
3
3
function onScriptLoad () {
4
- RampObj <- array( 100 , null );
4
+ PublicRamps <- array( 100 , null );
5
+ PrivateRamps <- array( 100 , null );
5
6
}
6
7
7
8
function onPlayerGameKeysChange ( player, oldKey, newKey ) {
8
9
9
10
if ( newKey & KEY_ONFOOT_FIRE && player. VehicleSlot ==- 1 ) {
10
- if ( RampObj[player. ID ] ) {
11
- RampObj[player. ID ]. Delete ();
11
+ if ( PublicRamps[player. ID ] ) {
12
+ PublicRamps[player. ID ]. Delete ();
13
+ }
14
+ if ( PrivateRamps[player. ID ] ) {
15
+ PrivateRamps[player. ID ]. Delete ();
12
16
}
13
17
local v = player. Vehicle ;
14
18
local pos;
@@ -24,22 +28,31 @@ function onPlayerGameKeysChange( player, oldKey, newKey ) {
24
28
angle2 = Vector (0 , 0 , angle);
25
29
}
26
30
pos = GetForwardPoint ( pos, angle, 10.0 );
27
- local obj = CreateObject ( 562 , player. World , pos, 220 );
28
- obj. RotateToEuler (angle2, 0 );
29
- RampObj[player. ID ] = obj;
31
+ local publicRampObj = CreateObject ( 562 , player. World , pos, 150 );
32
+ local privateRampObj = CreateObject ( 562 , player. UniqueWorld , pos, 255 );
33
+ publicRampObj. RotateToEuler (angle2, 0 );
34
+ privateRampObj. RotateToEuler (angle2, 0 );
35
+ PublicRamps[player. ID ] = publicRampObj;
36
+ PrivateRamps[player. ID ] = privateRampObj;
30
37
}
31
38
32
39
if ( newKey & KEY_ONFOOT_AIM && player. VehicleSlot ==- 1 ) {
33
- if ( RampObj[player. ID ] ) {
34
- RampObj[player. ID ]. Delete ();
40
+ if ( PublicRamps[player. ID ] ) {
41
+ PublicRamps[player. ID ]. Delete ();
42
+ }
43
+ if ( PrivateRamps[player. ID ] ) {
44
+ PrivateRamps[player. ID ]. Delete ();
35
45
}
36
46
}
37
47
}
38
48
39
49
function onPlayerPart ( player, reason ) {
40
50
local id = player. ID ;
41
- if (RampObj[id]) {
42
- RampObj[id]. Delete ();
51
+ if (PublicRamps[id]) {
52
+ PublicRamps[id]. Delete ();
53
+ }
54
+ if ( PrivateRamps[id] ) {
55
+ PrivateRamps[id]. Delete ();
43
56
}
44
57
}
45
58
0 commit comments