Jump to content

[HELP] Script


1LoL1

Recommended Posts

Hello, i created script but not work.. please anyone can help me? error: i think "end" is expected..

and outputChatBox said 2x.. :(

And i want "Car fixed for withvip 100$ novip 200$ in chatbox

and when i dont have $ i going to -$$$

function fix (playerSource) 
    local theVehicle = getPedOccupiedVehicle (playerSource) 
    if theVehicle and getVehicleController ( theVehicle ) == playerSource then 
         fixVehicle (theVehicle) 
         local withvip = 100 
         local novip = 200 
         outputChatBox ("#FF0000[!] #FFFFFFCar fixed for #00FF00" .. withvip .." #FF0000[!]", thePlayer, 255, 255, 255, true) 
         if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)),aclGetGroup("VIP")) then 
         takePlayerMoney ( playerSource, withvip ) 
                 else 
                 outputChatBox ("#FF0000[!] #FFFFFFCar fixed for #00FF00" .. novip .." #FF0000[!]", thePlayer, 255, 255, 255, true) 
                 takePlayerMoney ( playerSource, novip ) 
end 
end 
end 
addCommandHandler ("repair" , fix) 

Link to comment
function fix (playerSource) 
    local theVehicle = getPedOccupiedVehicle (playerSource) 
    if theVehicle and getVehicleController ( theVehicle ) == playerSource then 
        fixVehicle (theVehicle) 
        withvip = 100 
        novip = 200 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)),aclGetGroup("VIP")) then 
        outputChatBox ("#FF0000[!] #FFFFFFCar fixed for #00FF00" .. withvip .." #FF0000[!]", thePlayer, 255, 255, 255, true) 
        takePlayerMoney ( playerSource, withvip ) 
    else 
        outputChatBox ("#FF0000[!] #FFFFFFCar fixed for #00FF00" .. novip .." #FF0000[!]", thePlayer, 255, 255, 255, true) 
        takePlayerMoney ( playerSource, novip ) 
    end 
  end 
end 
addCommandHandler ("repair" , fix) 

1. It outputs message 2x, because the message was the wrong place.

2. Don't use the local function, if it is above the IF

Test it

Link to comment
function fix (playerSource) 
    local theVehicle = getPedOccupiedVehicle (playerSource) 
    if theVehicle and getVehicleController ( theVehicle ) == playerSource then 
        fixVehicle (theVehicle) 
        withvip = 100 
        novip = 200 
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(playerSource)),aclGetGroup("VIP")) then 
        outputChatBox ("#FF0000[!] #FFFFFFCar fixed for #00FF00" .. withvip .." #FF0000[!]", thePlayer, 255, 255, 255, true) 
        takePlayerMoney ( playerSource, withvip ) 
    else 
        outputChatBox ("#FF0000[!] #FFFFFFCar fixed for #00FF00" .. novip .." #FF0000[!]", thePlayer, 255, 255, 255, true) 
        takePlayerMoney ( playerSource, novip ) 
    end 
  end 
end 
addCommandHandler ("repair" , fix) 

1. It outputs message 2x, because the message was the wrong place.

2. Don't use the local function, if it is above the IF

Test it

Thx work :) and when anyone dont have $? :D

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