-
Posts
161 -
Joined
-
Last visited
Everything posted by FWCentral
-
Ok i have made a spawn gui that uses a gridlist then when a player clicks the spawn button it checks the gridlist then spawns the player depending on their choice of spawn, All of the spawns work fine apart from one it is police LV it spawns me then i time out every single time and it only happens for this single spawn all the others work fine and there is no error in the script or console anything i can do?
-
Hey all, if there any function that checks if ANY gui windows are open?
-
Thanks JR10 Problem solved! Awesome
-
same line error say Gangs has 5 columns but 2 values were supplied, i don't have any other SQL scripts so why it say there are 5? Thanks again JR10.
-
Thanks JR10 but i got an error: error is on this line, executeSQLInsert ( "Gangs", "'Gangname','Leader'", "'".. gangname .."', '"..sourcename.."'" ) if i type /creategang FWCentral it says DB Query failed table Gangs has no column named FWCentral and if i type /creategang FWC i get the error Query failed table Gangs has no column named FWC It still takes the players money and sets the Element Data correctly.
-
ok so i tried making the creategang command using SQL, i created a database like this : executeSQLCreateTable ( "Gangs", "Gangname TEXT, Leader TEXT" ) This worked fine then for the create command: function creategang(source, commandName, gangname) isgang = getElementData(source,"gang") if isgang then outputChatBox("Your allready in a gang /quitgang first", source, 255, 0, 0) else sourcename = getPlayerName ( source ) local gang = executeSQLSelect ( "Gangs", "Gangname", "Gangname = '" .. gangname .. "'" ) if gang then outputChatBox("This Gang is allready created!", source, 255, 0, 0) else local money = getPlayerMoney(source) if (money > 3000) then takePlayerMoney(source, tonumber(3000)) executeSQLInsert ( "Gangs", "'Gangname'", "'Leader'", "'".. gangname .."'", "'"..sourcename.."'" ) outputChatBox("You have created the "..gangname..".", source, 0, 255, 0) setElementData(source, "gang", gangname) setElementData(source, "Rank", "Leader") end end end end addCommandHandler("creategang", creategang, gangname) It just says to me the gang is already created when it isn't and no errors in the debug either. This is my first time using this SQL please go easy
-
umm how do i delete element data from a player??
-
So keep my method of loading and saving but change the creation of gangs to SQL ok ill try this.
-
Nah it doesn't save the gang, It just saves the element data in the players account then when they reconnect it sets the element data again and when they open the gang gui it goes through the players and checks what players have the element data same as that player and puts the player names in a gridlist it seems to work apart from the create error.
-
Yeah that is correct, but the create script only simply checks the player money, then it takes the player money then sets the players element data into the chosen gang but if the gang is allready created it still puts the player in the gang and i dont know how to stop this.
-
I have made a gang system using element data and the gang saves in the players account and rejoins the player on login but the problem is if a player type /creategang Name then it will put them in the gang even if its allready been created and they are not the leader.
-
Ok thanks for replying, Solution : that script sucked re wrote.
-
Sorry to double post but does nobody know a solution??
-
Thanks for the answers Fixed now thanks.
-
Thanks it works fine, Also what is best to use for a gang system the ACL or Element data?
-
Can onClientGUIClick be used for images? i don't need the code just an answer please.
-
Thanks JR10 solved my problem
-
ok i think this is what you want https://wiki.multitheftauto.com/wiki/TriggerEvent or triggerServerEvent if it is a server function.
-
you mean bindKey ? https://wiki.multitheftauto.com/wiki/BindKey
-
Thanks JR10 i cant test it now ive got work but that looks right and your reply's usually fix most scripts.
-
What you mean use random math? i used random math for the createVehicle, randompos[math.random(1,3)] but this is not the problem it is the randompos[1] = (2514, 2396, 3) i don't think i can use this on it own to get x y z i may need to change it.
-
I want to create random vehicle positions to use to spawn vehicle later but the way i tried does not work randompos = { } randompos[1] = (2514, 2396, 3) randompos[2] = (2133, 1009, 10) randompos[3] = (1674, 988, 10) but i get an error when i start the script?
