Jump to content

help with startResource


AE.

Recommended Posts

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

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

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

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