Jump to content

Table .


Recommended Posts

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) 
  
Link to comment

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) 

Link to comment
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)?

Link to comment
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 )

Link to comment
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 
    } 

Link to comment
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 :?

Link to comment
  
  
  
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 
) 
  

Link to comment
  
  
  
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 -_-.

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