iPrestege Posted April 4, 2013 Posted April 4, 2013 Hello Why This One Not Work? No Error's! Client? local GroveIDs = {105,106,107} function TeamName() local screenWidth, screenHeight = guiGetScreenSize ( ) if ( GroveIDs [ getElementModel ( Ped ) ] ) then dxDrawText("Grove",screenHeight - 30, screenWidth) end end addEventHandler("onClientRender",root,TeamName)
iPrestege Posted April 4, 2013 Author Posted April 4, 2013 Nothing : local GroveIDs = {105,106,107} function TeamName() local screenWidth, screenHeight = guiGetScreenSize ( ) if ( GroveIDs [ getElementModel ( Ped ) ] ) then r dxDrawText("Grove",screenHeight - 30, screenWidth) else return false; end end addEventHandler("onClientRender",root,TeamName)
DiSaMe Posted April 4, 2013 Posted April 4, 2013 If Ped is defined, then it probably works fine - it correctly draws the text outside the screen You use screen width as Y coordinate and that is under the bottom of the screen.
Ludo Posted April 4, 2013 Posted April 4, 2013 local GroveIDs = {105,106,107} function TeamName() local screenWidth, screenHeight = guiGetScreenSize ( ) if ( GroveIDs [ getElementModel ( Ped ) ] ) then dxDrawText("Grove",screenHeight - 30, screenWidth) end end addEventHandler("onClientRender",root,TeamName) Where to you define that "Ped" (in the "if" line)?
iPrestege Posted April 4, 2013 Author Posted April 4, 2013 If Ped is defined, then it probably works fine - it correctly draws the text outside the screen You use screen width as Y coordinate and that is under the bottom of the screen. @ Ludo and CrystalMV : and about screen position on the dx i change it to another one but not work too? Ped = createPed ( 105, -69.668449401855,1363.7633056641,1080.2109375 , -90 )
Castillo Posted April 4, 2013 Posted April 4, 2013 I just noticed, your table is wrong, use this: local GroveIDs = { [ 105 ] = true, [ 106 ] = true, [ 107 ] = true }
iPrestege Posted April 4, 2013 Author Posted April 4, 2013 I just noticed, your table is wrong, use this: local GroveIDs = { [ 105 ] = true, [ 106 ] = true, [ 107 ] = true } Great thank's!
Booo Posted April 4, 2013 Posted April 4, 2013 Hello Why This One Not Work? No Error's!Client? local GroveIDs = {105,106,107} function TeamName() local screenWidth, screenHeight = guiGetScreenSize ( ) if ( GroveIDs [ getElementModel ( Ped ) ] ) then dxDrawText("Grove",screenHeight - 30, screenWidth) end end addEventHandler("onClientRender",root,TeamName) local GroveIDs = {105,106,107} function TeamName() local screenWidth, screenHeight = guiGetScreenSize ( ) if getElementModel ( Ped ) == GroveIDs[1] or GroveIDs[2] or GroveIDs[3] then dxDrawText("Grove",screenHeight - 30, screenWidth) end end addEventHandler("onClientRender",root,TeamName) or I just noticed, your table is wrong, use this: local GroveIDs = { [ 105 ] = true, [ 106 ] = true, [ 107 ] = true }
iPrestege Posted April 4, 2013 Author Posted April 4, 2013 Hello Why This One Not Work? No Error's!Client? local GroveIDs = {105,106,107} function TeamName() local screenWidth, screenHeight = guiGetScreenSize ( ) if ( GroveIDs [ getElementModel ( Ped ) ] ) then dxDrawText("Grove",screenHeight - 30, screenWidth) end end addEventHandler("onClientRender",root,TeamName) local GroveIDs = {105,106,107} function TeamName() local screenWidth, screenHeight = guiGetScreenSize ( ) if getElementModel ( Ped ) == GroveIDs[1] or GroveIDs[2] or GroveIDs[3] then dxDrawText("Grove",screenHeight - 30, screenWidth) end end addEventHandler("onClientRender",root,TeamName) or I just noticed, your table is wrong, use this: local GroveIDs = { [ 105 ] = true, [ 106 ] = true, [ 107 ] = true } Thank's but SolidSnake way easy can you help me in this? server : local GroveIDs = { [ 105 ] = true, [ 106 ] = true, [ 107 ] = true } addEvent("SpawnWar",true) addEventHandler("SpawnWar",root, function ( Ped ) if ( GroveIDs [ Ped ] ) then spawnPlayer(source,2485,-1667,13.34375,90,Ped,0,20,getTeamFromName("Grove Street")) end; end ) client : triggerServerEvent ( "SpawnWar",localPlayer,getElementModel ( Ped )) No errors and give me all arguments but not spawn the player
iPrestege Posted April 4, 2013 Author Posted April 4, 2013 Expected argument 6 got number "106" ? and i don't understand what you mean " checking what "ped" returns " can you show me how to do it ._. ?
Booo Posted April 4, 2013 Posted April 4, 2013 local GroveIDs = { [ 105 ] = true, [ 106 ] = true, [ 107 ] = true } addEvent("SpawnWar",true) addEventHandler("SpawnWar",root, function ( Ped ) if ( GroveIDs [ Ped ] ) then local asd = getTeamFromName("Grove Street") if asd then spawnPlayer(source,2485,-1667,13.34375,90,tonumber(Ped),0,20,asd) end; end end )
iPrestege Posted April 4, 2013 Author Posted April 4, 2013 local GroveIDs = { [ 105 ] = true, [ 106 ] = true, [ 107 ] = true } addEvent("SpawnWar",true) addEventHandler("SpawnWar",root, function ( Ped ) if ( GroveIDs [ Ped ] ) then local asd = getTeamFromName("Grove Street") if asd then spawnPlayer(source,2485,-1667,13.34375,90,tonumber(Ped),0,20,asd) end; end end ) I try it and not work and i know this make no sense before take it .
Booo Posted April 4, 2013 Posted April 4, 2013 I try it and not work and i know this make no sense before take it . fadeCamera(source, true) ?
iPrestege Posted April 4, 2013 Author Posted April 4, 2013 I try it and not work and i know this make no sense before take it . fadeCamera(source, true) ? no i can see the sky only .
iPrestege Posted April 4, 2013 Author Posted April 4, 2013 You must also use: setCameraTarget Where are you from time ago Thank you for this, that succeeded with me! Work's!
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