Jump to content

Vehicle system


Recommended Posts

Posted

I need set vehicle name on row,whats wrong?No errors

Server side:

function settext () 
local accn = getPlayerAccount ( source ) 
local accdata = getAccountData ( accn, "owner" ) 
triggerClientEvent ( source, "setext", source ) 
end 
addEvent ( "settext", true ) 
addEventHandler ( "settext", root, settext ) 

Client side:

function setext ( data ) 
guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], data, false, true) 
end 
addEvent ( "setext", true ) 
addEventHandler ( "setext", root, setext ) 

Need paid scripter just pm me i will accept every job!

Posted
function settextServer () 
local accn = getPlayerAccount ( source ) 
local accdata = getAccountData ( accn, "owner" ) 
triggerClientEvent ( source, "setextClient", source, accdata ) -- You forgot to add accdata 
end 
addEvent ( "settextServer", true ) 
addEventHandler ( "settextServer", root, settextServer ) 

function setextClient ( data ) 
guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], data, false, true) 
end 
addEvent ( "setextClient", true ) 
addEventHandler ( "setextClient", root, setextClient ) 

Posted
function settextServer () 
local accn = getPlayerAccount ( source ) 
local accdata = getAccountData ( accn, "owner" ) 
triggerClientEvent ( source, "setextClient", source, accdata ) -- You forgot to add accdata 
end 
addEvent ( "settextServer", true ) 
addEventHandler ( "settextServer", root, settextServer ) 

function setextClient ( data ) 
guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], data, false, true) 
end 
addEvent ( "setextClient", true ) 
addEventHandler ( "setextClient", root, setextClient ) 

Dont work :/

MTA Scripter.

If you want scripter PM me and i will accept every job for fair price.

Posted

Try this:

Server:

function settextServer () -- I suppose you trigger this function from client but you didn't mention it or there will be no 'source' 
local accn = getPlayerAccount ( source ) 
local accdata = getAccountData ( accn, "owner" ) 
triggerClientEvent ( "setextClient", source, accdata ) 
end 
addEvent ( "settextServer", true ) 
addEventHandler ( "settextServer", root, settextServer ) 

Client:

function setextClient ( data ) 
guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], tostring(data), false, true) 
end 
addEvent ( "setextClient", true ) 
addEventHandler ( "setextClient", getLocalPlayer(), setextClient ) 

Posted
Try this:

Server:

function settextServer () -- I suppose you trigger this function from client but you didn't mention it or there will be no 'source' 
local accn = getPlayerAccount ( source ) 
local accdata = getAccountData ( accn, "owner" ) 
triggerClientEvent ( "setextClient", source, accdata ) 
end 
addEvent ( "settextServer", true ) 
addEventHandler ( "settextServer", root, settextServer ) 

Client:

function setextClient ( data ) 
guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], tostring(data), false, true) 
end 
addEvent ( "setextClient", true ) 
addEventHandler ( "setextClient", getLocalPlayer(), setextClient ) 

Dont work :/

Need paid scripter just pm me i will accept every job!

Posted

How do you trigger this event: "settext"?

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

Post the part where you trigger that event.

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

This?

function settext () 
local accn = getPlayerAccount ( source ) 
local accdata = getAccountData ( accn, "owner" ) 
triggerClientEvent ( source, "setext", source ) 
end 
addEvent ( "settext", true ) 
addEventHandler ( "settext", root, settext ) 

Need paid scripter just pm me i will accept every job!

Posted

No, post the script which triggers the event: "settext".

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

Is what I'm thinking, as he doesn't even understand what I mean.

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

How do you expect your script to work then?

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

I triggered it but its dont work

Client side:

function setextClient ( data ) 
guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], data, false, true) 
triggerServerEvent ( "settextServer", getLocalPlayer()) 
end 
addEvent ( "setextClient", true ) 
addEventHandler ( "setextClient", root, setextClient ) 

Server side:

function settextServer () -- I suppose you trigger this function from client but you didn't mention it or there will be no 'source' 
local accn = getPlayerAccount ( source ) 
local accdata = getAccountData ( accn, "owner" ) 
triggerClientEvent ( "setextClient", source, accdata ) 
end 
addEvent ( "settextServer", true ) 
addEventHandler ( "settextServer", root, settextServer ) 

Need paid scripter just pm me i will accept every job!

Posted (edited)

Of course it won't. Your two functions trigger each other but there's no event that call at least one of them.

Edited by Guest
Posted

Sorry, but this script doesn't make sense, how is the client-side script suppose to trigger if the server has to trigger it, but in order for the server to trigger it the client has to trigger it,

THIS IS GOING TO BE A LOOP!!!

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted

You should make it like this:

Client side:

function setextClient ( data ) 
outputChatBox(tostring(data).." received!") 
guiGridListSetItemText (GUIEditor_Grid[2], GUIEditor_Row[2], GUIEditor_Column[1], tostring(data), false, true) 
end 
addEvent ( "setextClient", true ) 
addEventHandler ( "setextClient", getLocalPlayer(), setextClient ) 

Server side:

function settextServer (thePlayer) 
local accn = getPlayerAccount ( thePlayer ) 
local accdata = getAccountData ( accn, "owner" ) 
triggerClientEvent ( "setextClient", thePlayer, accdata ) 
end 
addCommandHandler ( "text", settextServer ) 

Posted
Well... Actually we don't know about your system. Why don't you provide us with the full code and then we could try to help you?

If i will post full code then its complet script i can send it to you via PM.

Need paid scripter just pm me i will accept every job!

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