Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. That's because you're using the MTA built-on system.. getPlayerAccount getAccountData only works for MTA built-on account system.
  2. That's because it doesn't work that way. Wiki quote: Returns true if the event trigger has been sent, false if invalid arguments were specified.
  3. -- client side: function getLoginData () local nick = guiGetText ( edit ) local pass = guiGetText ( edit2 ) local n=nick local p=pass local i=getPlayerName(localPlayer) triggerServerEvent("getLoginDataServer", localPlayer, n,p,i) outputChatBox("wyslalem") end function destroyLoginWindow() destroyElement(win) showCursor(false) end addEvent("loginapproved",true) addEventHandler("loginapproved", getRootElement(), destroyLoginWindow) -- server side: function logincheck(name,pass,imie) local p=source local account=getPlayerAccount(p) local pass_s=getAccountData(account,"player.pass") local name_s=getAccountData(account,"player.nick") if (name==name_s and pass==pass_s) then outputChatBox("You logged in, welcome back "..imie.." ",p,0,255,0) triggerClientEvent("loginapproved",getRootElement()) else outputChatBox("Wrong password or account name!",p,255,0,0) end end addEvent("getLoginDataServer", true) addEventHandler("getLoginDataServer", getRootElement(), logincheck) Try that.
  4. Castillo

    need help

    Finally you get me, is ok, I know it's hard as I was a newbie before . Now, back on topic. -- client side: ip1 = guiCreateLabel(0.02,0.62,0.94,0.92,"your ip : ",true,tab1) guiLabelSetColor (ip1,255,255,0,220) guiSetFont(ip1,"default-bold-small") ping1 = guiCreateLabel(0.02,0.55,0.94,0.92,"your ping : "..tostring(getPlayerPing(localPlayer)),true,tab1) guiLabelSetColor (ping1,255,255,0,220) guiSetFont(ping1,"default-bold-small") theSerial = getPlayerSerial( thePlayer ) serial1 = guiCreateLabel(0.02,0.68,0.94,0.92,"your serial : "..tostring(getPlayerSerial()),true,tab1) guiLabelSetColor (serial1,255,255,0,220) guiSetFont(serial1,"default-bold-small") name1 = guiCreateLabel(0.02,0.82,0.94,0.92," username : ",true,tab1) guiLabelSetColor (name1,0,255,0,220) guiSetFont(name1,"default-bold-small") theTeam = getPlayerTeam( localPlayer ) if theTeam then teamName = getTeamName(theTeam) else teamName = "N/A" end yourteam = guiCreateLabel(0.02,0.88,0.94,0.92,"yourTeam :"..tostring(teamName),true,tab1) guiLabelSetColor (yourteam,0,255,0,220) guiSetFont(yourteam,"default-bold-small") triggerServerEvent("getIP", getLocalPlayer()) addEvent("returnIP",true) addEventHandler("returnIP",root, function (IP) guiSetText(ip1, "your ip: ".. tostring(IP)) end) -- server side: addEvent("getIP",true) addEventHandler("getIP",root, function () triggerClientEvent(source,"returnIP",source,getPlayerIP(source)) end) This has to work. NOTICE: You must add this resource to the acl.xml, "Admin" group.
  5. Castillo

    need help

    But... after that what? do you think triggerServerEvent does magic? because that's pretty much what I get. After triggerServerEvent, you get the IP in the server side, and then what? acording to your "logic" the rest is done by magic.
  6. Castillo

    need help

    Pretty logic? triggerServerEvent("ip", getPlayerIP()) That's HIGHLY wrong, getPlayerIP is only server side, triggers doesn't work like this!
  7. Castillo

    need help

    Can you post exactly what he has to do in your opinion?
  8. Castillo

    need help

    Dude, you still don't get me, triggerClientEvent is used to SEND INFORMATION TO THE CLIENT SIDE NOT THE SERVER SIDE.
  9. You're welcome. P.S: It may not be the most efficient way though.
  10. Castillo

    need help

    -- client side: addCommandHandler("test", function (_,text) triggerServerEvent("test",localPlayer,text) end) addEvent("returnTest",true) addEventHandler("returnTest",root, function (text) outputChatBox(tostring(text)) end) -- server side: addEvent("test",true) addEventHandler("test",root, function (text) triggerClientEvent(source,"returnTest",source,text) end)
  11. Castillo

    need help

    Oh my god, you still don't get me, HOW IS HE GOING TO SEND IT BACK IF HE DOESN'T USE triggerClientEvent? do you even know what is that function used for?
  12. Castillo

    need help

    Charlie, if he doesn't need it, how's he going to send the IP back to the client side?
  13. 5 Dollars? is that a kind of BAD joke? lol, dude, you're pretty much asking someone to waste his time scripting for you, for only 5 dollars, he could be getting more money in that time.
  14. function updateWantedLevel() for index, player in pairs(getElementsByType("player")) do setPlayerNametagText(player, getPlayerName(player).." [".. getPlayerWantedLevel(player) .."]") end end setTimer(updateWantedLevel,2000,0)
  15. You won't get a FREE scripter like this, if you REALLY want to make a successfull server, I would suggest either paying for a scripter or learning how to script.
  16. /me think's that the MTA dev's will come to this topic, but not for read the suggestion but lock the topic, it's all off-topic now..
  17. No creo que encuentres un scripter gratis, deberias ofrecer dinero.
  18. Castillo

    need help

    That's highly wrong. You need to trigger a event to get the client IP, then add a event handler in the server side for that trigger and then trigger to client side the player IP.
  19. If you really want to speak with the dev's, then you should go to the IRC channel (#mta).
  20. I think that if the MTA Dev's would need money that hard, this would be already implemented.
  21. Castillo

    need help

    ip1 = guiCreateLabel(0.02,0.62,0.94,0.92,"your ip : ",true,tab1) guiLabelSetColor (ip1,255,255,0,220) guiSetFont(ip1,"default-bold-small") ping1 = guiCreateLabel(0.02,0.55,0.94,0.92,"your ping : "..tostring(getPlayerPing(localPlayer)),true,tab1) guiLabelSetColor (ping1,255,255,0,220) guiSetFont(ping1,"default-bold-small") theSerial = getPlayerSerial( thePlayer ) serial1 = guiCreateLabel(0.02,0.68,0.94,0.92,"your serial : "..tostring(getPlayerSerial()),true,tab1) guiLabelSetColor (serial1,255,255,0,220) guiSetFont(serial1,"default-bold-small") name1 = guiCreateLabel(0.02,0.82,0.94,0.92," username : ",true,tab1) guiLabelSetColor (name1,0,255,0,220) guiSetFont(name1,"default-bold-small") --Team theTeam = getPlayerTeam( localPlayer ) if theTeam then teamName = getTeamName(theTeam) else teamName = "N/A" end yourteam = guiCreateLabel(0.02,0.88,0.94,0.92,"yourTeam :"..tostring(teamName),true,tab1) guiLabelSetColor (yourteam,0,255,0,220) guiSetFont(yourteam,"default-bold-small")
  22. Dude, why are you so interested on paying for a server?
  23. object = createObject (2976, 2, 2, 2) function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) if (hitElement and getElementType(hitElement) == "object" and hitElement == object) then destroyElement(hitElement) end end addEventHandler("onClientPlayerWeaponFire", root, onClientPlayerWeaponFireFunc)
×
×
  • Create New...