
sylver
Members-
Posts
38 -
Joined
-
Last visited
Everything posted by sylver
-
I did already write in a mysql database. But now my question is how do I read? Saving made as follows: local function savePlayer( player ) if not player then for key, value in ipairs( getElementsByType( "player" ) ) do savePlayer( value ) end else if isLoggedIn( player ) then -- save character since it's logged in local sw22 = getPlayerPkt1(player) local x, y, z = getElementPosition( player ) exports.sql:query_free( "UPDATE characters SET money = " .. getPlayerMoney( player ) .. ", pkt = ".. sw22..", rotation = " .. getPedRotation( player ) .. ", health = " .. math.floor( getElementHealth( player ) ) .. ", armor = " .. math.floor( getPedArmor( player ) ) .. ", weapons = " .. getWeaponString( player ) .. ", lastLogin = NOW() WHERE characterID = " .. tonumber( getCharacterID( player ) ) ) end end end setTimer( savePlayer, 3000, 0 ) -- Auto-Save every five minutes function getPlayerPkt1(player) if isElement(player) then local pkt = getElementData(player,"Pkt") if tonumber(pkt) then return tonumber(pkt) else return tonumber(0) end else return tonumber(0) end end Only now how to load it on the scoreboard it was?
-
Downloading statistics such code: function getPlayerPkt(player) if isElement(player) then local pkt = getElementData(player,"Pkt") if tonumber(pkt) then return tonumber(pkt) else return tonumber(0) end else return tonumber(0) end end
-
What do you want me to say? I made a script to show money in the scoreboard I after reconnect is: is 0 cash in scoreboard and I'm have 21 ...
-
Hello. I want to do to save some data from mysql I did so, however, do not save local function savePlayer( player ) if not player then for key, value in ipairs( getElementsByType( "player" ) ) do savePlayer( value ) end else if isLoggedIn( player ) then -- save character since it's logged in local x, y, z = getElementPosition( player ) exports.sql:query_free( "UPDATE characters SET money = " .. getPlayerMoney( player ) .. ", karne = ".. getPlayerPkt(value)..", rotation = " .. getPedRotation( player ) .. ", health = " .. math.floor( getElementHealth( player ) ) .. ", armor = " .. math.floor( getPedArmor( player ) ) .. ", weapons = " .. getWeaponString( player ) .. ", lastLogin = NOW() WHERE characterID = " .. tonumber( getCharacterID( player ) ) ) end end end setTimer( savePlayer, 3000, 0 ) -- Auto-Save every five minutes function getPlayerPkt(player) if isElement(player) then local pkt = getElementData(player,"Pkt") if tonumber(pkt) then return tonumber(pkt) else return tonumber(0) end else return tonumber(0) end end I made a simple script to save but nothing is save function onPlayerLogin () local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then if not isGuestAccount ( playeraccount ) then local playerpkt = getAccountData ( playeraccount, "Pkt" ) if ( playerpkt ) then setElementData(source, "Pkt", tonumber(playerpkt)) end end end end function onPlayerQuit () local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then if not isGuestAccount ( playeraccount ) then local playerpkt = getElementData ( source, "Pkt" ) if ( playerpkt ) then setAccountData ( playeraccount, "Pkt", playerpkt ) end end end end addEventHandler ( "onPlayerLogin", getRootElement (), onPlayerLogin ) addEventHandler ( "onPlayerQuit", getRootElement (), onPlayerQuit )
-
Hello. I would like to make a script that for example, how is it 25 wins gets like $ 1000 or 1 point of reputation. When I did this: if getAccountData (playeraccount, "SW ") == 1 then setAccountData (player, "Rep","2") Jumped Error Bad argument @ 'GetAccountData'
-
Dzięki teraz zadziałało. A mam jeszcze pytanie ściągnąłem Dashboard z community wgrałem to na serwer i na www, powpisywałem dane lecz piszę że nie działa <?php //settings.php //settings for the source. $settings['mta_host'] = "62.75.141.161"; //The location without the HTTP port of your server. $settings['mta_port'] = 22126; $settings['admin_user'] = "test"; //An user with web acces on the SERVER. $settings['admin_pass'] = "test"; //The password for the user. ?> Użytkownik test ma dostęp do uprawnień admina.
-
I also do not work it too much ... Please help my settings.php <?php //settings.php //settings for the source. $settings['mta_host'] = "********"; //The location without the HTTP port of your server. $settings['mta_port'] = 22008; $settings['admin_user'] = "test"; //An user with web acces on the SERVER. $settings['admin_pass'] = "test"; //The password for the user. ?>
-
No trudno . Ej a jest jakiś sposób żeby na www wyświetlało ilość graczy team itd ?
-
I co każdy będzie mieć to samo ? Czy będzie musiał sam wgrywać ?
-
Eee to nie dobrze Bo co wtedy jak skin ma txd i dff ? Bo chciałbym wgrać Polską Policje a to ma txd i dff
-
Jak tam po świętach ? Ej mam pytanie co do Skinów czy da się podmienić dff w skinie ?
-
Ohh przepraszam Już sobie z tym poradziłem
-
Dzek słuchaj mam pytanie, chciałbym aby mi się tuning zapisywał w MySQL, ale nie wiem jakim kodem -.-. Mógłbyś mi pomóc ?
-
Eyy co tu tak cicho ? Na tym forum jest kilka, kilkanaście jak nie kilkadziesiąt polaków
-
Hi I would like to make a script for a driving license but did not know where and how to get started. This would look like that if someone does not have a driving license can not get in the car. Please help
-
You no longer need help fixed it: D http://packages.debian.org/lenny/i386/libpcre3/download
-
vps1013:/multitheftauto_linux-1.0.4# ./mta-server ./mta-server: error while loading shared libraries: libpcre.so.3: wrong ELF class: ELFCLASS64 vps1013:/multitheftauto_linux-1.0.4#