Jump to content

mover a player a un team no definido


Plate

Recommended Posts

Hola tengo un problema con un mi script que me ayudo alex pero me da bad argument en getTeamFromName y en guiGridListGetItemText

client

function deteam() 
local team = guiGridListGetItemText(teamList, row, columnA) 
triggerServerEvent("Move", getLocalPlayer(), team) 
end 
addEventHandler("onClientGUIClick", mover, deteam, false) 

server

function setTeam(player, teamName) 
local theTeam = getTeamFromName ( teamName ) 
        if ( theTeam ) then 
setPlayerTeam ( player , theTeam ) 
end 
end 
addEvent("Move", true) 
addEventHandler("Move",getRootElement(), setTeam) 

Link to comment
function deteam ( ) 
    local row, col = guiGridListGetSelectedItem ( teamList ) 
    if ( row and col and row ~= -1 and col ~= -1 ) then 
        local team = guiGridListGetItemText ( teamList, row, columnA ) 
        triggerServerEvent ( "Move", localPlayer, localPlayer, team ) 
    end 
end 
addEventHandler ( "onClientGUIClick", mover, deteam, false ) 

Link to comment

Me da bad argument en getTeamFromName

server

function borro() 
local theTeam = getTeamFromName ( teamName ) 
        if ( theTeam ) then 
destroyElement(theTeam) 
end 
end 
addEvent("borro", true) 
addEventHandler("borro", getRootElement(), borro) 

client

function borr ( ) 
    local row, col = guiGridListGetSelectedItem ( teamList ) 
    if ( row and col and row ~= -1 and col ~= -1 ) then 
        local team = guiGridListGetItemText ( teamList, row, columnA ) 
        triggerServerEvent ( "borro", localPlayer, localPlayer, team ) 
    end 
end 
addEventHandler ( "onClientGUIClick", borrar, borr, false ) 

Link to comment
function borro(teamName) 
local theTeam = getTeamFromName ( teamName ) 
        if ( theTeam ) then 
destroyElement(theTeam) 
end 
end 
addEvent("borro", true) 
addEventHandler("borro", getRootElement(), borro) 

function borr ( ) 
    local row, col = guiGridListGetSelectedItem ( teamList ) 
    if ( row and col and row ~= -1 and col ~= -1 ) then 
        local team = guiGridListGetItemText ( teamList, row, columnA ) 
        triggerServerEvent ( "borro", root, team ) 
    end 
end 
addEventHandler ( "onClientGUIClick", borrar, borr, false ) 

Link to comment
  
            guiGridListClear ( teamList ) 
for id, team in ipairs(getElementsByType("team")) do 
    local row = guiGridListAddRow ( teamList ) 
    guiGridListSetItemText ( teamList, row, columnA, getTeamName ( team ), false, false ) 
    guiGridListSetItemColor ( teamList, row, columnA, getTeamColor ( team ) ) 
end 

Link to comment
  
            guiGridListClear ( teamList ) 
for id, team in ipairs(getElementsByType("team")) do 
    local row = guiGridListAddRow ( teamList ) 
    guiGridListSetItemText ( teamList, row, columnA, getTeamName ( team ), false, false ) 
    guiGridListSetItemColor ( teamList, row, columnA, getTeamColor ( team ) ) 
end 

Si esta todo bien puesto, deberia funcionar.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...