Jump to content

New here :)


rocky168

Recommended Posts

Posted

Hi guys i downloaded MTA:SA yesterday and enjoyed playing alot! I am trying to setup a server, i have experience coding in sa-mp, vc-mp, lu and little apps and websites (many languages) so all i need to know is where to start and a place where i can get a good gamemode to start. thank you ;)

Posted

ok, welcome to MTASA

and to start off, the play resource is started first, so that's a GameMode,

next is you start off from here: wiki.multitheftauto.com

Posted

Thanks guys :), found this on wiki :-

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) 
    -- check if the return value was ''false'' 
    if (createdVehicle == false) then 
        -- if so, output a message to the chatbox, but only to this player. 
        outputChatBox("Failed to create vehicle.",thePlayer) 
    end 
end 
addCommandHandler("createvehicle", createVehicleForPlayer) 

Don't it require the vehiclemodel in addCommandHandler since createvehicleforplayer function has it?

Posted

no, there's only 2 addCommandHandler vars, one is for the command name and the other is for the function name,

so what ever the player types in after the command name is a var meaning it's the vehicleModel.

Example:

addCommandHandler("hey",function(source,_,sentence) 
     outputChatBox(getPlayerName(source).." said Hey, "..sentence) 
end) 

/hey wats up MTA Community?

Jaysds1 said Hey, wats up MTA Community?

Posted
no, there's only 2 addCommandHandler vars, one is for the command name and the other is for the function name,

so what ever the player types in after the command name is a var meaning it's the vehicleModel.

Example:

addCommandHandler("hey",function(source,_,sentence) 
     outputChatBox(getPlayerName(source).." said Hey, "..sentence) 
end) 

/hey wats up MTA Community?

Jaysds1 said Hey, wats up MTA Community?

If the player didn't input the vehiclemodel then it will return

outputChatBox("Failed to create vehicle.",thePlayer)  

right?

Posted

Thanks for your help guys :), can you suggest me a good base mode to start for my gamemode I am not looking for the ones the servers are running like race, zombie, RPG. Thank you :)

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