Jump to content

[Problem]Poprawność kodu


Recommended Posts

Witam. Posiadam pewien skrypt który powinien tworzyć NPC który sprzedaje paliwo (tankuje), dostając go powiedziano mi że koordynaty musze sam wpisać. Wpisałem je i nic niemam jeżeli ktoś mógłby powiedzieć co mam źle ew. dać poprawiony kod.

Z góry dzięki. Pozdrawiam To'

oto kod:

function createFuelPed(217, 1940.7587890625, -1776.2998046875, 13.390598297119, 87, name, priceratio) 
    theNewPed = createPed (50, 1941.5654296875, -1769.1708984375, 13.640625) 
    exports.pool:allocateElement(theNewPed) 
    setPedRotation (theNewPed, rotZ) 
    setPedFrozen(theNewPed, true) 
    setPedAnimation(theNewPed, "FOOD", "FF_Sit_Loop",  -1, true, false, true) 
    exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "ped:name", name, true) 
    exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "ped:fuelped",true) 
     
    exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "fuel:priceratio" , priceratio or 100, false) 
     
    -- For the language system 
    exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.lang1" , 1, false) 
    exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.lang1skill", 100, false) 
    exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.lang2" , 2, false) 
    exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.lang2skill", 100, false) 
    exports['anticheat-system']:changeProtectedElementDataEx(theNewPed, "languages.current", 1, false)   
  
    return theNewPed 
end 
  
function onServerStart() 
    local sqlHandler = mysql:query("SELECT * FROM fuelpeds") 
    if (sqlHandler) then 
        while true do 
            local row = mysql:fetch_assoc( sqlHandler ) 
            if not row then break end 
             
            createFuelPed(tonumber(row["skin"]),tonumber(row["posX"]),tonumber(row["posY"]),tonumber(row["posZ"]), tonumber(row["rotZ"]), row["name"],tonumber(row["priceratio"])) 
        end 
         
    end 
    mysql:free_result(sqlHandler) 
end 
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onServerStart) 
  
  
--createFuelPed(217, 1940.7587890625, -1776.2998046875, 13.390598297119,87) 

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