Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-09-12, 09:49


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Witam. Mam problem z dawaniem skina po zalogowaniu. Ot??, jak wybior? spawn to daje mi skina CJ. Mo?e to kto? poprawi??

S-Side z logowania:

function PlayerLogin(username,password,checksave)
    if not (username == ""then
        if not (password == ""then
            local account getAccount username,password )
                if ( account ~= false then
                    logIn(sourceaccountpassword)
                        setCameraTarget(sourcesource)
                    outputChatBox ("Gratulacje! Zalogowa?e? si? poprawnie!"source)
                triggerClientEvent (source,"Zacznij",getRootElement())
                toggleControl (source"fire"false)
                toggleControl (source"aim_weapon"false)
            end
        end
    end
end                        
addEvent("onRequestLogin",true)
addEventHandler("onRequestLogin",getRootElement(),PlayerLogin)

function registerPlayer(username,password,passwordConfirm)
    if not (username == ""then
        if not (password == ""then
                    local account getAccount (username,password)
                    if (account == falsethen
                        local accountAdded addAccount(tostring(username),tostring(password))
                        if (accountAddedthen
                            triggerClientEvent (source"Zaloguj"rootsource)
                        else
                            triggerClientEventsource"Konto_jest"rootsource)                        
                        end
                    else
                        triggerClientEvent source"Nick_Konto"rootsource)
                    end
        else
            triggerClientEvent source"Brak_Haslo"rootsource)
        end
    else
        triggerClientEvent (source"nick"rootsource)
        end
        end
                                               
        
addEvent("onRequestRegister",true)
addEventHandler("onRequestRegister",getRootElement(),registerPlayer)


function playerLoginthePlayer )
end
addEventHandler("onPlayerLogin"getRootElement(), playerLogin)

function playerJointhePlayer )
spawnPlayer(thePlayer,0,0,0,0)
end
addEventHandler("onPlayerJoin"getRootElement(), playerLogin)

addEvent ("For_Spawn"true)
addEventHandler ("For_Spawn"root,
function ( plr )
triggerEvent ("ustawKaseitp"getRootElement (), playerlogin)
plr:spawn 13.960341189.9810819.31405)
end)

addEvent ("LV_Spawn"true)
addEventHandler ("LV_Spawn"root,
function ( plr )
triggerEvent ("ustawKaseitp"getRootElement (), playerlogin)
plr:spawn 2419.75,2388.24,10.82 )
end
)

addEvent ("LS_Spawn"true)
addEventHandler ("LS_Spawn"root,
function ( plr )
triggerEvent ("ustawKaseitp"getRootElement (), playerlogin)
plr:spawn 1481.23022, -1749.4438515.44531 )
end
)

addEvent ("SF_Spawn"true)
addEventHandler ("SF_Spawn"root,
function ( plr )
triggerEvent ("ustawKaseitp"getRootElement (), playerlogin)
plr:spawn (  -1960.96,883.83,42.11 )
end
)


S-side z zapisu mojego:

function playerLogin (thePreviousAccounttheCurrentAccountautoLogin)
  if  not (isGuestAccount (getPlayerAccount (source))) then
    local accountData getAccountData (theCurrentAccount"funmodev2-money")
    if (accountDatathen
      local playerMoney getAccountData (theCurrentAccount"funmodev2-money")
      local playerSkin getAccountData (theCurrentAccount"funmodev2-skin")
      local playerHealth getAccountData (theCurrentAccount"funmodev2-health")
      local playerArmor getAccountData (theCurrentAccount"funmodev2-armor")
      local playerWanted getAccountData (theCurrentAccount"funmodev2-wantedlevel")
      local playerWeaponID0 getAccountData (theCurrentAccount"funmodev2-weaponID0")
      local playerWeaponID1 getAccountData (theCurrentAccount"funmodev2-weaponID1")
      local playerWeaponID2 getAccountData (theCurrentAccount"funmodev2-weaponID2")
      local playerWeaponID3 getAccountData (theCurrentAccount"funmodev2-weaponID3")
      local playerWeaponID4 getAccountData (theCurrentAccount"funmodev2-weaponID4")
      local playerWeaponID5 getAccountData (theCurrentAccount"funmodev2-weaponID5")
      local playerWeaponID6 getAccountData (theCurrentAccount"funmodev2-weaponID6")
      local playerWeaponID7 getAccountData (theCurrentAccount"funmodev2-weaponID7")
      local playerWeaponID8 getAccountData (theCurrentAccount"funmodev2-weaponID8")
      local playerWeaponID9 getAccountData (theCurrentAccount"funmodev2-weaponID9")
      local playerWeaponID10 getAccountData (theCurrentAccount"funmodev2-weaponID10")
      local playerWeaponID11 getAccountData (theCurrentAccount"funmodev2-weaponID11")
      local playerWeaponID12 getAccountData (theCurrentAccount"funmodev2-weaponID12")
      local playerWeaponAmmo0 getAccountData (theCurrentAccount"funmodev2-weaponAmmo0")
      local playerWeaponAmmo1 getAccountData (theCurrentAccount"funmodev2-weaponAmmo1")
      local playerWeaponAmmo2 getAccountData (theCurrentAccount"funmodev2-weaponAmmo2")
      local playerWeaponAmmo3 getAccountData (theCurrentAccount"funmodev2-weaponAmmo3")
      local playerWeaponAmmo4 getAccountData (theCurrentAccount"funmodev2-weaponAmmo4")
      local playerWeaponAmmo5 getAccountData (theCurrentAccount"funmodev2-weaponAmmo5")
      local playerWeaponAmmo6 getAccountData (theCurrentAccount"funmodev2-weaponAmmo6")
      local playerWeaponAmmo7 getAccountData (theCurrentAccount"funmodev2-weaponAmmo7")
      local playerWeaponAmmo8 getAccountData (theCurrentAccount"funmodev2-weaponAmmo8")
      local playerWeaponAmmo9 getAccountData (theCurrentAccount"funmodev2-weaponAmmo9")
      local playerWeaponAmmo10 getAccountData (theCurrentAccount"funmodev2-weaponAmmo10")
      local playerWeaponAmmo11 getAccountData (theCurrentAccount"funmodev2-weaponAmmo11")
      local playerWeaponAmmo12 getAccountData (theCurrentAccount"funmodev2-weaponAmmo12")
      setPlayerMoney (sourceplayerMoney)
      setTimer (setElementHealth5001sourceplayerHealth)
      setTimer (setPedArmor5001sourceplayerArmor)
      setTimer (setPlayerWantedLevel5001sourceplayerWanted)
      giveWeapon(sourceplayerWeaponID0playerWeaponAmmo0true)
      giveWeapon(sourceplayerWeaponID1playerWeaponAmmo1false)
      giveWeapon(sourceplayerWeaponID2playerWeaponAmmo2false)
      giveWeapon(sourceplayerWeaponID3playerWeaponAmmo3false)
      giveWeapon(sourceplayerWeaponID4playerWeaponAmmo4false)
      giveWeapon(sourceplayerWeaponID5playerWeaponAmmo5false)
      giveWeapon(sourceplayerWeaponID6playerWeaponAmmo6false)
      giveWeapon(sourceplayerWeaponID7playerWeaponAmmo7false)
      giveWeapon(sourceplayerWeaponID8playerWeaponAmmo8false)
      giveWeapon(sourceplayerWeaponID9playerWeaponAmmo9false)
      giveWeapon(sourceplayerWeaponID10playerWeaponAmmo10false)
      giveWeapon(sourceplayerWeaponID11playerWeaponAmmo11false)
      giveWeapon(sourceplayerWeaponID12playerWeaponAmmo12false)
    else
      setPlayerMoney (source0)
      setPlayerNametagColor (source255255255) 
    end   
  end
end
addEventHandler ("ustawianieKasyitp"getRootElement(), playerLogin)
addEvent ("ustawKaseitp"true)


function onQuit (quitTypereasonresponsibleElement)
  if not (isGuestAccount (getPlayerAccount (source))) then
    account getPlayerAccount (source)
    if (accountthen
      setAccountData (account"funmodev2-money"tostring (getPlayerMoney (source)))
      setAccountData (account"funmodev2-skin"tostring (getPedSkin (source)))
      setAccountData (account"funmodev2-health"tostring (getElementHealth (source)))
      setAccountData (account"funmodev2-armor"tostring (getPedArmor (source)))
      setAccountData (account"funmodev2-wantedlevel"getPlayerWantedLevel (source))
      setAccountData (account"funmodev2-weaponID0"getPedWeapon (source0))
      setAccountData (account"funmodev2-weaponID1"getPedWeapon (source1))
      setAccountData (account"funmodev2-weaponID2"getPedWeapon (source2))
      setAccountData (account"funmodev2-weaponID3"getPedWeapon (source3))
      setAccountData (account"funmodev2-weaponID4"getPedWeapon (source4))
      setAccountData (account"funmodev2-weaponID5"getPedWeapon (source5))
      setAccountData (account"funmodev2-weaponID6"getPedWeapon (source6))
      setAccountData (account"funmodev2-weaponID7"getPedWeapon (source7))
      setAccountData (account"funmodev2-weaponID8"getPedWeapon (source8))
      setAccountData (account"funmodev2-weaponID9"getPedWeapon (source9))
      setAccountData (account"funmodev2-weaponID10"getPedWeapon (source10))
      setAccountData (account"funmodev2-weaponID11"getPedWeapon (source11))
      setAccountData (account"funmodev2-weaponID12"getPedWeapon (source12))
      setAccountData (account"funmodev2-weaponAmmo0"getPedTotalAmmo (source0))
      setAccountData (account"funmodev2-weaponAmmo1"getPedTotalAmmo (source1))
      setAccountData (account"funmodev2-weaponAmmo2"getPedTotalAmmo (source2))
      setAccountData (account"funmodev2-weaponAmmo3"getPedTotalAmmo (source3))
      setAccountData (account"funmodev2-weaponAmmo4"getPedTotalAmmo (source4))
      setAccountData (account"funmodev2-weaponAmmo5"getPedTotalAmmo (source5))
      setAccountData (account"funmodev2-weaponAmmo6"getPedTotalAmmo (source6))
      setAccountData (account"funmodev2-weaponAmmo7"getPedTotalAmmo (source7))
      setAccountData (account"funmodev2-weaponAmmo8"getPedTotalAmmo (source8))
      setAccountData (account"funmodev2-weaponAmmo9"getPedTotalAmmo (source9))
      setAccountData (account"funmodev2-weaponAmmo10"getPedTotalAmmo (source10))
      setAccountData (account"funmodev2-weaponAmmo11"getPedTotalAmmo (source11))
      setAccountData (account"funmodev2-weaponAmmo12"getPedTotalAmmo (source12))
    end
  end
end
addEventHandler ("onPlayerQuit"getRootElement(), onQuit)

function onWasted(totalAmmokillerkillerWeaponbodypartstealth)
  if notisGuestAccount (getPlayerAccount(source)) ) then
    local theWeapon getPedWeapon (source)
    local weaponAmmo getPedTotalAmmo (source)
    fadeCamera (sourcefalse)
    setTimer (spawnPlayer10001source, -2462.50,132.90,35.170getPedSkin (source), 00getPlayerTeam(source))
    setTimer (setCameraTarget12501sourcesource)
    setTimer (fadeCamera20001sourcetrue)
  end
end

addEventHandler ("onPlayerWasted"getRootElement(), onWasted)
addEventHandler"onPlayerWasted"getRootElement( ),
    function()
        setTimerspawnPlayer20001source, -2462.50,132.90,35.170getPedSkin (source), 00getPlayerTeam(source))
    end
)


Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-12, 10:09


#404







Wiek: 26
Na forum: 4772 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
Do spawnPlayer musisz doda? getAccountData, na konto tego gracza, z warto?ci? na skin.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-12, 12:18


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
"DestroY" napisał/a:

Do spawnPlayer musisz doda? getAccountData, na konto tego gracza, z warto?ci? na skin.


Da?em, i dalej CJ jest ;(

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-12, 16:02


#404







Wiek: 26
Na forum: 4772 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
Masz bl?dy w tym zapisie, zapisuje na niewiadomo jakie konto. Zamien to sobe i powinno by?


function playerLogin (theCurrentAccount)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-12, 16:21


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
"DestroY" napisał/a:

Masz bl?dy w tym zapisie, zapisuje na niewiadomo jakie konto. Zamien to sobe i powinno by?


function playerLogin (theCurrentAccount)


A poprawisz? Bo dalej nie wiem jak to zrobi? :-?

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-12, 17:30


#404







Wiek: 26
Na forum: 4772 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
jg2aviva1, no przecie? Ci poda?em co ma by?...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-12, 18:08


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
"DestroY" napisał/a:

jg2aviva1, no przecie? Ci poda?em co ma by?...


No ale na co mam zamienic?

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-12, 19:37


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

jg2aviva1, nie jest to pro?ciej ?
function skin ()
setElementModelsourceidskina )

end
addEventHandler("onPlayerLogin"rootskin )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-12, 21:37


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
"luki123luki123" napisał/a:

jg2aviva1, nie jest to pro?ciej ?
function skin ()
setElementModelsourceidskina )

end
addEventHandler("onPlayerLogin"rootskin )


Nie jest pro?ciej bo:

1. Skina daje po zalogowaniu ale nie daje po zrespieniu
2. Musze to jako? striggerowa? albo "w?o?y?" tam funkcj? daj?c? skina po zrespieniu.


Wi?c dalej nie wiem jak to zrobi? :x

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Tagi: dawanie :: skina :: zalogowaniu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku