Jump to content

Question


TheIceman1

Recommended Posts

Posted

Check on the forum for a example to add all the players in the gridList

Just replace that example with some function where you get all the clans, add it to a table, and done with ipairs(table)

Posted (edited)
Check on the forum for a example to add all the players in the gridList

Just replace that example with some function where you get all the clans, add it to a table, and done with ipairs(table)

This doesnt work.No errors

function setclans () 
local clan = getElementData ( localPlayer, "clan" ) 
    for _, playerclan in ipairs (clan) do 
            local rowc = guiGridListAddRow ( GUIEditor_Grid[3] ) 
            guiGridListSetItemText ( GUIEditor_Grid[4], rowc, GUIEditor_Column[5], playerclan, false, false ) 
end 
end 
addCommandHandler ( "clans", setclans ) 

Edited by Guest

Need paid scripter just pm me i will accept every job!

Posted
for _, playerclan in ipairs (clan) do 

"clan" is a table?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Are you sure about that? show us where do you set the "clan" element data.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Here:

  
function createclan() 
local clan = guiGetText ( GUIEditor_Edit[1] ) 
setElementData ( localPlayer, "clan", clan ) 
 triggerServerEvent ( "createclan",localPlayer) 
    exports ["guimessages"] : outputClient ( "You create "..clan.." clan!", 255, 255, 0 ) 
end 
end 
addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], createclan ) 

Need paid scripter just pm me i will accept every job!

Posted

That's not a table, is a string.

You are trying to get all clans that are currently playing on the server?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Where are you storing these clans?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
function createclan() 
setAccountData ( acc, "Clan", getElementData ( source, "clan" ) ) 
end 
addEvent ( "createclan", true ) 
addEventHandler ( "createclan", root, createclan ) 

Need paid scripter just pm me i will accept every job!

Posted

That's a problem, since you'll have to loop all accounts to get their clan data, then add them, and avoid adding duplicates.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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