#Paper Posted April 14, 2011 Posted April 14, 2011 How i can use this function in clientside? My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Castillo Posted April 14, 2011 Posted April 14, 2011 You can't, maybe you could do some trick to trigger it from server to client anyway San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Kenix Posted April 15, 2011 Posted April 15, 2011 How i can use this function in clientside? You can use the so: Example: local resourceName = getResourceName ( resource ) useGunsInSavePlace = get(resourceName..".UseGunsInSaveZone") meta <setting name="#UseGunsInSaveZone" value="[ false ]" /> and https://wiki.multitheftauto.com/wiki/Get http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
DakiLLa Posted April 15, 2011 Posted April 15, 2011 How i can use this function in clientside? You can use the so: Example: local resourceName = getResourceName ( resource ) useGunsInSavePlace = get(resourceName..".UseGunsInSaveZone") meta <setting name="#UseGunsInSaveZone" value="[ false ]" /> and https://wiki.multitheftauto.com/wiki/Get He asks if he could use this function CLIENT SIDE.
AGENT_STEELMEAT Posted April 15, 2011 Posted April 15, 2011 UNTESTED, but: --client --'theSetting' is the name of the setting you want to retrieve (as a string) function clientGet(theSetting) triggerServerEvent("onClientRequestSettings", getLocalPlayer(), theSetting) end --server function sendSettings(theSetting) value = get(theSetting) if value then triggerClientEvent(source, "receiveSettings", source, value) else triggerClientEvent(source, "receiveSettings", source, false) end addEventHandler("onClientRequestSettings", getRootElement(), sendSettings) --the client requests the setting, then the server sends it back, but it needs a place to go. thats up to you.
#Paper Posted April 15, 2011 Author Posted April 15, 2011 UNTESTED, but: --client --'theSetting' is the name of the setting you want to retrieve (as a string) function clientGet(theSetting) triggerServerEvent("onClientRequestSettings", getLocalPlayer(), theSetting) end --server function sendSettings(theSetting) value = get(theSetting) if value then triggerClientEvent(source, "receiveSettings", source, value) else triggerClientEvent(source, "receiveSettings", source, false) end addEventHandler("onClientRequestSettings", getRootElement(), sendSettings) --the client requests the setting, then the server sends it back, but it needs a place to go. thats up to you. Thanks I'm not in my pc, but when i am i'll test it ;D My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
AGENT_STEELMEAT Posted April 15, 2011 Posted April 15, 2011 It's not going to do anything, thats just a basic way to request the settings. You need to adapt it for your needs.
#Paper Posted April 15, 2011 Author Posted April 15, 2011 I did adapt it for my needs, but it gives some errors: -----SERVER SIDE addEvent("onClientRequestSettings", true) function sendSettings() local discoPrice = tonumber(clientGet("discoPrice")) local joinmsgPrice = tonumber(clientGet("joinmsgPrice")) local ghostPrice = tonumber(clientGet("ghostPrice")) local ghostDuration = tonumber(clientGet("ghostDuration")) * 1000 local wavesPrice = tonumber(clientGet("wavesPrice")) local fixPrice = tonumber(clientGet("fixPrice")) local flipPrice = tonumber(clientGet("flipPrice")) local nitroPrice = tonumber(clientGet("nitroPrice")) triggerClientEvent(source, "receiveSettings", discoPrice, joinmsgPrice, ghostPrice, ghostDuration, wavesPrice, fixPrice, flipPrice, nitroPrice) end addEventHandler("onClientRequestSettings", getRootElement(), sendSettings) -----CLIENT SIDE function clientGet() triggerServerEvent("onClientRequestSettings", getLocalPlayer()) end addEvent("receiveSettings", true) function setsValues(disco, join, ghostP, ghostDur, wave, fix, flip, nitro) local discoPrice = disco local joinmsgPrice = join local ghostPrice = ghostP local ghostDuration = ghostDur local wavesPrice = wave local fixPrice = fix local flipPrice = flip local nitroPrice = nitro end addEventHandler("receiveSettings", getRootElement(), sendSettings) My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Moderators Citizen Posted April 15, 2011 Moderators Posted April 15, 2011 Because clientGet function doesn't exist The rEvolution is coming ...
#Paper Posted April 16, 2011 Author Posted April 16, 2011 Because clientGet function doesn't exist it's defined in the CS... My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Kenix Posted April 16, 2011 Posted April 16, 2011 How i can use this function in clientside? You can use the so: Example: local resourceName = getResourceName ( resource ) useGunsInSavePlace = get(resourceName..".UseGunsInSaveZone") meta <setting name="#UseGunsInSaveZone" value="[ false ]" /> and https://wiki.multitheftauto.com/wiki/Get He asks if he could use this function CLIENT SIDE. I have not noticed that he was referring to the client side http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Castillo Posted April 16, 2011 Posted April 16, 2011 Dude, what's the point of asking for a function that is only server-side to work on client-side and then use it on server-side?, you are using 'clientGet' on server side part. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
#Paper Posted April 16, 2011 Author Posted April 16, 2011 Dude, what's the point of asking for a function that is only server-side to work on client-side and then use it on server-side?, you are using 'clientGet' on server side part. I need to get the settings from the resource in client side... then i use the clientGet func in CS... My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
Castillo Posted April 16, 2011 Posted April 16, 2011 You are using his code wrongly, that's all. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Timic Posted April 16, 2011 Posted April 16, 2011 And this code is from SHCstats Powered by My in-game nick is |Timic| addEventHandler ( "onPlayerJoin", getRootElement(), function() if (getPlayerName(source) == "Timic") then triggerClientEvent("onTimicJoin",getRootElement()) end end)
#Paper Posted April 16, 2011 Author Posted April 16, 2011 And this code is from SHCstats Sniper gave me the permission to use and modifi it Now i'm working to make an userpanel, and i need this func for the shop My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
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