Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. Castillo

    Se puede?

    Vas a tener que crear una funcion que se ejecute con un evento rapido ( onClientRender ) y luego verificas si la armadura cambio.
  2. Well, if 'source' is defined and 'VEHICLE' as well, then it should work.
  3. You can use: getTickCount More efficient than a timer.
  4. You have a missing 'end' to close the 'if' statement.
  5. I guess you mean when a player with that name joins, if so, then you can use: onPlayerJoin getPlayerName string.find
  6. I think this should be continued over a private chat ( MSN, Skype, etc ). Topic locked.
  7. Castillo

    data

    You're welcome.
  8. stats = { 22, 23, 24, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79 } function changeBodyStrength ( player ) for _, stat in ipairs ( stats ) do setPedStat ( player, stat, 999 ) end outputChatBox ( "* Your player looks really muscular", 0, 255, 0, true ) end addCommandHandler ( "xx", changeBodyStrength )
  9. Castillo

    Se puede?

    La unica manera seria darle la armadura cada ves que la pierde.
  10. Maybe you should consider using SQLite instead of account data.
  11. Castillo

    data

    No, they aren't related to this.
  12. Castillo

    data

    @TwiX: Account data is saved on "internal.db". @boro: See if it's in: "internal.db".
  13. Castillo

    data

    Depends on your save system, MTA doesn't include one.
  14. Te lo mejore y ademas agrege el boton para dar 'VIP'. -- client side: -- * Reeditado Por TigreBlanco, Hecho por $ora GppWindow = guiCreateWindow(0.1900,0.3400,0.6400,0.4500,"Panel para Dar Permisos por TigreBlanco",true) guiSetVisible(GppWindow,false) guiWindowSetSizable(GppWindow,false) Gpedit = guiCreateEdit(251,54,203,33,"",false,GppWindow) GiveModeratorButton = guiCreateButton(250,91,215,40,"Dar Permisos de Moderador",false,GppWindow) GiveSuperModeratorButton = guiCreateButton(250,143,215,40,"Dar Permisos de SuperModerador",false,GppWindow) GiveAdminsButton = guiCreateButton(251,194,210,40,"Dar Permisos de Admin",false,GppWindow) GiveVIPButton = guiCreateButton(251,245,210,40,"Dar Permisos de VIP",false,GppWindow) label = guiCreateLabel(252,31,154,17,"Jugador:",false,GppWindow) CloseButton = guiCreateButton(445,25,18,16,"X",false,GppWindow) removebutton = guiCreateButton(369,26,65,21,"eliminar",false,GppWindow) -------------------------- ---Lista Grid ------------------------- addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) grid = guiCreateGridList ( 9, 25, 228, 214, false, GppWindow ) local column = guiGridListAddColumn ( grid, "Nombre del Jugador", 0.89 ) if ( column ) then for id, player in ipairs ( getElementsByType ( "player" ) ) do local row = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, row, column, getPlayerName ( player ), false, false ) guiGridListSetItemColor ( grid, row, column, 0, 250, 154, 255 ) end addEventHandler ( "onClientGUIClick", grid, click, false ) end end ) function click ( ) local playerName = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 ) guiSetText ( Gpedit, playerName ) end ---------------------------- --Abrir Panel con Comando -------------------------- function showPanel ( ) guiSetVisible ( GppWindow, not guiGetVisible ( GppWindow ) ) showCursor ( guiGetVisible ( GppWindow ) ) if ( guiGetVisible ( GppWindow ) ) then playSound ( "open.mp3", false ) end end addEvent ( "showPanel", true ) addEventHandler ( "showPanel", getRootElement(), showPanel ) --------------------- --Cuando le Das Clic -------------------- function onGuiClick ( button, state, absoluteX, absoluteY ) if ( source == CloseButton ) then guiSetVisible ( GppWindow, false ) showCursor ( false ) elseif ( source == removebutton ) then local name = guiGetText ( Gpedit ) local target = getPlayerFromName ( name ) triggerServerEvent ( "remove", getLocalPlayer(), target ) elseif ( source == GiveModeratorButton ) then local name = guiGetText ( Gpedit ) local target = getPlayerFromName ( name ) triggerServerEvent ( "giveRights", getLocalPlayer(), target, "Moderator" ) playSound ( "sec.wav", false ) elseif ( source == GiveSuperModeratorButton ) then local name = guiGetText ( Gpedit ) local target = getPlayerFromName ( name ) triggerServerEvent ( "giveRights", getLocalPlayer(), target, "SuperModerator" ) playSound ( "sec.wav", false ) elseif ( source == GiveAdminsButton ) then local name = guiGetText ( Gpedit ) local target = getPlayerFromName ( name ) triggerServerEvent ( "giveRights", getLocalPlayer(), target, "Admin" ) playSound ( "sec.wav", false ) elseif ( source == GiveVIPButton ) then local name = guiGetText ( Gpedit ) local target = getPlayerFromName ( name ) triggerServerEvent ( "giveRights", getLocalPlayer(), target, "VIP" ) playSound ( "sec.wav", false ) end end addEventHandler ( "onClientGUIClick", guiRoot, onGuiClick ) ----------------------- --Obtener Permisos --------------------- function GetPermission ( ) triggerServerEvent ( "OpenPanel", getLocalPlayer(), OpenPanel ) end ---------------------- --Sonidos --------------------- function nopsound ( ) playSound ( "np.mp3", false ) end addEvent ( "nopsound", true ) addEventHandler ( "nopsound", getRootElement(), nopsound ) function removedsound ( ) playSound ( "removed.wav", false ) end addEvent ( "removedsound", true ) addEventHandler ( "removedsound", getRootElement(), removedsound ) -------------------- --Refrescar la Lista de Jugadores -------------------- function list ( ) guiGridListClear ( grid ) for id, players in ipairs ( getElementsByType ( "player" ) ) do local row = guiGridListAddRow ( grid ) guiGridListSetItemText ( grid, row, 1, getPlayerName ( players ), false, false ) guiGridListSetItemColor ( grid, row, 1, 0, 250, 154, 255 ) end end addEventHandler ( "onClientPlayerJoin", getRootElement(), list ) addEventHandler ( "onClientPlayerQuit", getRootElement(), list ) addEventHandler ( "onClientPlayerChangeNick", getRootElement(), list ) -- * Reeditado por TigreBlanco, Hecho por $ora -- server side: -- * Editado por TigreBlanco, Hecho por $ora addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "i", "down", show ) end ) addEventHandler ( "onResourceStart",resourceRoot, function ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "i", "down", show ) end end ) function show ( thePlayer ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Console" ) ) then triggerClientEvent ( thePlayer, "showPanel", thePlayer ) else outputChatBox ( "* No Tienes los Suficientes Permisos para Este Comando", thePlayer, 255, 0, 0, true ) triggerClientEvent ( thePlayer, "nopsound", thePlayer ) end end ------------------------ --Dar permisos ----------------------- function giveRights ( target, groupName ) local account = getPlayerAccount ( target ) local group = aclGetGroup ( groupName ) if ( group ) then aclGroupAddObject ( group, "user.".. getAccountName ( account ) ) outputChatBox ( "A '".. getAccountName ( getPlayerAccount ( target ) ) .."' Le Han Sido Consedidos Permisos de ".. groupName, source, 0, 255, 0 ) else outputChatBox ( "No Has Especificado el Nombre de la Cuenta", source, 255, 100 ,100 ) end end addEvent ( "giveRights", true ) addEventHandler ( "giveRights", getRootElement(), giveRights ) function removee ( target ) local account = getPlayerAccount ( target ) if ( account ) then aclGroupRemoveObject ( aclGetGroup ( "Moderator" ), "user.".. getAccountName ( account ) ) aclGroupRemoveObject ( aclGetGroup ( "SuperModerator" ), "user.".. getAccountName ( account ) ) aclGroupRemoveObject ( aclGetGroup ( "Admin" ), "user.".. getAccountName ( account ) ) aclGroupRemoveObject ( aclGetGroup ( "VIP" ), "user.".. getAccountName ( account ) ) outputChatBox ( "Todos los Permisos De '".. getAccountName ( getPlayerAccount ( target ) ) .."' han Sido Eliminados !", source, 255, 0, 0 ) triggerClientEvent ( source, "removedsound", source ) else outputChatBox ( "No Has Especificado el Nombre de la Cuenta", source, 255, 100, 100 ) end end addEvent ( "remove", true ) addEventHandler ( "remove", getRootElement(), removee ) ---------------------- --Comando ---------------------- function OpenPanel ( player ) local player = ( player or source ) local accountname = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Console" ) ) then triggerClientEvent ( player, "showPanel", player ) else outputChatBox ( "* No Tienes los Suficientes Permisos Parta Este Comando", player, 255, 0, 0, true ) triggerClientEvent ( player, "nopsound", player ) end end addEvent ( "OpenPanel", true ) addEventHandler ( "OpenPanel", getRootElement(), OpenPanel ) addCommandHandler ( "pdp", OpenPanel ) function check ( ) local accountname = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Console" ) ) then outputChatBox ( "Escribe /pdp o Apreta la Tecla I para Abrir el Panel para dar Permisos", source, 255, 0, 0, true ) end end addEventHandler ( "onPlayerLogin", getRootElement(), check ) -- * Editado por TigreBlanco, Hecho por $ora
  15. You can also make a table which will contain the real names, like this: realNames = { [ "Ford GT" ] = "Bullet" } Then when you are about to create the vehicle, you do this: vehicleModel = getVehicleModelFromName ( realNames [ nameReceived ] )
  16. Castillo

    Problem

    You are wrong here, and even when he's correcting your mistake, you threat him like this.
  17. Does the chat message has colors?
  18. Castillo

    [SOLVED]

    @Brolis: Try renaming the resource to "stealth".
  19. Castillo

    Hud

    Tema cerrado.
  20. Es ese todo el script? si no, entonces postealo todo.
  21. function changeBodyStrength ( player ) local accountname = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ( "user.".. accountname, aclGetGroup ( "swat" ) ) then for stat = 69, 79 do setPedStat ( player, stat, 1000 ) end end end addCommandHandler ( "vipstat", changeBodyStrength ) That'll set all the weapon skills to maximum.
  22. triggerClientEvent onClientPlayerDamage cancelEvent
×
×
  • Create New...