Jump to content

[HELP] Saving into File.txt


Recommended Posts

Hello Community, i do have a script which when someone spawn the vehicle it shows up on The debug, This is the code : 

function spawner ( sourceplayer, commandname, carN) 
if not isPedInVehicle ( sourceplayer )then   
local x, y, z = getElementPosition ( sourceplayer )
local rx , ry, rz = getElementRotation ( sourceplayer )
local location = getZoneName ( x, y, z )
 local car = createVehicle ( 434, x, y, z, rx, ry, rz)
setElementData( sourceplayer, "housing", car )
 warpPedIntoVehicle ( sourceplayer, car )
setElementAlpha(car, 180) 
 setVehiclePlateText( car, 'housing' )
 setVehicleHandling(car , "maxVelocity", 40) 
        setVehicleLocked ( car, true )
        setVehicleDamageProof(car, true)
        local vehicleName = getVehicleName (car) 
        triggerClientEvent ( sourceplayer, "show", sourceplayer)
-- outputChatBox ( "Your vehicle is being destroyed in few Seconds due to the Abuse", sourceplayer, 255, 255, 0 )
outputDebugString ( "Housing Admin: [" ..getPlayerName(sourceplayer).."] Has Spawned "..vehicleName.." At {" ..location.."}.")
setTimer ( function()
 destroyElement (car)

 end, 25000, 1 ) 

 outputDebugString ( "Housing Admin: [" ..getPlayerName(sourceplayer).."] Has Tried the Housing command.")
addCommandHandler ( "spawn", spawner )  

the thing i want to create  is to make a txt file code into this script which writes and saves every spawn the player did like the outputDebugString. 


Link to post

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