-
Posts
108 -
Joined
-
Last visited
About Dannz0r
- Birthday 23/05/1996
Details
-
Gang
FOTL
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Dannz0r's Achievements
Punk-@ss B*tch (12/54)
0
Reputation
-
So I have this Roleplay script I started to make from scratch and I have a panel where you press on a 'Team' and when you press select button it sends you to that team, but there is a small problem, if you don't choose a team and just press the button then it just closes the window and your ped is in the same place and not in any team, so I tried to fix it by doing this Client-side function stupidBUG() guiSetVisible(JobsWin, true) showCursor(true) outputChatBox ( "RP: Select a team!", player, 255, 0, 0 ) end addEvent( "blahBlahBlah", true ) addEventHandler( "blahBlahBlah", getRootElement(), stupidBUG ) Server-side addEvent ( "onPlayerChooseTeam" , true ) addEventHandler ( "onPlayerChooseTeam" , root , function ( teamName ) local playerTeam = getPlayerTeam ( source ) -- Check if the player is on a team if playerTeam then -- this player is on a team, so we can remove them from it local oldTeamName = getTeamName ( playerTeam ) else triggerClientEvent ( player, "blahBlahBlah", getRootElement() ) end end) But now the problem is, it will give me error on line 8 (server-side) that string is needed, got a nil, but if I remove 'player' it works but then it triggers the event to the whole server not just that 1 player. how can I fix it?
-
Where? (Sorry for off topic) I don't do free advertisements
-
Maybe go down with the price, I can get a domain for 1 year with 3 EUR and I choose my own name.
-
No1Servers.com - Quality hosting at epic prices!
Dannz0r replied to Cameron's topic in Hosting solutions
No offence but your server lags bad, not sure if its because of no1servers or your scripts/maps but it does lag. Lags for you (: With a Intel® Core i5-2410M CPU @ 2.30 GHz 2.30 GHz 2 GB Ram I don't think MTA will lag for me. -
We offer good hosting and good prices too. Check it here viewtopic.php?f=116&t=35979
-
@ Jexkid Mate after I seen your replys I asked myself "Why are you talking about mature and immature" a part of being mature is by avoiding arguments and if I look at you talking about being mature I start laughing, well the most important thing is that your saying if you're not 16 you're not mature, mate I have a friend that's 14 years old and is more mature than most of the people on this community. @ Benxamix2 I agree with you, PayPal says you have to be 18+ but they never check or do anything about it so does http://pornhub.com/ and http://redtube.com/ you have to be 18+ but with a simple click on the button "I am" its fine they won't check so this U18 and U16 things are mostly for fun, when I was 16 I went to a 18+ movie at cinema in UK and they never checked my ID or how old I am (Not only once lodes of times) and I still do and I'm 17 btw I have friends with Credit Card and they are U16
-
No1Servers.com - Quality hosting at epic prices!
Dannz0r replied to Cameron's topic in Hosting solutions
No offence but your server lags bad, not sure if its because of no1servers or your scripts/maps but it does lag. -
serverFFS sucks, they always did and they don't even give a shit about your server, all they do is make sure your money is sent to their paypal, I was hosted by them, I was asking for help they was ignoring my tickets so I asked for my money back they ignored it again. Most of the hosting company's this days goes crazy that's why I prefer to host my server with my computer than give money and get more pissed off.
-
Well I have 2 GUI Windows that pops-up but I only want 1 to pop-up at one time, so I want my Login+Register window to pop-up with in a black background and after the player pressed the button to login or register I want the second GUI Window to pop-up in a 'CameraMatrix' position that I choose, here is the 'client' and 'server' side of both scripts. Login/Register Client: x,y = guiGetScreenSize() fadeCamera(true, 6, 0, 0, 0) setCameraMatrix(-1475.5, 831.18, 65.5, -1487.5, 800.18, 65.5) LoginWin = guiCreateWindow(x/1.37 - 125,y/3 - 100,280,350,"Login and Register | Panel",false) guiWindowSetMovable ( LoginWin, false ) guiWindowSetSizable ( LoginWin, false ) TabPanel = guiCreateTabPanel(0,20,260,152,false,LoginWin) TabLogin = guiCreateTab("Login | Panel",TabPanel) LblUsername = guiCreateLabel(80,13,300,16,"Nickname:",false,TabLogin) LoginUsername = guiCreateEdit(46,40,171,21,"",false,TabLogin) LblPassword = guiCreateLabel(110,72,70,16,"Password:",false,TabLogin) LoginPassword = guiCreateEdit(46,98,171,21,"",false,TabLogin) guiEditSetMasked(LoginPassword,true) TabRegister = guiCreateTab("Register | Panel",TabPanel) LblRegisterUsername = guiCreateLabel(10,4,300,16,"Nickname:",false,TabRegister) EditRegisterUsername = guiCreateEdit(46,22,171,21,"",false,TabRegister) LblRegisterPassword = guiCreateLabel(10,44,150,16,"Password:",false,TabRegister) EditRegisterPassword = guiCreateEdit(46,61,171,21,"",false,TabRegister) guiEditSetMasked(EditRegisterPassword,true) LblRegisterName = guiCreateLabel(10,83,150,16,"Real name:",false,TabRegister) EditRegisterName = guiCreateEdit(46,100,171,21,"",false,TabRegister) BtnAction = guiCreateButton(0,180,260,25,"Login or Register",false,LoginWin) guiSetVisible(LoginWin, false) logo = guiCreateStaticImage(0,217,260,120,"images/logo.png",false,LoginWin) local localPlayer = getLocalPlayer() function receiveVars( allow, name) local playername = getPlayerName(localPlayer) guiSetText(LoginUsername, "") guiSetText(EditRegisterUsername, "") if (name == "false") then guiSetVisible(LblRegisterName, false) guiSetVisible(EditRegisterName, false) end if (allow == "false") then guiDeleteTab(TabRegister, TabPanel) end guiSetSelectedTab(TabPanel, TabLogin) guiSetText(LoginUsername, playername) guiSetText(EditRegisterUsername, playername) guiSetVisible(LoginWin, true) guiBringToFront(LoginWin) guiSetInputEnabled(true) showCursor(true) end addEvent( "onSendVars", true ) addEventHandler( "onSendVars", getRootElement(), receiveVars ) function windowHandler() triggerServerEvent("onNeedVars", getLocalPlayer()) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler) function onClickBtn(button, state) if(button == "left" and state == "up") then if(source == BtnAction) then if(guiGetSelectedTab(TabPanel) == TabLogin) then triggerServerEvent("on4XLogin", getRootElement(), localPlayer, guiGetText(LoginUsername), guiGetText(LoginPassword)) else triggerServerEvent("on4XRegister", getRootElement(), localPlayer, guiGetText(EditRegisterUsername), guiGetText(EditRegisterPassword), guiGetText(EditRegisterName)) end end end end function hideLoginWindow() guiSetInputEnabled(false) guiSetVisible(LoginWin, false) end addEvent("hideLoginWindow", true) addEventHandler("onClientGUIClick", BtnAction, onClickBtn, false) addEventHandler("hideLoginWindow", getRootElement(), hideLoginWindow) Login/Register Server: function on4XLogin ( player, user, pass ) local account = getAccount ( user, pass ) if ( account ~= false ) then if ( not isGuestAccount ( account ) ) then -- For every player that's logged in.... logOut ( player ) -- Log them out. end if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else outputChatBox ( "Wrong username or password!", player, 255, 255, 0 ) -- Output they got the details wrong. end end addEvent( "on4XLogin", true ) addEventHandler( "on4XLogin", getRootElement(), on4XLogin ) function on4XRegister ( player, user, pass, name ) local account = getAccount ( user, pass ) if ( account ~= false ) then if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end else account = addAccount ( user, pass ) setAccountData ( account, "name", name) if (logIn ( player, account, pass ) == true) then triggerClientEvent ( player, "hideLoginWindow", getRootElement()) else outputChatBox ( "Register/Login error!", player, 255, 255, 0 ) -- Output they got the details wrong. end end end addEvent( "on4XRegister", true ) addEventHandler( "on4XRegister", getRootElement(), on4XRegister ) function needVars() local allow_register = get("allow_register") local name_on_register = get("name_on_register") triggerClientEvent(source, "onSendVars", getRootElement(), allow_register, name_on_register) end addEvent("onNeedVars", true) addEventHandler("onNeedVars", getRootElement(), needVars) Team selection Client: --[[Panel created by: [FOTL]Danny]]-- --[[On 17th August 2011]]-- x,y = guiGetScreenSize() JobsWin = guiCreateWindow(x/3 - 170,y/3 - 20,200,320,"Team selection | Panel",false) teamsList = guiCreateGridList(0,22,186,255,false,JobsWin) column = guiGridListAddColumn( teamsList, "Teams", 0.85 ) for id, team in ipairs(getElementsByType("team")) do local row = guiGridListAddRow ( teamsList ) guiGridListSetItemText ( teamsList, row, 1, getTeamName ( team ), false, false ) guiGridListSetItemColor ( teamsList, row, 1, getTeamColor ( team ) ) end guiWindowSetMovable ( teamsList, false ) guiWindowSetMovable ( JobsWin, false ) guiWindowSetSizable ( teamsList, false ) guiWindowSetSizable ( JobsWin, false ) send = guiCreateButton(0,285,90,25,"Select",false,JobsWin) CloseButton = guiCreateButton(105,285,90,25,"Close",false,JobsWin) guiSetVisible(JobsWin, true) showCursor(true) setTimer ( showingTeams, 1000, 1) function close() if source == CloseButton then guiSetVisible(JobsWin, false) showCursor(false) end end addEventHandler ( "onClientGUIClick", root, function ( button ) if button == "left" then if source == send then local row, col = guiGridListGetSelectedItem ( teamsList ) local teamName = guiGridListGetItemText ( teamsList, row, col ) triggerServerEvent ( "onPlayerChooseTeam", getLocalPlayer(), teamName ) end end end) addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), close) addEvent ( "onPlayerChooseTeam" , true ) addEventHandler ( "onPlayerChooseTeam" , root , function ( teamName ) local team = getTeamFromName ( teamName ) setPlayerTeam ( source , team ) outputChatBox("You have successfully choosed "..getTeamName(team).." team.", resPlayer, root, 0, 255, 0) end )
-
Dont get it why everyone is complainings, I have: - AMD Athlon 64 X2 Dual-Core Processor TK-53 1.70 GHz - 2 GB RAM And in MTA 1.0.5 I have 25-30 fps, and in 1.1 I have 30-35, for me the lags are better.
-
Thank you, its working fine. Everything is perfect.
-
Can you make something like when player pressed select and it put him on a team to spawn him in a position? dont put the position just put the x/z/y thing give me code I do the rest please.
-
Someone helped me now it shows the teams now I only need help when you select a team and click the button to set him on that team.