Jump to content

Problem with spawnPlayer


papam77

Recommended Posts

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

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

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

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

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

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