Jump to content

Error que no se por que sale...


Arsilex

Recommended Posts

function plusStop (driver) 
    local veh = getPedOccupiedVehicle (driver) 
    moneyDriver[driver] = moneyDriver[driver] + 3 
    for k, v in pairs (stops) do 
        local vehPassenger = getPedOccupiedVehicle (k) 
        if vehPassenger == veh then 
            stops[k] = stops[k] + 1 
            money[k] = money[k] + 3 
            outputChatBox("Necesitaras "..(money[k]).."$ para llegar a la proxima parada", k, 255, 255, 0) 
        end 
    end 
end 
addEvent("plusStop", true) 
addEventHandler("plusStop", getRootElement(), plusStop) 

Error:         local vehPassenger = getPedOccupiedVehicle (k)

Link to comment
function plusStop (driver) 
    local veh = getPedOccupiedVehicle (driver) 
    moneyDriver[driver] = moneyDriver[driver] + 3 
    for k, v in pairs (stops) do 
        local vehPassenger = getPedOccupiedVehicle (k) 
        if vehPassenger == veh then 
            stops[k] = stops[k] + 1 
            money[k] = money[k] + 3 
            outputChatBox("Necesitaras "..(money[k]).."$ para llegar a la proxima parada", k, 255, 255, 0) 
        end 
    end 
end 
addEvent("plusStop", true) 
addEventHandler("plusStop", getRootElement(), plusStop) 

Error:         local vehPassenger = getPedOccupiedVehicle (k)

'k' es un ped o un jugador?

Link to comment
function onEnterUnPasajeroLOL (vehicle) 
    occupants = getVehicleOccupants ( vehicle ) 
    if ( getElementModel(vehicle) == 437 and working[occupants[0]] == true and occupants[0] ~= source ) then 
        money[source] = math.random(2,4) 
        outputChatBox("Alguien ha entrado al autobus, cobraras su dinero cuando el baje", occupants[0], 0, 255, 0) 
        outputChatBox("Necesitaras "..(money[source]).."$ para llegar a la proxima parada y por cada parada que pases se sumara 3$ mas", source, 255, 255, 0) 
        stops[source] = 1 
    end 
end 
addEventHandler("onPlayerVehicleEnter", getRootElement(), onEnterUnPasajeroLOL) 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...