Jump to content
  • 0

Hey Guys please read


James_max

Question

Hi,

Guys, I'm James. I'm new and beginner scripter in MTA. I want you all to know me because, i will need help in the next few hours .I have some problems, first, when i open mta server 1zmnt04.png i see this problem

and i don't know how to fix it i make a new folder named by my server and i make new 2text document first one named

meta.xml and script.lua and i put the scripts in and open the server but as i said before i have problem like in the picture please someone help me

Link to comment

20 answers to this question

Recommended Posts

  • 0

Finally i made it i started my server and i entered it correctly but now the problem is how to start a resource and by resource it means the Folder that contain the meta.xml file and script.lua?? or it means another thing, when i type start

myserver it say's [Resource could not be found] and when i try to start script.lua it say's the same thing.

Thanks...

Link to comment
  • 0
Finally i made it i started my server and i entered it correctly but now the problem is how to start a resource and by resource it means the Folder that contain the meta.xml file and script.lua?? or it means another thing, when i type start

myserver it say's [Resource could not be found] and when i try to start script.lua it say's the same thing.

Thanks...

start my_server

also, let me check your script, ok?

Link to comment
  • 0
function joinHandler() 
    local x = 1959.55 
    local y = -1714.46 
    local z = 10 
    spawnPlayer(source, x, y, z) 
    fadeCamera(source, true) 
    setCameraTarget(source, source) 
    outputChatBox("Welcome to My Server", source) 
end 
addEventHandler("onPlayerJoin", getRootElement(), joinHandler) 
  
function createVehicleForPlayer ( thePlayer, command, vehicleModel ) 
    local x, y, z = getElementPosition (thePlayer) 
    x = x + 5 
    if (createdVehicle == true) then 
    outputChatBox ("Sucsess to create Vehicle",thePlayer) 
    if (createdVehicle == false) then 
    outputChatBox("Failed to create vehicle.",thePlayer) 
  
    end 
end 
addCommandHandler ("vec" , createVehicleForPlayer) 
  
  

This's all my script.

Link to comment
  • 0
  • Discord Moderators

There's a number of errors in your script. Turning on debugscript 3 will let you know of these. You probably can't start your resource because of the syntax errors in your script.

function joinHandler() 
    local x = 1959.55 
    local y = -1714.46 
    local z = 10 
    spawnPlayer(source, x, y, z) 
    fadeCamera(source, true) 
    setCameraTarget(source, source) 
    outputChatBox("Welcome to My Server", source) 
end 
addEventHandler("onPlayerJoin", getRootElement(), joinHandler) 
  
function createVehicleForPlayer ( thePlayer, command, vehicleModel ) 
    local vehicleModel = tonumber (vehicleModel) or 402 
    local x, y, z = getElementPosition (thePlayer) 
    x = x + 5 
    local createdVehicle = createVehicle (vehicleModel, x, y, z) -- you need to create a vehicle before the if check 
    if (createdVehicle) then 
        outputChatBox ("Sucsess to create Vehicle",thePlayer) 
    else -- add indention and simply check if createdVehicle is anything, otherwise report failure. 
        outputChatBox("Failed to create vehicle.",thePlayer) 
    end 
end 
addCommandHandler ("vec" , createVehicleForPlayer) 

I suggest some debugging (debugscript 3 / console) and use a source code editor such as Notepad++.

Link to comment
  • 0
function createVehicleForPlayer(thePlayer, command, vehicleModel) 
    local x,y,z = getElementPosition(thePlayer) -- get the position of the player 
    x = x + 5 -- add 5 units to the x position 
    local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z) 
     
    if (createdVehicle == false) then 
  
        outputChatBox("Failed to create vehicle.",thePlayer) 
    end 
end 
addCommandHandler("createvehicle", createVehicleForPlayer 

i want to understand something in this script, what's the

local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z) 

24oc5zs.jpg

Link to comment
  • 0
  • Discord Moderators
i want to understand something in this script, what's the
local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z) 

You create the vehicle? createVehicle?

If you mean the tonumber part, it converts a string into a number. All the arguments returned from addCommandHandler are strings.

What is the name of the folder/directory which contains your script here?

Please show the file structure and their contents altogether.

Link to comment
  • 0

24oc5zs.jpg

If any one looks at picture good he will see [info Admin added 402 missing rights]

maybe this's the problem?

And How i can make my self admin in my server?

Sorry For asking alot but iam just starting.

What is the name of the folder/directory which contains your script here?

Please show the file structure and their contents altogether.

C:\Program Files\MTA San Andreas 1.1\server\mods\deathmatch\resources\my_server

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...