Jump to content

help with startResource


AE.

Recommended Posts

Posted

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 )

 

Posted

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

If you find my post useful or if it helped you, please like my post :)
Ingame name: ZoeN

560x95_FFFFFF_FF9900_000000_000000.png

Posted

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 

giphy.gif

Posted

What are you trying to do?! as far as i know the resource will be started for all players. 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

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

giphy.gif

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

 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted (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 by draobrehtom
Posted
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

giphy.gif

Posted (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 by draobrehtom
Posted
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

giphy.gif

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