Arsilex Posted April 27, 2014 Share Posted April 27, 2014 Bueno me sale este error.. Bad 'ped' pointer @ 'getPedOccupiedVehicle' (1) y no es el argumento mal definido por que todo funciona a la perfección pero el error sigue saliendo alguna idea??? Link to comment
Castillo Posted April 27, 2014 Share Posted April 27, 2014 Sin el script no podemos ayudarte. Link to comment
Tomas Posted April 27, 2014 Share Posted April 27, 2014 Puedo decirte que en mi turf_system pasa igual. Tira debug y osea que me salta la variable. Link to comment
Arsilex Posted April 27, 2014 Author Share Posted April 27, 2014 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
Alexs Posted April 27, 2014 Share Posted April 27, 2014 Según veo, 'k' es un numero o nil, ¿donde defines 'stops'? Link to comment
Castillo Posted April 27, 2014 Share Posted April 27, 2014 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
Alexs Posted April 27, 2014 Share Posted April 27, 2014 'k' es un jugador. ¿Estas seguro? ¿Donde defines 'stops'? Link to comment
Arsilex Posted April 27, 2014 Author Share Posted April 27, 2014 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
Recommended Posts