Jump to content

#meS

Members
  • Posts

    70
  • Joined

  • Last visited

Details

  • Gang
    LOL

#meS's Achievements

Transformer

Transformer (11/54)

0

Reputation

  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 )
×
×
  • Create New...