Jump to content

Taxi Driver


MTA-Fan

Recommended Posts

Is anyone able to make me a taxi script?`

A person wants to be a taxi driver. He writes me a e-Mail.

I put his nickname and Password in a seperate ini.

He connects to server and types for example /msg taxilogin in the Client. Now he is registered as a taxi driver.

If any Player types in !calltaxi all taxi drivers get a message: needs a taxi at

That's it I hope it is possible to make this script :!::!:

thanks herrhund

Link to comment

sorry, cudnt be arsed to upload :D

Commands:

Admin: !new - to see new registered ppl

!allow - registers that name as a taxi driver

Player: !taxi - Shows Taxi Drivers Pm'd

Shows current drivers Name and Location of person


alias mta.command {
if ($mta.name($1,$2) == %admin) {
 if ($3 == !allow) {
  if ($4 != $null) {
   if ($readini(Taxi.ini, Taxi, $4) == $null) {
    if ($readini(Taxi.ini, Reg, $4) != $null) {
    writeini "Taxi.ini" Taxi $4 1
    mta.say $1 Taxi Driver $4 Authorised.
    }
    else {
    mta.msg $1 $2 Registration >> Invalid Registration Name.
    }
   }
   else {
   mta.msg $1 $2 Registration >> Already Authorised.
   }
  }
  else {
  mta.msg $1 $2 Registration >> No name given.
  }
 }
 elseif ($3 == !new) {
 mta.say $1 New Registrants: $readini(Taxi.ini, New, New)
 }
} 
if ($3 == !taxi) {
set %caller $mta.name($1,$2)
set %area $mta.area($1,$2)
mta.taxicall $1-
mta.taxidrivers $1-
mta.msg $1 $2 Taxi Drivers Notified >> %shout
}
}

alias mta.pm {
if ($3 == reg) {
 if ($4 != $null) {
  if ($readini(Taxi.ini, Reg, $mta.name($1,$2)) == $null) {
  writeini "Taxi.ini" Reg $mta.name($1,$2) $4
  mta.msg $1 $2 Registered >> Taxi Driver >> Name: $mta.name($1,$2) - Password: $4
  .timer 1 1 mta.msg $1 $2 To login >> /msg login 
  writeini "Taxi.ini" New New $readini(Taxi.ini, New, New) $mta.name($1,$2) $+ ,
  }
  else {
   if (%member [ $+ [ $2 ] ] == on) {
   writeini "Taxi.ini" Reg $mta.name($1,$2) $4
   mta.msg $1 $2 Password Changed >> Taxi Driver >> Name: $mta.name($1,$2) - Password: $4
   } 
   else {
   mta.msg $1 $2 Password Change >> Denied! (Not logged In)
   }
  }
 }
 else {
 mta.msg $1 $2 Registration >> Error, /msg reg 
 }
}
elseif ($3 == login) {
 if (%member [ $+ [ $2 ] ] != on) {
  if ($readini(Taxi.ini, Taxi, $mta.name($1,$2)) == 1) {
   if ($readini(Taxi.ini, Reg, $mta.name($1,$2)) == $4) {
   .timerkick off
   set %member [ $+ [ $2 ] ] on
   mta.say $1 Taxi Driver >> $mta.name($1,$2) Clocked in!
   }
   else {
   mta.msg $1 $2 Login >> Denied (Incorrect Password)
   }
  }
  else {
  mta.msg $1 $2 Registration >> Unconfirmed by %admin
  }
 }
 else {
 mta.msg $1 $2 Login >> Already Logged in.
 }
}
}

alias mta.join {
mta.msg $1 $2 Server is Runnin Taxi Driver!
.timer 1 1 mta.msg $1 $2 /msg reg  to register...

set %member [ $+ [ $2 ] ] off
if ($mta.name($1,$2) == %admin) {
.timer 1 1 set %member [ $+ [ $2 ] ] on
mta.say $1 Taxi Driver (Admin) >> $mta.name($1,$2) Clocked in!
}
elseif ($readini(Taxi.ini, Taxi, $mta.name($1,$2)) == 1) {
mta.msg $1 $2 Taxi Driver >> 30 secs to login.
.timerkick 1 30 mta.kick $1 $2
}
}

alias mta.part {
set %member [ $+ [ $2 ] ] off
}


alias mta.taxidrivers {

 set %shout $null
 set %playerid 0 
 while ( $mta.maxplayers($1) > %playerid ) { 
   if (%member [ $+ [ %playerid ] ] == on) && ($mta.name($1, %playerid) !isin %shout) && ($mta.name($1,$2) != Unknown) {
   set %shout %shout $mta.name($1, %playerid) $+ ,
   }
   %playerid = %playerid + 1 
 } 
 unset %playerid 
}


alias mta.taxicall {

 set %playerid 0 
 while ( $mta.maxplayers($1) > %playerid ) { 
   if (%member [ $+ [ %playerid ] ] == on) {
   mta.msg $1 %playerid Taxicall >> Name: %caller - Area: %area
   }
   %playerid = %playerid + 1 
 } 
 unset %playerid 
}


alias menu {
 if ($dialog(menu)) !dialog -v menu
 else !dialog -md menu menu
}

dialog menu {

 title Taxi Driver - Admin Name
 size -1 -1 180 49
 option dbu
 edit "Admin name", 1, 66 20 55 15
 text "Add ur MTA nick here, and click OK.", 2, 65 2 63 15
 button "OK", 3, 140 19 38 12
 button "Cancel", 4, 140 36 38 12

}

on *:DIALOG:menu:sclick:*:{
if ($did == 4) {
!dialog -x menu menu
} 
if ($did == 3) {
!dialog -ma menu2 menu2
set %admin $did(menu2, 1)
} 
}

on *:DIALOG:menu2:sclick:*:{
if ($did == 2) {
!dialog -x menu2 menu2
!dialog -x menu menu
} 
}

dialog menu2 {
 title Taxi Driver...
 size -1 -1 105 56
 option dbu
 text "Set Admin name!", 1, 7 4 87 20
 button "OK", 2, 14 32 80 21
}

on *:LOAD:menu

Edited by Guest
Link to comment

It's quite long for what it should do. Are you alleready using a script where you want to add it into, or do you want this script to run seperately? I think it can be at least cut into half of the current length. But if it's working...

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...