Deger
January 10, 2018, 11:20pm
1
Hello, i need to get a answer to this question?!
AddEventHandler(“playerSpawned”, function(spawn)
I know the playerSpawned event comes from spawnmanager scripts, but how could i possible know what to put in the parameters of the function?
Sometimes the function parameters are empty why and how could i know what to put in there?
Take a look at the wiki. For the playerSpawned event, the only argument is spawn. https://wiki.fivem.net/wiki/Event:PlayerSpawned
That is not the case for all of them though, check out this page for more on events:
https://wiki.fivem.net/wiki/Server_events
Deger
January 11, 2018, 10:06am
3
Thank you thank you, i understood that but for example if i made my own event
“AddEventHandler(“welcomeMessage”, function(text))” This will add my event “welcomeMessage” and i googled a bit and found that the function(text) is a text but i cant find where all of these functions are stored?
Wanna help me out?
Deger
January 11, 2018, 10:43am
5
I have read through some scripts, and when they want to get the playerped they write (GetPlayerPed(-1))
Why the “-1” i know it want the players id but why -1?
hypr9xa
January 11, 2018, 10:44am
6
-1 is the player calling it.
Deger
January 11, 2018, 10:51am
7
Yep, tbh you dont even -1, you could just write (playerID) it still works, atleast on the script i have!
hypr9xa
January 11, 2018, 12:34pm
8
Because you have a local playerID.
local playerID = GetPlayerPed(-1)