Jump to content

Funkcja 'getPlayerFactionID'


Recommended Posts

Posted

Witajcie, dzisiaj utworzyłem pewną funkcje i coś nie działa:

mysql = exports.mysql 
  
function getPlayerFactionID(player) 
    zatrudnienie = mysql:query("SELECT * FROM Frakcja_zatrudnienie WHERE KontoID='" .. getElementData(player, "KontoID") .. "'") 
    if (mysql:num_rows(zatrudnienie)>0) then 
        zatrudnienieDane = mysql:fetch_assoc(zatrudnienie) 
        frakcjaID = zatrudnienieDane["FrakcjaID"] 
        return frakcjaID 
    else 
        return false 
    end 
end 
  
addCommandHandler("test", 
function(player, cmd) 
    frakcja = getPlayerFactionID(player) 
    outputDebugString(tostring(frakcja)) 
end 
) 

I tak, wpisuje /test i nic się nie dzieje i nic nie wyskakuje na chacie/konsoli/debugu. Nie jestem pewny czy w ogóle skrypt działa ;( Ale jak by nie działał to też by coś wyświetliło

Posted

a dodałeś do meta.xml? uruchamisz po stronie serwera?

dopisz sobie na samej górze debug stringa, żeby zobaczyć czy skrypt w ogóle startuje

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Jak dopisałem na samej górze, czyli tutaj:

outputChatBox("Test skryptu") 
mysql = exports.mysql 

Przy wpisaniu w konsoli 'refresh' a potem 'restart Frakcje' wyskakuje na chacie 'Test skryptu'

Posted

no to doklejaj coś takiego co parę linijek, np. zaraz na początku funkcji obsługującej komendę (czyli przed frakcja= get....), potem na początku tej funkcji, po każdym ifie itd. coś powinno i tak zwrócić, ale w debugu (na pewno masz konsolę debug włączoną?)

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...