Jump to content

Little problem pls help me!


TheIceman

Recommended Posts

Posted

I made car spawn script and i cant spawn car who can help me?

function openGUI() 
window = guiCreateWindow (0.3,0.2,0.3,0.6,"SACR Car spawn",true) 
gridlist = guiCreateGridList (0.1,0.1,0.8,0.7,true,window) 
column = guiGridListAddColumn( gridlist, "Vehicles:", 0.85 ) 
row = guiGridListAddRow ( gridlist ) 
guiGridListSetItemText ( gridlist, row, column, "Patriot", false, false ) 
button = guiCreateButton (0.8,0.8,0.2,0.2,"Patriot",true,window) 
close = guiCreateButton(0,0.85,0.45,0.1,"Close",true,window) 
  
    showCursor (true) 
end 
addEvent ("openGUI",true) 
addEventHandler ("openGUI",getRootElement(getThisResource()),openGUI) 
  
function destroyGUI() 
     destroyElement(window) 
 window = false 
     showCursor (false) 
end 
  
  
function buttonClick() 
   if source == row then 
triggerServerEvent ("vehicle",getLocalPlayer()) 
destroyGUI () 
   elseif source == close then 
destroyGUI () 
    end 
end 
addEventHandler("onClientGUIClick",getRootElement(),buttonClick) 
  
  

Please help me!!

SAUR player.

RRC:RPG Staff Probation.

Croatia:RPG Military General.

MTA Scripter.

SACR Owner/Scripter.

If you want scripter PM me for more informations!

MTA name:TheIceman

Posted

for fix that u dont want that!

SAUR player.

RRC:RPG Staff Probation.

Croatia:RPG Military General.

MTA Scripter.

SACR Owner/Scripter.

If you want scripter PM me for more informations!

MTA name:TheIceman

Posted

Yes, I need that. You said the car don't spawn. Where the part of vehicle spawn?

Also, for fix that: Seems like we are obliged to fix your code lol

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted

If i will update server.lua then u have my script

SAUR player.

RRC:RPG Staff Probation.

Croatia:RPG Military General.

MTA Scripter.

SACR Owner/Scripter.

If you want scripter PM me for more informations!

MTA name:TheIceman

Posted

Can't you just post the fucking script and learn for a proper english? Do you think I will steal scripts? Why I will steal scripts if I can make by my own lol

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted
local vehicles = 
    { 
        "Patriot" 
    } 
  
function openGUI ( ) 
    window = guiCreateWindow (0.3,0.2,0.3,0.6,"SACR Car spawn",true) 
    gridlist = guiCreateGridList (0.1,0.1,0.8,0.7,true,window) 
    column = guiGridListAddColumn( gridlist, "Vehicles:", 0.85 ) 
    for index, vehicle in ipairs ( vehicles ) do 
        local row = guiGridListAddRow ( gridlist ) 
        guiGridListSetItemText ( gridlist, row, column, tostring ( vehicle ), false, false ) 
    end 
    button = guiCreateButton (0.8,0.8,0.2,0.2,"Spawn",true,window) 
    close = guiCreateButton(0,0.85,0.45,0.1,"Close",true,window) 
    showCursor ( true ) 
end 
addEvent ( "openGUI", true ) 
addEventHandler ( "openGUI", root, openGUI ) 
  
function destroyGUI() 
    destroyElement(window) 
    showCursor (false) 
    window = nil 
end 
  
function buttonClick ( ) 
   if ( source == button ) then -- "row" is not a GUI element. 
        local row, col = guiGridListGetSelectedItem ( gridlist ) -- Get the selected item from the grid list. 
        if ( row and col and row ~= -1 and col ~= -1 ) then -- If he has a selected item. 
            local vehicleName = guiGridListGetItemText ( gridlist, row, col ) -- Get the text of it. 
            triggerServerEvent ( "vehicle", localPlayer, getVehicleModelFromName ( vehicleName ) ) -- Trigger the "vehicle" event with a vehicle model argument. 
            destroyGUI () 
        end 
   elseif ( source == close ) then 
        destroyGUI () 
    end 
end 
addEventHandler ( "onClientGUIClick", getRootElement(), buttonClick ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

So what? if he posts here, I'll reply here.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
So what? if he posts here, I'll reply here.

I will not answer those "THINGS".

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

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