draobrehtom Posted September 11, 2016 Share Posted September 11, 2016 3laa33, man, I told you about it in the beginning. God.. 8 minutes ago, John Smith said: Jesus... replace startResource ( skinnew ) with startResource(getResourceFromName("skinnew")) 44 minutes ago, draobrehtom said: Firstly, get the resource from name by getResourceFromName ( resourceName ) Link to comment
John Smith Posted September 11, 2016 Share Posted September 11, 2016 Nope, you can only load script code on client-side with loadstring function by reading script file's content and putting it in loadstring(fileContent), however that is much more complex thing to do, and it would require you to script a custom script loader which would be needed to unload the code which you have loaded with loadstring. If your goal is to make only 1 player see custom skins, you can do it already with functions such as engineLoadDFF/engineLoadTXD/etc on client-side, but make sure that that client code gets only executed for that player for who you want the skin to be visible Link to comment
AE. Posted September 11, 2016 Author Share Posted September 11, 2016 i did it man . the problem was the >> " << 1 minute ago, John Smith said: Nope, you can only load script code on client-side with loadstring function by reading script file's content and putting it in loadstring(fileContent), however that is much more complex thing to do, and it would require you to script a custom script loader which would be needed to unload the code which you have loaded with loadstring. If your goal is to make only 1 player see custom skins, you can do it already with functions such as engineLoadDFF/engineLoadTXD/etc on client-side, but make sure that that client code gets only executed for that player for who you want the skin to be visible no i need it for another thing but anyway thx for helping Link to comment
Walid Posted September 11, 2016 Share Posted September 11, 2016 What are you trying to do?! as far as i know the resource will be started for all players. Link to comment
AE. Posted September 11, 2016 Author Share Posted September 11, 2016 i'am trying to make a start for the new players first they will spawn in a villa and then will ride a heli with ped and go to army base ... Link to comment
Walid Posted September 11, 2016 Share Posted September 11, 2016 8 minutes ago, 3laa33 said: i'am trying to make a start for the new players first they will spawn in a villa and then will ride a heli with ped and go to army base ... Using startResource on player login is very very very bad idea, simply you can use something like: -- Server side addEventHandler("onPlayerLogin", root, function(_,account) local check = getAccountData(account, "FirstTime") if check then outputChatBox("This is not the first time for you!", source, 255, 0, 0) else outputChatBox("You're playing for the first time!", source, 0, 255, 0) setElementPosition ( source, 1254.50049, -790.40015, 92.03018 ) setAccountData(account, "FirstTime", true) triggerClientEvent(source,"EventName",source) end end ) -- Client side addEvent("EventName", true ) addEventHandler("EventName", root, function () guiSetVisible(yourGui, not guiGetVisible(yourGui)) showCursor(guiGetVisible(yourGui)) end ) Link to comment
AE. Posted September 11, 2016 Author Share Posted September 11, 2016 (edited) i did it like this but it don't create a vehicle Edited September 11, 2016 by 3laa33 Link to comment
draobrehtom Posted September 11, 2016 Share Posted September 11, 2016 (edited) You can do it locally in one rerource. I think you want something like this. If player connect, check is it a new player, then start function (or trigger event, like in example above), which teleport your player into a villa, set them a random world dimension not equals to 0 for all elements (heli, ped) including a player. Then you can warp ped into a heli and set event onClientVehicleEnter, in handler function check if it this heli for this player and so on. Edited September 11, 2016 by draobrehtom Link to comment
AE. Posted September 11, 2016 Author Share Posted September 11, 2016 Just now, draobrehtom said: You can do it locally in one rerource. I think you want something like this. If player connect, check is it a new player, then start function (or trigger event, like in example aboe), which teleport your player into a villa, set them a random world dimension not equals to 0 for all elements (heli, ped) including a player. Then you can warp ped into a heli and set event onClientVehicleEnter, in handler function check if it this heli for this player. If it you can ride and so on. i did all this but it don't create the heli Link to comment
draobrehtom Posted September 11, 2016 Share Posted September 11, 2016 (edited) 4 minutes ago, 3laa33 said: i did all this but it don't create the heli I don't know why you are want separate resource. Did you know, that all clients scripts runs manually on each client. It's like you have a many of copies clients scripts on each pc players (which runs when client connect to server) and one server script on a your server? Edited September 11, 2016 by draobrehtom Link to comment
AE. Posted September 11, 2016 Author Share Posted September 11, 2016 2 minutes ago, draobrehtom said: I don't know why you are want separate resource. Did you know, that all clients scripts runs manually on each client. It's like you have a many of copies clients scripts on each pc players and one server script on a your server? i don't want separate resource but every time i try to make it in one script it just won't work so i will put it in a dimension ... and it's over Link to comment
draobrehtom Posted September 11, 2016 Share Posted September 11, 2016 (edited) 20 minutes ago, 3laa33 said: Edited September 11, 2016 by draobrehtom Link to comment
AE. Posted September 11, 2016 Author Share Posted September 11, 2016 omg i'am so idiotttttttttttttttttt ! i create a vehicle and the player in other dimension Link to comment
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