Jump to content

Anyone still scripts for 0.5?


lil Toady

Recommended Posts

Here's a list of functions it currently provides:

EVENTS:

onStart ( )

onConnect ( )

onAdminChat ( string text )

onAdminMessage ( string text )

onPlayerJoin ( int playerID )

onPlayerPart ( int playerID, int reason )

-- Reasons: 1 - kicked, 2 - time out, else - quit ( not accurate, find out urself, i was lazy )

onPlayerChat ( int playerID, string text )

onPlayerKilled ( int playerID, int killerID, int weaponID )

onPlayerHealthChange ( int playerID, float newHealth, float OldHealth )

onPlayerPositionChange ( int playerID, float X, float Y, float Z )

onVehicleEnter ( int playerID, int vehicleID, bool passenger )

onVehicleQuit ( int playerID, int vehicleID )

onVehicleHealthChange ( int vehicleID, float health )

FUNCTIONS:

void sendChat ( text )

void sendMessage ( playerID, text )

string getServerName ( )

string getServerMOTD ( )

int getServerGame ( )

int getServerGameMode ( ) //that's for gta3

int getServerMaxPlayers ( )

string getPlayerName ( int playerID )

float getPlayerHealth ( int playerID )

int getPlayerKills ( int playerID )

int getPlayerDeaths ( int playerID )

int getPlayerMoney ( int playerID ) //that's for race

int getPlayerVehicle ( int playerID )

float, float, float getPlayerPosition ( int playerID )

void slapPlayer ( id )

string getVehicleName ( int vehicleID )

float getVehicleHealth ( int vehicleID )

float, float, float getVehiclePosition ( int vehicleID )

float, float, float getVehicleSpawnpoint ( int vehicleID )

int getVehicleDriver ( int vehicleID )

bool getVehicleIsPassenger ( int vehicleID, int playerID )

string getWeaponName ( weaponID )

I'd say it's pretty powerfull and fast ;) And you can build some nice anti-cheat thing with this ^

Link to comment

k, here's some kind of a beta version of the program: http://mta-stats.com/downloads/mtala.rar

if you have some problems tell me. It has some list of scripting functions inside.

some simple scripts look like that:

addEventHandler ( "onPlayerJoin", "onPlayerJoin" ) 
function onPlayerJoin ( id ) 
  sendMessage ( id, "welcom to my server, "..getPlayerName ( id ) ) 
end 
  
addEventHandler ( "onPlayerChat, "onCommand" ) 
function onCommand ( id, text ) 
  local tokens = string.split ( text ) 
  if ( tokens[1] == "!info" ) then 
    sendChat ( "Admin Panel by lil_Toady" ) 
  end 
end 
  

ah ye, a bit messy with connecting atm, via command string it is:

MTA Admin.exe <ip> <port> <name> <password> 

like this:

MTA Admin.exe 127.0.0.1 4003 Admin 12345 

it's defaulted to that ^

My TODO list:

finally add banPlayer(), kickPlayer(), banIP() (yeh im lazy :( )

sql support

file writing/reading

getVehicleColor()

gettok()

accepting function request if somebody is even gonna use this

might do a version for race if someone needs it

and if somebody knows c++ and wants to do a gui version, im fine with sharing the sources

Link to comment
  • Recently Browsing   0 members

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