Jump to content

Role Play, Please


Lesir

Recommended Posts

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

The /do command:

  
function input_Console ( text ) --when a player types in the console 
    --split the command by spaces (ASCII 32) and get the first piece of text 
    local command = gettok ( text, 1, 32 ) 
    --if the first piece of text was "do", 
    if ( command == "do" ) then 
        --get the player's name 
        local playerName = getPlayerName ( source ) 
        -- get the action text by substracting the first three characters do") 
        local actionText = string.sub ( text, 3 ) 
        -- announce the me command into the chatbox 
        outputChatBox ( " *" .. actionText .. "* ((" .. getPlayerName( source ) .. "))", root, 255, 40, 80, true ) 
    end 
end 
addEventHandler ( "onConsole", getRootElement(), input_Console ) -- add an event handler for onConsole 
  

The /my command

The /my command: 
function input_Console ( text ) 
    local command = gettok (text, 1, 32 ) 
    if ( command == "my" ) then 
        local playerName = getPlayerName ( source ) 
        local actionText = string.sub ( text, 3 ) 
        outputChatBox ( " *" .. playerName .. "'s" .. actionText .. " ", root, 255, 40, 80, true ) 
    end 
end 
addEventHandler ( "onConsole", getRootElement(), input_Console ) 

The /ad command:

function input_Console ( text ) 
    --split the command by spaces (ASCII 32) and get the first piece of text 
    local command = gettok ( text, 1, 32 ) 
    --if the first piece of text was "do", 
    if ( command == "ad" ) then 
        --get the player's name 
        local playerName = getPlayerName ( source ) 
        -- get the action text by substracting the first three characters ("ad ") 
        local actionText = string.sub ( text, 3 ) 
        -- announce the ad command into the chatbox 
        outputChatBox ( " [AD]: "  .. actionText .. " ((" .. getPlayerName( source ) .. "))", root, 150, 40, 80, true ) 
    end 
end 
addEventHandler ( "onConsole", getRootElement(), input_Console ) -- add an event handler for onConsole 

*No rights reserved. Written by me.

Link to comment

no files like .SQL are needed.

default connection data will be:

host: 127.0.0.1

user: root

password:

and you need to create/import database (not sure what are you trying to install? mabakos MTA Paradise?) - you can do it with phpMyAdmin (on XAMPP server start www server also - and point your browser to http://localhost/ - there should be some link to phpMyAdmin (not sure about that, im not using xampp, seen it only once). not sure if you only need to create empty database, or maybe albo import something - this should be written in mta paradise manual/readme/whatever.

Link to comment

I did not understand.. sorry

Should make a tutorial on how to put the RP Paradise Makabe THX :D

[2010-10-21 05:09:36] Server stopped!

[2010-10-21 05:09:36] Stopping resources...................

[2010-10-21 05:09:36] Closing SQLite3 database

[2010-10-21 05:09:36] Closing SQLite3 database

TUTORIAL! TUTORIAL!

Link to comment

[2010-10-22 00:19:16] MODULE: Loaded "MySQL 5.0 database module" (0.41) by "Alberto Alonso "

[2010-10-22 00:19:16] MODULE: Loaded "SHA Module" (1.02) by "mabako"

[2010-10-22 00:19:16] Starting resources....

[2010-10-22 00:19:16] ERROR: Unable to start resource sql; Start up of resource cancelled by script

Help.. :cry:

Link to comment

Nagging someone by PM is bad thing.

Personally - when somebody is nagging me - I'm stopping giving any help to such person.

You have to setup MySQL server, and setup connection data somewhere (probably in sql resource meta.xml or some lua file) - don't make ME read the manual when YOU should do this...

Link to comment
@cyklopas, don't go offtopic, posting random scripts.

@Depot - mysql is actually something more than file. it's database server. i can help you more if you tell me if you are hosting the server on own, home machine, or on remote server hoster like serverFFS

Dear mister varez,

How about you RE-READ the main post 1000 times, and come back again, thinking and telling me what's OFF TOPIC and ON TOPIC, and the difference between them. Thank You.

Your sincerelly,

cyklopas.

Link to comment
  • 1 month later...

1.settings.xml

        -- MySQL Configuration --> 
        "@sql.username" value="login for database"/> 
        "@sql.password" value="password for database"/> 
        "@sql.database" value="databasename"/> 
        "@sql.hostname" value="localhost"/> 
        "@sql.port" value="3306"/> 
"@sql.socket" value="/var/run/mysql/mysql.sock"/> 
  
        -- Registration --> 
        "@players.allow_registration" value="1"/>-- Change to 0 to disable registration and show an error message --> 
        "@players.registration_error_message" value="Edit this to show the user a message when registration is disabled"/> 

2.mtaserver.conf

"mta_mysql.so"/> 
        "sha.so"/> 
        "ml_sockets.so"/> 

.so - for linux , .dll - for windows

you must too have got modules and change something in sql resource

Link to comment

[2010-12-05 17:42:01] ERROR: Couldn't find script glueS.lua for resource glue 
[2010-12-05 17:42:01] Loading of resource 'glue' failed 
[2010-12-05 17:42:01] Resources: 215 loaded, 0 failed 
[2010-12-05 17:42:01] Server password set to 'log2in' 
[2010-12-05 17:42:01] Querying game-monitor.com master server... success! 
[2010-12-05 17:42:01] MODULE: Unable to find modules/ml_sockets.dll (/home/maxrate/mtasa/mods/deathmatch/modules/ml_sockets.dll: invalid ELF header)! 
[2010-12-05 17:42:01] MODULE: Loaded "MySQL 5.0 database module" (0.41) by "Alberto Alonso <[email protected]>" 
[2010-12-05 17:42:01] MODULE: Loaded "SHA Module" (1.02) by "mabako" 
[2010-12-05 17:42:01] MODULE: Loaded "Sockets Module" (0.10) by "Gamesnert, mabako, MCvarial & x86" 
[2010-12-05 17:42:01] Starting resources.... 
[2010-12-05 17:42:01] ERROR: Unable to start resource sql; Start up of resource cancelled by script 

[2010-12-05 17:42:01] ERROR: Unable to start resource irc; Start up of resource cancelled by script

and change something in sql resource

What !?

I have all ok with settings.xml and mtaserver.conf.

I have problems with sql resc. always :(

Link to comment

pls help !

It is last think what i want from u.

I find it from 7 days.

What i must do with SQL rescource ?

  
local function connect( ) 
    -- retrieve the settings 
    local server = get( "server" ) or "localhost" 
    local user = get( "user" ) or "root" 
    local password = get( "password" ) or "" 
    local db = get( "database" ) or "mta" 
    local port = get( "port" ) or 3306 
    local socket = get( "socket" ) or nil 

I must change it ?

Link to comment
pls help !

It is last think what i want from u.

I find it from 7 days.

What i must do with SQL rescource ?

  
local function connect( ) 
    -- retrieve the settings 
    local server = get( "server" ) or "localhost" 
    local user = get( "user" ) or "root" 
    local password = get( "password" ) or "" 
    local db = get( "database" ) or "mta" 
    local port = get( "port" ) or 3306 
    local socket = get( "socket" ) or nil 

I must change it ?

Yes you must.

localhost - dont change

root - database user

password - database password

mta - database name

port - dont change

same as in settings.xml

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...