sckatchof 0 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) Share this post Link to post
DNL291 621 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) Share this post Link to post
TAPL 134 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 Share this post Link to post
sckatchof 0 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 Share this post Link to post
drk 1 Posted April 6, 2012 function Pincar() local rowindex, columnindex = guiGridListGetSelectedItem ( GridlOwnerCar ) local carname = guiGridListGetItemText ( GridlOwnerCar, rowindex, columnindex) triggerServerEvent("PinCar", root, localPlayer, carname) end Share this post Link to post
DNL291 621 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() Share this post Link to post
sckatchof 0 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" . Share this post Link to post
DNL291 621 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 ) Share this post Link to post
X-SHADOW 0 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 . Share this post Link to post
drk 1 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 Share this post Link to post
sckatchof 0 Posted April 6, 2012 @DNL291 : thanks for help , still don't work and what you change ? Share this post Link to post
Jaysds1 5 Posted April 6, 2012 ok, I can see everyone posting stuff, when is this triggered? Share this post Link to post
sckatchof 0 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. Share this post Link to post
TAPL 134 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 Share this post Link to post
drk 1 Posted April 6, 2012 In the gridlist, appears vehicle name, id or other thing? TAPL, I only changed his code. Share this post Link to post
sckatchof 0 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 Share this post Link to post
DNL291 621 Posted April 6, 2012 still do not understand What you really want to do Share this post Link to post
sckatchof 0 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 Share this post Link to post
TAPL 134 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 Share this post Link to post
drk 1 Posted April 6, 2012 You simply can't. You can't get vehicle element from name. Share this post Link to post
Jaysds1 5 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 Share this post Link to post
DNL291 621 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. Share this post Link to post