Jump to content

Script


Recommended Posts

Mera aj scripting meu pehla din hai, koi bata sakta hai ke Is script meu kya problem hai, ye script start ho jati hai, lekin ye script car ko spawn nahi karti.

server.lua

function createVehicleForPlayer(thePlayer, command, vehicleModel) 
end 
addCommandHandler ("cg", createVehicleForPlayer) 

meta.xml

      type="script" version="1.0.0">
       

Link to comment

script.lua

function createVehicleForPlayer(thePlayer, command, vehicleModel) 
    local x,y,z = getElementPosition(thePlayer) 
    x = x + 5  
    local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z) 
    if (createdVehicle == false) then 
        outputChatBox("Failed to create vehicle.",thePlayer) 
    end 
end 
addCommandHandler("cg", createVehicleForPlayer) 

meta.xml

     "Wiki" type="script" name="onplayerjoin" description="Spawn Vehicle" /> 
     

Test ke liye time nahi tha, lekin ye inshallah work kari ge. btw, wiki ko bhi consult kiya karo.

EDIT: Credit goes to wiki.

Edited by Guest
Link to comment

Credits? Wiki open source hain. Waha per koi specific author mention nahi huva hain khair.. Aur isne yeh toh nahi kaha ke meine khud banaya hain. Iss ne sirf copy paste kiya thake iss ki help kare pata nahi iss pe ladne ki konsi baat hain. :shock:

Edited by Guest
Link to comment
Credits? Wiki open source hain. Waha per koi specific author mention nahi huva hain khair.. Aur isne yeh toh nahi kaha ke meine khud banaya hain. Iss be sirf copy paste kiya thake iss ki help kare pata nahi iss pe ladne ki konsi baat hain. :shock:

Yehi meu in ko samjhane ki koshis kar raha tha.

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