Jump to content

Help me with this script please!


Recommended Posts

I'm creating a script than fix all cars in the server (A race server). I have a script than fix 1 only car, but I want to fix all. This is the script than fix 1 only car:

------------------------------------------------------------ 
function st3reo6 (thePlayer, commandName, ...) 
player = findPlayer(...) 
if not player then 
outputChatBox("* /fix: player not found", thePlayer) 
elseif isPedInVehicle(player) then 
local vehicle = getPedOccupiedVehicle(player) 
fixVehicle(vehicle) 
outputChatBox( getPlayerName(thePlayer).. " Fix Vehicle " ..getPlayerName(player), getRootElement(), 255, 255, 0, true) 
end 
end 
addCommandHandler("fix", st3reo6) 
  
function findPlayer(namepart) 
for i, player in ipairs(getElementsByType("player")) do 
local name = getPlayerName(player) 
if string.find(name:lower(), namepart:lower(), 1, true) then 
return player, name 
end 
end 
return false 
end 
----------------------------------------------------- 

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