Jump to content

#meS

Members
  • Posts

    70
  • Joined

  • Last visited

Everything posted by #meS

  1. nvm i'm an idiot i didn't copy the other code : - ) one more question hmm players can edit the things from client place dunno how to say it .. or they can't?
  2. ^^ server side function trr() triggerClientEvent(source,"onClientPlayerLogin",source) end addEventHandler("onPlayerLogin",root,trr) still not working
  3. so it should be like this still doesn't work PasswordTable = {guiGetText(LOGIN_edit[1]),guiGetText(LOGIN_edit[2])} -- or however you want to store your data .. function savePassword() setData("LoginInfo",toJSON(PasswordTable)) end addEvent("onClientPlayerLogin",true) addEventHandler("onClientPlayerLogin",root,savePassword) function getPassword() local pTable = fromJSON(getData("LoginInfo")) or {} if pTable and #pTable > 0 then guiSetText(LOGIN_edit[1],pTable[1]) guiSetText(LOGIN_edit[2],pTable[2]) return pTable[1],pTable[2] -- user,password else return end end addEventHandler("onClientResourceStart",root,getPassword)
  4. i'm trying to save pass word but not working code: function saveunp() if not (Muser) then if not (Mpass) then Muser = fileCreate("user.txt", true) Mpass = fileCreate("pass.txt", true) Xuser = fileOpen("user.txt", true) Xpass = fileOpen("pass.txt", true) fileWrite(Xuser, guiGetText(LOGIN_edit[1])) fileWrite(Xpass, guiGetText(LOGIN_edit[2])) fileClose(Muser) fileClose(Mpass) end end end addEvent("onClientPlayerLogin",true) addEventHandler("onClientPlayerLogin",root,saveunp) function putunp() Buser = fileOpen("user.txt", true) Bpass = fileOpen("pass.txt", true) user = fileRead(Buser, 500) pass = fileRead(Bpass, 500) if (Buser) then guiSetText(LOGIN_edit[1],user) guiSetText(LOGIN_edit[2],pass) fileClose(Buser) fileClose(Bpass) end end addEventHandler("onClientResourceStart",resourceRoot,putunp)
  5. SQLite is perfect and with good execution, because it's able to get more size of data plus it's faster than other ways, it's creating an unique file and store all the things into it, instead of creating one for each resource. About XML it's just for saving normal stuffs but i recommend you to use sqlite in case you have more stuffs to save. Also you can use MySQL it's similar to SQLite but the advantage about MySQL is that you can use phpMyAdmin or any other PHP file and display the data to a web page. It's much more functional since, if you need, for example, to control your server from the web or from a smart phone, it's much easier to implement with MySQL than with SQLite, SQLite create a file complied so you can't manage it not like Mysql, but it still your choice. I have been using xml and file since forever and they're just fine. I was just wondering if using other methods would improve the performance of the script Just asking how do you save with using file? Example please
  6. nvm fixed it some how
  7. hello i have problem! when i log out when i'm jumping or when i'm flying with superman and then connecting it doesn't set the camera target me but when i'm in ground it works well code: function savesystem() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "s.HandMoney" ) if ( playermoney ) then setPlayerMoney ( source, playermoney ) local playerInt = getAccountData (playeraccount, "s.int") local playerDim = getAccountData (playeraccount, "s.dim") --local playerSkin = getAccountData (playeraccount, "s.skin") local playerX = getAccountData (playeraccount, "s.x") local playerY = getAccountData (playeraccount, "s.y") local playerZ = getAccountData (playeraccount, "s.z") local playerRot = getAccountData (playeraccount, "s.rot") spawnPlayer(source, playerX, playerY, playerZ, playerRot, 0, playerInt, playerDim) setCameraTarget(source,source) for slot = 1, 12 do local wep = getAccountData ( account, "save-wep".. slot ) local ammo = getAccountData ( account, "save-ammo".. slot ) giveWeapon ( source, wep, ammo ) end end end end addEventHandler("onPlayerLogin", root,savesystem)
  8. #meS

    Kill timer

    yeah sorry it worked but i want to ask it will be removed for the clicked element? function revPlayer() local playerHealthC = getElementHealth ( clickedElement ) if source == CLP.label[3] then if playerHealthC == 0 then outputChatBox("You Revived "..getPlayerName(clickedElement).." !",255,0,0) triggerServerEvent("ClientSpawnPlayer",clickedElement) killTimer(deathTimer) end end end addEventHandler("onClientGUIClick",root,revPlayer) ( not the full code don't say clicked element is not defined it's already definded )
  9. #meS

    Kill timer

    @rob no no I know it will kill the timer but I want to remove the timer when player clicks button @dimos nope
  10. #meS

    Kill timer

    Hello I'm trying to kill the timer but doesn't work client side function setTimerOnWasted() setTimer( function() guiSetVisible(deathWin,true) end ,30000,0) end addEventHandler("onPlayerWasted",getLocalPlayer(),setTimerOnWasted) --- the place i kill the timer with killTimer(setTimerOnWasted) And yeah I want to ask when player dies will the timer be set for the dead player? Thanks
  11. #meS

    GUI msg

    wow i'm so dumb thanks!
  12. #meS

    GUI msg

    function addXXXX() local column = guiGridListAddColumn( msgGRID, "Player", 0.85 ) if ( column ) then for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( msgGRID ) guiGridListSetItemText ( msgGRID, row, column, getPlayerName ( playeritem ), false, false ) end end end addEventHandler ( "onClientResourceStart", resourceRoot, addXXXX )
  13. #meS

    GUI msg

    so i can't pm my self :c? it gives me error when i pm my self it's not possible to pm your self or it's some thing wrong?
  14. #meS

    GUI msg

    thanks but not working: server function privmsgplayer(source,msg,choosed) outputChatBox("[PM] PM to " .. getPlayerName(choosed) .. ": " .. msg, source, 255, 0, 0, false) outputChatBox("[PM] PM from " .. getPlayerName(source) .. ": " .. msg, choosed, 255, 215, 0, false) end addEvent("onMessagePM",true) addEventHandler("onMessagePM",root,privmsgplayer) client function trigMSG() local selectedRow = guiGridListGetSelectedItem(msgGRID) local choosedPlayer = guiGridListGetItemData(msgGRID, selectedRow, 1) if source == msgSend then triggerServerEvent("onMessagePM",localPlayer,guiGetText(msgText),choosedPlayer) end end addEventHandler("onClientGUIClick",root,trigMSG)
  15. thank you but why getting player team doesn't work? for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( SRB.gridlist[1] ) guiGridListSetItemText ( SRB.gridlist[1], row, 1, getPlayerName ( playeritem ), false, false ) guiGridListSetItemText ( SRB.gridlist[1], row, 2, getTeamName (getPlayerTeam( playeritem )), false, false ) guiGridListSetItemText ( SRB.gridlist[1], row, 3, getElementData( playeritem ,"job"), false, false ) guiGridListSetItemText ( SRB.gridlist[1], row, 4, getPlayerPing( playeritem ), false, false ) guiGridListSetItemText ( SRB.gridlist[1], row, 5, getElementData( playeritem,"FPS"), false, false )
  16. Ok thank you but how to remove the rows near it? like i did near the player name ping row how to remove it when he leave? like this maybe? function remove() for row = 0, guiGridListGetRowCount(gridplayers) - 1 do if (guiGridListGetItemText(gridplayers, row, 1) == getPlayerName(source)) or (guiGridListGetItemText(gridplayers, row, 1) == getPlayerPing(getPlayerName(source) then guiGridListRemoveRow(gridplayers, row) end end addEventHandler("onClientPlayerQuit",root,remove)
  17. Ok I know the function but .. Ah idk how to remove the left player this gonna work? function remove() guiGridListRemoveRow( gridplayers,getPlayerName(source)) end addEventHandler("onClientPlayerQuit",root,remove)
  18. hello I want to remove row when player leave like i want to remove the player name who left the game from the grid list how to do that?
  19. #meS

    GUI msg

    BUMP this era doesn't have good scripters xDdddd
×
×
  • Create New...