Hello,
this is my first mta script, and i wanna share it with you
Its like the Dodo script in GTA3
U can see who's flying it and if it is at spawn.
on *:SIGNAL:mta.disconnect: {
!unset %heli1. [ $+ [ $1 ] ]
!unset %heli2. [ $+ [ $1 ] ]
!unset %heli3. [ $+ [ $1 ] ]
!unset %heli4. [ $+ [ $1 ] ]
}
on *:SIGNAL:mta.enter: {
if ($mta.vehicle($1,$2).name == Hunter) {
mta.say $1 $+(',$mta.name($1,$2),') has got the Hunter!
%heli1. [ $+ [ $1 ] ] = $2
}
if ($mta.vehicle($1,$2).name == Maverick) {
mta.say $1 $+(',$mta.name($1,$2),') has got the Maverick!
%heli2. [ $+ [ $1 ] ] = $2
}
if ($mta.vehicle($1,$2).name == Police Maverick) {
mta.say $1 $+(',$mta.name($1,$2),') has got the Police Maverick!
%heli3. [ $+ [ $1 ] ] = $2
}
if ($mta.vehicle($1,$2).name == Sparrow) {
mta.say $1 $+(',$mta.name($1,$2),') has got the Sparrow!
%heli4. [ $+ [ $1 ] ] = $2
}
}
on *:SIGNAL:mta.part: {
if ($2 == %heli1. [ $+ [ $1 ] ]) {
mta.say $1 Hunter is available at spawn.
!unset %heli1. [ $+ [ $1 ] ]
}
if ($2 == %heli2. [ $+ [ $1 ] ]) {
mta.say $1 Maverick is available at spawn.
!unset %heli2. [ $+ [ $1 ] ]
}
if ($2 == %heli3. [ $+ [ $1 ] ]) {
mta.say $1 Police Maverick is available at spawn.
!unset %heli3. [ $+ [ $1 ] ]
}
if ($2 == %heli4. [ $+ [ $1 ] ]) {
mta.say $1 Sparrow is available at spawn.
!unset %heli4. [ $+ [ $1 ] ]
}
}
on *:SIGNAL:mta.exit: {
if ($2 == %heli1. [ $+ [ $1 ] ]) {
mta.say $1 Hunter is available at $+(',$mta.area($1,$2),'.)
!unset %heli1. [ $+ [ $1 ] ]
}
if ($2 == %heli2. [ $+ [ $1 ] ]) {
mta.say $1 Maverick is available at $+(',$mta.area($1,$2),'.)
!unset %heli2. [ $+ [ $1 ] ]
}
if ($2 == %heli3. [ $+ [ $1 ] ]) {
mta.say $1 Police Maverick is available at $+(',$mta.area($1,$2),'.)
!unset %heli3. [ $+ [ $1 ] ]
}
if ($2 == %heli4. [ $+ [ $1 ] ]) {
mta.say $1 Sparrow is available at $+(',$mta.area($1,$2),'.)
!unset %heli4. [ $+ [ $1 ] ]
}
}
on *:SIGNAL:mta.kill: {
if ($2 == %heli1. [ $+ [ $1 ] ]) {
mta.say $1 Hunter is available at spawn.
!unset %heli1. [ $+ [ $1 ] ]
}
if ($2 == %heli2. [ $+ [ $1 ] ]) {
mta.say $1 Maverick is available at spawn.
!unset %heli2. [ $+ [ $1 ] ]
}
if ($2 == %heli3. [ $+ [ $1 ] ]) {
mta.say $1 Police Maverick is available at spawn.
!unset %heli3. [ $+ [ $1 ] ]
}
if ($2 == %heli4. [ $+ [ $1 ] ]) {
mta.say $1 Sparrow is available at spawn.
!unset %heli4. [ $+ [ $1 ] ]
}
}
on *:SIGNAL:mta.command: {
if ($3 == !heli) {
mta.say $1 Hunter: $iif(%heli1. [ $+ [ $1 ] ] != $null,$mta.name($1,$ifmatch),Free!) $+ , Maverick: $iif(%heli2. [ $+ [ $1 ] ] != $null,$mta.name($1,$ifmatch),Free!) $+ , Police Maverick: $iif(%heli3. [ $+ [ $1 ] ] != $null,$mta.name($1,$ifmatch),Free!) Sparrow: $iif(%heli4. [ $+ [ $1 ] ] != $null,$mta.name($1,$ifmatch),Free!)
}
if ($3 == !info) { mta.say $1 Heli script by Mount! }
}
Good luck!
greetings,
Mount