sckatchof Posted April 6, 2012 Share Posted April 6, 2012 hi guys i have probelm when i blip my car nothing it show this is server side function PinCar(thePlayer,carname) local vehicule = getVehicleName(carname) if (vehicule) then local blip = createBlipAttachedTo (vehicule, 19, 4, 255, 0, 0, 255, 0, 99999.0, thePlayer) else outputChatBox("vehicule not found",thePlayer,255,0,0) end end addEvent("PinCar", true) addEventHandler("PinCar", getRootElement(), PinCar) Link to comment
DNL291 Posted April 6, 2012 Share Posted April 6, 2012 function PinCar(thePlayer,carname) local carname = getPedOccupiedVehicle(source) local vehicule = getVehicleName(carname) if (vehicule) then local blip = createBlipAttachedTo (vehicule, 19, 4, 255, 0, 0, 255, 0, 99999.0, thePlayer) else outputChatBox("vehicule not found",thePlayer,255,0,0) end end addEvent("PinCar", true) addEventHandler("PinCar", getRootElement(), PinCar) Link to comment
TAPL Posted April 6, 2012 Share Posted April 6, 2012 function PinCar(thePlayer) local vehicule = getPedOccupiedVehicle(thePlayer) if (vehicule) then local blip = createBlipAttachedTo(vehicule, 19, 4, 255, 0, 0, 255, 0, 99999.0, thePlayer) else outputChatBox("vehicule not found",thePlayer,255,0,0) end end addEvent("PinCar", true) addEventHandler("PinCar", getRootElement(), PinCar) if you show the trigger this would be better Link to comment
sckatchof Posted April 6, 2012 Author Share Posted April 6, 2012 thanks for help but still don't work Link to comment
sckatchof Posted April 6, 2012 Author Share Posted April 6, 2012 if you show the trigger this would be better client function Pincar() local rowindex, columnindex = guiGridListGetSelectedItem ( GridlOwnerCar ) local carname = guiGridListGetItemText ( GridlOwnerCar, rowindex, 1) triggerServerEvent("PinCar", getRootElement(), localPlayer, carname) end Link to comment
drk Posted April 6, 2012 Share Posted April 6, 2012 function Pincar() local rowindex, columnindex = guiGridListGetSelectedItem ( GridlOwnerCar ) local carname = guiGridListGetItemText ( GridlOwnerCar, rowindex, columnindex) triggerServerEvent("PinCar", root, localPlayer, carname) end Link to comment
DNL291 Posted April 6, 2012 Share Posted April 6, 2012 would be better if you show us the other part of the script and debugscript and root is the same as getRootElement() Link to comment
sckatchof Posted April 6, 2012 Author Share Posted April 6, 2012 would be better if you show us the other part of the script and debugscriptand root is the same as getRootElement() i post part of server side and client side my problem when i select my car from gridlist and click button "Blip car" it show in chatbox "vehicule not found" . Link to comment
DNL291 Posted April 6, 2012 Share Posted April 6, 2012 try addEvent("PinCar", true) addEventHandler("PinCar", getRootElement(), function (thePlayer) local vehicule = getPedOccupiedVehicle(thePlayer) if (vehicule) then local blip = createBlipAttachedTo(vehicule, 19, 4, 255, 0, 0, 255, 0, 99999.0, thePlayer) else outputChatBox("vehicule not found",thePlayer,255,0,0) end end ) Link to comment
X-SHADOW Posted April 6, 2012 Share Posted April 6, 2012 you have to enter an vehicle and test it Because he using local vehicule = getPedOccupiedVehicle(thePlayer) he get the car you sit on . Link to comment
drk Posted April 6, 2012 Share Posted April 6, 2012 (edited) function Pincar() local rowindex, columnindex = guiGridListGetSelectedItem ( GridlOwnerCar ) if ( rowindex and columnindex and rowindex ~= -1 and columnindex ~= -1 ) then local carname = guiGridListGetItemText ( GridlOwnerCar, rowindex, columnindex) createBlipAttachedTo ( getVehicleModelFromName ( carname ), 19, 4, 255, 0, 0, 255, 0, 99999.0, localPlayer) end end Edited April 6, 2012 by Guest Link to comment
sckatchof Posted April 6, 2012 Author Share Posted April 6, 2012 @DNL291 : thanks for help , still don't work and what you change ? Link to comment
Jaysds1 Posted April 6, 2012 Share Posted April 6, 2012 ok, I can see everyone posting stuff, when is this triggered? Link to comment
sckatchof Posted April 6, 2012 Author Share Posted April 6, 2012 sckatchof, try mine. thanks for help but don't work i have vehicle panel and i have grid list with my owner car and when i buy a car it show in grid list and i want when i select car and press button blip it show on the map that is my problem. Link to comment
TAPL Posted April 6, 2012 Share Posted April 6, 2012 function Pincar() local rowindex, columnindex = guiGridListGetSelectedItem ( GridlOwnerCar ) if ( rowindex and columnindex and rowindex ~= -1 and columnindex ~= -1 ) then local carname = guiGridListGetItemText ( GridlOwnerCar, rowindex, columnindex) createBlipAttachedTo ( getVehicleModelFromName ( carname ), 19, 4, 255, 0, 0, 255, 0, 99999.0, localPlayer) end end getVehicleModelFromName Returns an integer and createBlipAttachedTo first Argument Required element ----------------------------------- hey topic owner are you F*** idiot or what? you want attached a blip to vehicle name that are saved into grid list? epic fail Link to comment
drk Posted April 6, 2012 Share Posted April 6, 2012 In the gridlist, appears vehicle name, id or other thing? TAPL, I only changed his code. Link to comment
sckatchof Posted April 6, 2012 Author Share Posted April 6, 2012 you want attached a blip to vehicle name that are saved into grid list? epic fail Yes that what i want Link to comment
DNL291 Posted April 6, 2012 Share Posted April 6, 2012 still do not understand What you really want to do Link to comment
sckatchof Posted April 6, 2012 Author Share Posted April 6, 2012 still do not understand What you really want to do I want attached a blip to vehicle name that are saved into grid list Link to comment
TAPL Posted April 6, 2012 Share Posted April 6, 2012 you want attached a blip to vehicle name that are saved into grid list? epic fail Yes that what i want still do not understand What you really want to do I want attached a blip to vehicle name that are saved into grid list Link to comment
drk Posted April 6, 2012 Share Posted April 6, 2012 You simply can't. You can't get vehicle element from name. Link to comment
Jaysds1 Posted April 6, 2012 Share Posted April 6, 2012 try this: addEventHandler("onClientGUIClick"GridlOwnerCar,function(button) if(button)then local rowindex, columnindex = guiGridListGetSelectedItem ( GridlOwnerCar ) local carname = guiGridListGetItemText ( GridlOwnerCar, rowindex, columnindex) triggerServerEvent("PCar", localPlayer, carname) end end,false) addEvent("Pincar",true) addEventHandler("PinCar",root,function(carname) if(carname=="")then for i,cars in ipairs(getElementsByType("vehicle")) do for c,vehicle in ipairs(getVehicleModelFromName(carname)) do createBlipAttachedTo(vehicle,0,3,0,0,0,0,0,65535,client) end end end end Link to comment
DNL291 Posted April 6, 2012 Share Posted April 6, 2012 @TAPL do not understand why I have never seen this script. I want attached a blip to vehicle name that are saved into grid list not understand. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now