Jump to content

Script doesn't run ?!


Recommended Posts

I've created a farm job gamemode and while i test it, when i joined the server and log into my account and press p, i doesn't found my game mode it says no-gamemode in admin panel and it won't run, take a look

meta.xml 

     "Farmer" type="gamemode" name="Farmjob" description="Farmstuff" /> 
     

guiwindow.lua 
    vehicles = { "combine harvester",  
    } 
    function setupvehicleSelection ( theResource ) 
spawnScreenMenu = guiCreateWindow ( 0.15, 0.33, 0.7, 0.34, "select a skin", true ) 
      spawnScreenOKButton = guiCreateButton ( 0.4, 0.85, 0.20, 0.15, "OK", true, spawnScreenMenu ) 
       guiWindowSetMovable ( spawnScreenMenu, false ) 
      guiWindowSetSizable ( spawnScreenMenu, false ) 
      spawnScreenGridList = guiCreateGridList ( 0, 0.1, 1, 0.9, true, spawnScreenMenu ) 
      guiGridListSetSelectionMode ( spawnScreenGridList, 1 ) 
       guiGridListAddColumn ( spawnScreenGridList, "vehicles", 0.3 ) 
       local row = guiGridListAddRow ( spawnScreenGridList ) 
       guiGridListSetItemText ( spawnScreenGridList, row, 1, vehicleName, false, false ) 
     end 
  

Farmjob.lua 
local myMarker = createMarker(-30.60000038147, 164.89999389648, 1.2000000476837, 'cylinder', 2.0, 255, 0, 0, 150) 
  
function MarkerHit( hitElement, matchingDimension ) -- define MarkerHit function for the handler 
    local elementType = getElementType( hitElement ) -- get the hit element's type 
    outputChatBox( elementType.."Welcome to farm job " read the info"", getRootElement(), 255, 255, 0 ) -- attach the element's type with the text, and output it 
end 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) -- attach onMarkerHit event to MarkerH 
  

Is there any problem upper the page ? i put the game mode into grand theft auto san andreas/server/mods/deathmatch/resources/[gamemodes]/[farmjob]/ "farmjob.zip" and [maps]/farmjobmap.zip please help me !!!

Link to comment

Type in the:

1. Console "refresh" or "upgrade"

2. Server/In-game "/refresh" or "/upgrade"

Farmjob.lua 
local myMarker = createMarker(-30.60000038147, 164.89999389648, 1.2000000476837, 'cylinder', 2.0, 255, 0, 0, 150) 
  
function MarkerHit( hitElement, matchingDimension ) -- define MarkerHit function for the handler 
    local elementType = getElementType( hitElement ) -- get the hit element's type 
    outputChatBox( elementType.."Welcome to farm job ", getRootElement(), 255, 255, 0 ) -- attach the element's type with the text, and output it 
end 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) -- attach onMarkerHit event to MarkerH 

guiwindow.lua 
    vehicles = { "combine harvester", 
    } 
function setupvehicleSelectionm() 
    spawnScreenMenu = guiCreateWindow ( 0.15, 0.33, 0.7, 0.34, "select a skin", true ) 
    spawnScreenOKButton = guiCreateButton ( 0.4, 0.85, 0.20, 0.15, "OK", true, spawnScreenMenu ) 
    guiWindowSetMovable ( spawnScreenMenu, false ) 
    guiWindowSetSizable ( spawnScreenMenu, false ) 
    spawnScreenGridList = guiCreateGridList ( 0, 0.1, 1, 0.9, true, spawnScreenMenu ) 
    guiGridListSetSelectionMode ( spawnScreenGridList, 1 ) 
    guiGridListAddColumn ( spawnScreenGridList, "vehicles", 0.3 ) 
    local row = guiGridListAddRow ( spawnScreenGridList ) 
    guiGridListSetItemText ( spawnScreenGridList, row, 1, vehicleName, false, false ) 
end 
addEventHandler("onClientResourceStart",resourceRoot,setupvehicleSelection) 

Edited by Guest
Link to comment
Type in the:

1. Console "refresh" or "upgrade"

2. Server/In-game "/refresh" or "/upgrade"

Does it matter?

ya, the server automatically adds resources to a log file and start the resources that defined in the mtaserver.config

if you add a resource while the server is loaded/started then it won't add the resource in the log file...

so this is why you have to type in "upgrade" or "refresh" into the server, so the server knows that there's a new resource.

Link to comment
     "Farmer" type="gamemode" name="Farmjob" description="Farmstuff" /> 
     

So ?

Hey kill yourself better -_-"

Thanks i've put it on but when i run MTA Server.exe

It says

Error: not processsing resource 'Farmjob' as it has duplicates on different paths:

Path #1: "resources\[gamemodes]\[farmjob]\farmjob"

Path #2: "resources\[gamemodes]\[farmjob]\[maps]\farmjob"

..

Link to comment

Hey i renamed the 2 files and it working no error but i can't find the map which i created...

What map? You didn't post any thing in this topic related to maps.

check /debugscript 3

It's working !!!!! thanks for help

"Farmer" type="gamemode" name="Farmjob" description="Farmstuff" /> 
    
  
    type="map" version="1.0.0">
    "Farmjob.map" dimension="0">
    
        "*spawnreset" value="onSpawn" 
                 friendlyname="Spawn Reset" 
                 accept="onSpawn,onServerEmpty,onServerStart" 
                 desc="When should a new spawnpoint be chosen?" 
        /> 
    
    
        "#minplayers" value="[ 0 ]">
        "#maxplayers" value="[ 128 ]">
        "#gravity" value="[ 0.008000 ]">
        "#weather" value="[ 0 ]">
        "#time" value="12:0">
        "#locked_time" value="[ false ]">
        "#waveheight" value="[ 0 ]">
        "#gamespeed" value="[ 1 ]">
    
     
    "farmjob.map" /> 
    

I put the map and the 2 script files in 1 meta and it's work right now but i need you please i want program this 2 files for the map just like 1 marker if you touch it, it show up a list and pick a skin of skins. but when i touch the marker doesn't do any thing i would be thankful if you help me here.

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