-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
It's easy, just create a server side script and cancel the event handler I posted before with cancelEvent.
-
You're using the same condition for each 'elseif'.
-
Cancel the event onPlayerChangeNick.
-
Depende de lo que se te de la gana, puede ser lo que vos quieras.
-
Copy the code again, I think it should work now.
-
I've found your problem, you was using "CheckBox" but it was "Checkbox". Copy the code again.
-
Try this: GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(214,198,427,231,"GUI Cambiar Pass",false) GUIEditor_Label[1] = guiCreateLabel(29,54,103,24,"Vieja Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],0, 0, 190) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(137,51,179,26,"",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(29,101,103,24,"Nueva Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],0,0,190) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[2] = guiCreateEdit(137,92,179,26,"",false,GUIEditor_Window[1]) guiEditSetMaxLength(GUIEditor_Edit[2],10) GUIEditor_Image[1] = guiCreateStaticImage(27,178,94,42,"images/BAT.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(126,175,82,45,"images/shruk.png",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(324,91,91,35,"Aceptar",false,GUIEditor_Window[1]) guiSetEnabled(GUIEditor_Button[1],false) GUIEditor_Button[2] = guiCreateButton(325,49,74,35,"Cancelar",false,GUIEditor_Window[1]) GUIEditor_Checkbox[1] = guiCreateCheckBox(30,150,359,20,"Acepto Las Condiciones y Terminos de Uso de este Servidor",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[1],"default-small") GUIEditor_Label[3] = guiCreateLabel(29,54,103,24,"Old Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],0,0,190) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Label[4] = guiCreateLabel(29,101,103,24,"New Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],0,0,190) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(325,49,74,35,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(324,91,91,35,"Accept",false,GUIEditor_Window[1]) guiSetEnabled(GUIEditor_Button[4],false) GUIEditor_Checkbox[2] = guiCreateCheckBox(30,150,359,20,"I accept the conditions and terms of use of this server",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[2],"default-small") GUIEditor_Label[5] = guiCreateLabel(219,181,198,24,"GUI CopyRight 2012 (c) by ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255, 255, 0) guiSetFont(GUIEditor_Label[5],"default-bold-small") guiSetVisible ( GUIEditor_Window[1], false ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Image[1] ) then guiSetVisible ( GUIEditor_Label[1], true ) guiSetVisible ( GUIEditor_Label[2], true ) guiSetVisible ( GUIEditor_Label[3], false ) guiSetVisible ( GUIEditor_Label[4], false ) guiSetVisible ( GUIEditor_Checkbox[1], true ) guiSetVisible ( GUIEditor_Checkbox[2], false ) guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) guiSetVisible ( GUIEditor_Button[3], false ) guiSetVisible ( GUIEditor_Button[4], false ) elseif ( source == GUIEditor_Image[2] ) then guiSetVisible ( GUIEditor_Label[3], true ) guiSetVisible ( GUIEditor_Label[4], true ) guiSetVisible ( GUIEditor_Label[1], false ) guiSetVisible ( GUIEditor_Label[2], false ) guiSetVisible ( GUIEditor_Checkbox[2], true ) guiSetVisible ( GUIEditor_Checkbox[1], false ) guiSetVisible ( GUIEditor_Button[3], true ) guiSetVisible ( GUIEditor_Button[4], true ) guiSetVisible ( GUIEditor_Button[1], false ) guiSetVisible ( GUIEditor_Button[2], false ) elseif ( source == GUIEditor_Button[2] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) elseif ( source == GUIEditor_Checkbox[1] ) then guiSetEnabled ( GUIEditor_Button[1], guiCheckBoxGetSelected ( source ) ) elseif ( source == GUIEditor_Checkbox[2] ) then guiSetEnabled ( GUIEditor_Button[4], guiCheckBoxGetSelected ( source ) ) elseif ( source == GUIEditor_Button[3] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) end end ) changepassmarket = createMarker (273.19537, -158.01585, 0, "cylinder", 3, 255, 0, 0, 100) car1 = createBlip ( 273.19537, -158.01585, 1.74052,35,2,0,0,0,0,0,180 ) function markerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor_Window[1], true) showCursor (true) end end addEventHandler ("onClientMarkerHit", changepassmarket, markerHit) addEventHandler ( "onClientPlayerDamage", root, function ( ) if ( isElementWithinMarker ( localPlayer, changepassmarket ) ) then setElementHealth ( localPlayer, 100 ) end end ) function clientSubmitChangepw(button, state) if button == "left" and state == "up" then local oldpassword = guiGetText(GUIEditor_Edit[1]) local newpassword = guiGetText(GUIEditor_Edit[2]) if oldpassword and newpassword then triggerServerEvent("submitChangepw", getRootElement(), localPlayer, oldpassword, newpassword) else outputChatBox("Pon Tu vieja Contraseña y Tu Nueva Contraseña.") end end end addEventHandler( "onClientGUIClick", GUIEditor_Button[1], clientSubmitChangepw, false)
-
That text is wrong, the script is checking if the password is at least 10 characters length.
-
viewtopic.php?f=91&t=41314&start=15 There's one, you can take it as a example.
-
Copy the code again.
-
http://lua.gts-stolberg.de/en/schleifen.php No tiene porque ser "for i,v" puede ser: for codigo, texto
-
You're welcome.
-
local pairsTable = { ["h"] = "Hello", ["w"] = "World!" } for code, text in pairs ( pairsTable ) do outputChatBox ( code ..": ".. text ) end
-
GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(214,198,427,231,"GUI Cambiar Pass",false) GUIEditor_Label[1] = guiCreateLabel(29,54,103,24,"Vieja Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],0, 0, 190) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(137,51,179,26,"",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(29,101,103,24,"Nueva Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],0,0,190) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[2] = guiCreateEdit(137,92,179,26,"",false,GUIEditor_Window[1]) guiEditSetMaxLength(GUIEditor_Edit[2],10) GUIEditor_Image[1] = guiCreateStaticImage(27,178,94,42,"images/BAT.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(126,175,82,45,"images/shruk.png",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(324,91,91,35,"Aceptar",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(325,49,74,35,"Cancelar",false,GUIEditor_Window[1]) GUIEditor_Checkbox[1] = guiCreateCheckBox(30,150,359,20,"Acepto Las Condiciones y Terminos de Uso de este Servidor",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[1],"default-small") GUIEditor_Label[3] = guiCreateLabel(29,54,103,24,"Old Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],0,0,190) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Label[4] = guiCreateLabel(29,101,103,24,"New Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],0,0,190) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(325,49,74,35,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(324,91,91,35,"Acept",false,GUIEditor_Window[1]) GUIEditor_Checkbox[2] = guiCreateCheckBox(30,150,359,20,"I accept the conditions and terms of use of this server",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[2],"default-small") GUIEditor_Label[5] = guiCreateLabel(219,181,198,24,"GUI CopyRight 2012 (c) by ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255, 255, 0) guiSetFont(GUIEditor_Label[5],"default-bold-small") guiSetVisible ( GUIEditor_Window[1], false ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Image[1] ) then guiSetVisible ( GUIEditor_Label[1], true ) guiSetVisible ( GUIEditor_Label[2], true ) guiSetVisible ( GUIEditor_Label[3], false ) guiSetVisible ( GUIEditor_Label[4], false ) guiSetVisible ( GUIEditor_Checkbox[1], true ) guiSetVisible ( GUIEditor_Checkbox[2], false ) guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) guiSetVisible ( GUIEditor_Button[3], false ) guiSetVisible ( GUIEditor_Button[4], false ) elseif ( source == GUIEditor_Image[2] ) then guiSetVisible ( GUIEditor_Label[3], true ) guiSetVisible ( GUIEditor_Label[4], true ) guiSetVisible ( GUIEditor_Label[1], false ) guiSetVisible ( GUIEditor_Label[2], false ) guiSetVisible ( GUIEditor_Checkbox[2], true ) guiSetVisible ( GUIEditor_Checkbox[1], false ) guiSetVisible ( GUIEditor_Button[3], true ) guiSetVisible ( GUIEditor_Button[4], true ) guiSetVisible ( GUIEditor_Button[1], false ) guiSetVisible ( GUIEditor_Button[2], false ) elseif ( source == GUIEditor_Button[2] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) elseif ( source == GUIEditor_Button[3] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) end end ) changepassmarket = createMarker (273.19537, -158.01585, 0, "cylinder", 3, 255, 0, 0, 100) car1 = createBlip ( 273.19537, -158.01585, 1.74052,35,2,0,0,0,0,0,180 ) function markerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor_Window[1], true) showCursor (true) end end addEventHandler ("onClientMarkerHit", changepassmarket, markerHit) addEventHandler ( "onClientPlayerDamage", root, function ( ) if ( isElementWithinMarker ( localPlayer, changepassmarket ) ) then setElementHealth ( localPlayer, 100 ) end end ) That'll check if the player is on the marker, if so, it'll cancel the damage.
-
No entiendo de que estas hablando.
-
You can just make it all client side: GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(214,198,427,231,"GUI Cambiar Pass",false) GUIEditor_Label[1] = guiCreateLabel(29,54,103,24,"Vieja Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],0, 0, 190) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(137,51,179,26,"",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(29,101,103,24,"Nueva Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],0,0,190) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[2] = guiCreateEdit(137,92,179,26,"",false,GUIEditor_Window[1]) guiEditSetMaxLength(GUIEditor_Edit[2],10) GUIEditor_Image[1] = guiCreateStaticImage(27,178,94,42,"images/BAT.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(126,175,82,45,"images/shruk.png",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(324,91,91,35,"Aceptar",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(325,49,74,35,"Cancelar",false,GUIEditor_Window[1]) GUIEditor_Checkbox[1] = guiCreateCheckBox(30,150,359,20,"Acepto Las Condiciones y Terminos de Uso de este Servidor",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[1],"default-small") GUIEditor_Label[3] = guiCreateLabel(29,54,103,24,"Old Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],0,0,190) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Label[4] = guiCreateLabel(29,101,103,24,"New Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],0,0,190) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(325,49,74,35,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(324,91,91,35,"Acept",false,GUIEditor_Window[1]) GUIEditor_Checkbox[2] = guiCreateCheckBox(30,150,359,20,"I accept the conditions and terms of use of this server",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[2],"default-small") GUIEditor_Label[5] = guiCreateLabel(219,181,198,24,"GUI CopyRight 2012 (c) by ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255, 255, 0) guiSetFont(GUIEditor_Label[5],"default-bold-small") guiSetVisible ( GUIEditor_Window[1], false ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Image[1] ) then guiSetVisible ( GUIEditor_Label[1], true ) guiSetVisible ( GUIEditor_Label[2], true ) guiSetVisible ( GUIEditor_Label[3], false ) guiSetVisible ( GUIEditor_Label[4], false ) guiSetVisible ( GUIEditor_Checkbox[1], true ) guiSetVisible ( GUIEditor_Checkbox[2], false ) guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) guiSetVisible ( GUIEditor_Button[3], false ) guiSetVisible ( GUIEditor_Button[4], false ) elseif ( source == GUIEditor_Image[2] ) then guiSetVisible ( GUIEditor_Label[3], true ) guiSetVisible ( GUIEditor_Label[4], true ) guiSetVisible ( GUIEditor_Label[1], false ) guiSetVisible ( GUIEditor_Label[2], false ) guiSetVisible ( GUIEditor_Checkbox[2], true ) guiSetVisible ( GUIEditor_Checkbox[1], false ) guiSetVisible ( GUIEditor_Button[3], true ) guiSetVisible ( GUIEditor_Button[4], true ) guiSetVisible ( GUIEditor_Button[1], false ) guiSetVisible ( GUIEditor_Button[2], false ) elseif ( source == GUIEditor_Button[2] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) elseif ( source == GUIEditor_Button[3] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) end end ) changepassmarket = createMarker (273.19537, -158.01585, 0, "cylinder", 3, 255, 0, 0, 100) car1 = createBlip ( 273.19537, -158.01585, 1.74052,35,2,0,0,0,0,0,180 ) function markerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor_Window[1], true) showCursor (true) end end addEventHandler ("onClientMarkerHit", changepassmarket, markerHit)
-
--------------------------- -- Profile --------------------------- ProfileW = guiCreateWindow(497,155,345,471,"",false) ProfileN = guiCreateLabel(16,114,300,16,"Name:",false,ProfileW) ProfileMS = guiCreateLabel(16,139,300,16,"Member Since: ",false,ProfileW) Line1 = guiCreateLabel(14,162,317,18,"_____________________________________________",false,ProfileW) guiLabelSetColor(Line1,0,255,0) ProfileK = guiCreateLabel(16,190,300,16,"Kills:",false,ProfileW) ProfileHS = guiCreateLabel(38,215,300,16,"Headshots: ",false,ProfileW) ProfileD = guiCreateLabel(16,239,300,16,"Deaths: ",false,ProfileW) ProfileT = guiCreateLabel(16,294,300,16,"Team: ",false,ProfileW) Line2 = guiCreateLabel(14,264,317,18,"_____________________________________________",false,ProfileW) guiLabelSetColor(Line2,0,255,0) Exp = guiCreateLabel(16,322,300,16,"Experience: ",false,ProfileW) ButtonPX = guiCreateButton(273,435,63,26,"X",false,ProfileW) guiWindowSetSizable(ProfileW,false) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(ProfileW,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(ProfileW,x,y,false) guiSetVisible(ProfileW, false) function nProfile() if guiGetVisible(ProfileW) == true then guiSetVisible(ProfileW, false) removeEventHandler("onClientGUIClick", ButtonPX, closeManualP) else guiSetVisible(ProfileW, true) setTimer(Data,1000,1) addEventHandler("onClientGUIClick", ButtonPX, closeManualP) end end function closeManualP() guiSetVisible(ProfileW, false) removeEventHandler("onClientRender", root, Data) end function Data() triggerServerEvent("DataS", localPlayer) end addEvent("DataC",true) addEventHandler("DataC", root, function( joinedOn, exppoints ) guiSetText ( ProfileMS, "Member Since: " .. joinedOn ) guiSetText ( Exp, "Experience: ".. exppoints or 0 ) end ) addEvent("DataS",true) addEventHandler("DataS",root, function() local pAccount = getPlayerAccount ( source ) local joinedOn = getAccountData( pAccount, "player.member" ) local exppoints = exports.exp:getPlayerEXP( source ) triggerClientEvent( source, "DataC", source, joinedOn, exppoints ) end )
-
No, yo te di dos ejemplos .
-
addEvent("register",true) addEventHandler("register",getRootElement(), function(thePlayer, NameR, PassR, Confirm) if not (NameR == "") then if not (PassR == "") then if not (Confirm == "") then if PassR == Confirm then local account = getAccount (NameR,PassR) if (account == false) then local accountAdded = addAccount(tostring(NameR),tostring(PassR)) if (accountAdded) then outputChatBox ("You've successfully registred! [Name: " .. NameR .. "| Password: " .. PassR .. "]",thePlayer,0,255,0,true ) local realTime = getRealTime() local rTime = string.format("%02d:%02d", realTime.hour, realTime.minute ) local rDate = string.format("%04d/%02d/%02d", realTime.year + 1900, realTime.month + 1, realTime.monthday ) setAccountData( accountAdded, "player.member", rDate .." - ".. rTime) setTimer(outputChatBox,800,1,"Try to login now! Remember this information to login!",thePlayer,0,255,0,true ) else outputChatBox ("ERROR: Please use another Name/Password.",thePlayer,255,0,0,true) end else outputChatBox ("ERROR: A player with that name already exist.",thePlayer,255,0,0,true) end else outputChatBox ("ERROR: The passwords don't match.",thePlayer,255,0,0,true) end else outputChatBox ("ERROR: Please confirm your password.",thePlayer,255,0,0,true) end else outputChatBox ("ERROR: Please put a password.",thePlayer,255,0,0,true) end else outputChatBox ("ERROR: Please put a name.",thePlayer,255,0,0,true) end end ) addEvent("DataS",true) addEventHandler("DataS",root, function() local pAccount = getPlayerAccount ( source ) local joinedOn = getAccountData( pAccount, "player.member" ) exppoints = exports.exp:getPlayerEXP( source ) triggerClientEvent( source, "DataC", source, joinedOn ) end )
-
I don't know, would be if you tell us which server do you play.
-
You're posting in the wrong forum, this is MTA forums.
-
createMarker onClientMarkerHit guiSetVisible No es tan dificil.