papam77 Posted July 26, 2013 Share Posted July 26, 2013 function MG () local x = 384.7 local y = 173.6 local z = 1008.4 outputChatBox ("#ffffffWelcome on EAG| and |TSR| Server.", getRootElement(), 255,255,255, true ) outputChatBox ("#ffffffAre you new? Use /help for more informations.", getRootElement(), 255,255,255, true ) fadeCamera ( source, true ) spawnPlayer ( x, y , z , 0, 0, 3, 1) end addEventHandler ("onPlayerLogin", getRootElement(), MG ) Hello i have this code but it doesn't spawn me at position defined by me, where is problem? Server says: spawnPlayer bad Argument Link to comment
papam77 Posted July 26, 2013 Author Share Posted July 26, 2013 Bad 'player' pointer @ 'fadeCamera'(1) Bad 'player' pointer @ 'spawnPlayer'(1) Current code: function MG ( source ) local x = 384.7 local y = 173.6 local z = 1008.4 outputChatBox ("#ffffffWelcome on EAG| and |TSR| Server.", getRootElement(), 255,255,255, true ) outputChatBox ("#ffffffAre you new? Use /help for more informations.", getRootElement(), 255,255,255, true ) fadeCamera ( source, true ) spawnPlayer ( source, x, y , z ) end addEventHandler ("onPlayerLogin", getRootElement(), MG ) Link to comment
Vision Posted July 26, 2013 Share Posted July 26, 2013 function MG ( ) local x = 384.7 local y = 173.6 local z = 1008.4 outputChatBox ("#ffffffWelcome on EAG| and |TSR| Server.", getRootElement(), 255,255,255, true ) outputChatBox ("#ffffffAre you new? Use /help for more informations.", getRootElement(), 255,255,255, true ) fadeCamera ( source, true ) spawnPlayer ( source, x, y, z ) end addEventHandler ("onPlayerLogin", getRootElement(), MG ) Link to comment
papam77 Posted July 26, 2013 Author Share Posted July 26, 2013 And how can make in server side outputChatBox for localPlayer ? because definition localPlayer doesn't work. Link to comment
Vision Posted July 26, 2013 Share Posted July 26, 2013 outputChatBox ("#ffffffWelcome on EAG| and |TSR| Server.", source, 255,255,255, true ) outputChatBox ("#ffffffAre you new? Use /help for more informations.", source, 255,255,255, true ) Link to comment
papam77 Posted July 26, 2013 Author Share Posted July 26, 2013 And here is problem: function MG ( ) local x = 384.7 local y = 173.6 local z = 1008.4 outputChatBox ("#ffffffWelcome on EAG| and |TSR| Server.", source, 255,255,255, true ) outputChatBox ("#ffffffDon't forget to visit our website [url=http://EAG-Gaming.eu/]http://EAG-Gaming.eu/[/url]., source, 255,255,255, true ) outputChatBox ("#ffffffAre you new? Use #ff9900/help#ffffff for more informations.", source, 255,255,255, true ) fadeCamera ( source, true ) spawnPlayer ( source, x, y, z ) setElementInterior ( source, 3 ) setElementModel ( source, 240 ) end addEventHandler ("onPlayerLogin", getRootElement(), MG ) When i login it doesn't spawn me it's only fade the camera and output the text nothing more and without error and warning. Link to comment
iMr.3a[Z]eF Posted July 26, 2013 Share Posted July 26, 2013 function MG ( ) local x,y,z = 384.7, 173.6, 1008.4 outputChatBox ("#ffffffWelcome on EAG| and |TSR| Server.", source, 255,255,255, true ) outputChatBox ("#ffffffDon't forget to visit our website [url=http://EAG-Gaming.eu/]http://EAG-Gaming.eu/[/url] .", source, 255,255,255, true ) outputChatBox ("#ffffffAre you new? Use #ff9900/help#ffffff for more informations.", source, 255,255,255, true ) fadeCamera ( source, true ) spawnPlayer ( source, x,y,z ) setElementInterior ( source, 3 ) setElementModel ( source, 240 ) end addEventHandler ("onPlayerLogin", getRootElement(), MG ) Link to comment
papam77 Posted July 26, 2013 Author Share Posted July 26, 2013 Already have and how can set for Ped action Siting ? Link to comment
iMr.3a[Z]eF Posted July 26, 2013 Share Posted July 26, 2013 You mean you want to set the ped to sitting down? setPedAnimation Link to comment
papam77 Posted July 26, 2013 Author Share Posted July 26, 2013 Yes function MGPED () setElementDimension ( John, 0 ) John = createPed (359.44141, 173.59044, 1008.37262, 90) setPedAnimation( John, "ped", "FF_Sit_Eat1") end addEventHandler ("onResourceStart", getRootElement(), MGPED ) And this doesn't create a ped everything is bad argument. Why ? Link to comment
Baseplate Posted July 26, 2013 Share Posted July 26, 2013 John = createPed (skinid, x, y, z) You forgot to add the skin id. Link to comment
Vision Posted July 26, 2013 Share Posted July 26, 2013 You forgot to put the model ID on first argument. Link to comment
iMr.3a[Z]eF Posted July 26, 2013 Share Posted July 26, 2013 function MGPED () local John = createPed (90, 359.44141, 173.59044, 1008.37262 ) setElementDimension ( John, 0 ) setPedAnimation( John, "ped", "FF_Sit_Eat1") end addEventHandler ("onResourceStart", getRootElement(), MGPED ) Link to comment
Baseplate Posted July 26, 2013 Share Posted July 26, 2013 Try using a timer on setPedAnimation. Link to comment
papam77 Posted July 26, 2013 Author Share Posted July 26, 2013 function MGPED () local John = createPed (90, 359.44141, 173.59044, 1008.37262, -90 ) setElementDimension ( John, 0 ) setElementInterior (John, 3 ) setTimer ( setPedAnimation, 500, 1, John, "ped", "FF_Sit_Eat1") end addEventHandler ("onResourceStart", getRootElement(), MGPED ) Nothing Link to comment
iMr.3a[Z]eF Posted July 26, 2013 Share Posted July 26, 2013 Don't add anything in this code. function MGPED () local John = createPed (ID, 359.44141, 173.59044, 1008.37262 ) setPedAnimation( John, "ped", "FF_Sit_Eat1", 3000) end addEventHandler ("onResourceStart", getRootElement(), MGPED ) ID: The ped skin id press here. Link to comment
DNL291 Posted July 27, 2013 Share Posted July 27, 2013 (edited) Use resourceRoot instead of getRootElement(), unless you want to create the ped when any resource is started. Try: setPedAnimation(John, "ped", "FF_Sit_Eat1", -1, true, false) Edit: You have set the block argument wrong. Try this: function MGPED () local John = createPed (ID, 359.14141, 173.59044, 1008.37262, -90 ) setElementInterior (John, 3 ) setTimer(setPedAnimation, 90, 1, John, "FOOD", "FF_Sit_Eat1", -1, true, false) end addEventHandler ("onResourceStart", resourceRoot, MGPED ) Set the model ID. Edited July 27, 2013 by Guest Link to comment
iMr.3a[Z]eF Posted July 27, 2013 Share Posted July 27, 2013 You've set the timer argument as -1. Link to comment
papam77 Posted July 27, 2013 Author Share Posted July 27, 2013 setPedAnimation is bad argument, so doesn't work. And ped isn't created. 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