Jump to content

Need Help


Recommended Posts

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
  • Replies 55
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

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
function Pincar() 
        local rowindex, columnindex = guiGridListGetSelectedItem ( GridlOwnerCar ) 
        local carname = guiGridListGetItemText ( GridlOwnerCar, rowindex, columnindex) 
        triggerServerEvent("PinCar", root, localPlayer, carname) 
end 

Link to comment
would be better if you show us the other part of the script and debugscript

and 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

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
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 by Guest
Link to comment
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

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

omg-shock-face.jpg

Link to comment

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

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