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

Wysłany: 2013-05-05, 13:41


PanGrzybulek







Wiek: 29
Na forum: 4964 dni
Posty: 47
Nick w MP: Mentosik

Piwa: 3

Respekt: 50

Ostrzeżeń: 100%
Wyswietla mi sie b??d z giveWeapon @bad Argument,

SERVER:

function weapon( player, weapon )
giveWeapon ( player, tonumber(bron), 100 )
takePlayerMoney ( player, 1000 )
end
addEvent ("weapon", true )
addEventHandler("weapon", getRootElement(), weapon)


CLIENT:

local marker = createMarker( 124, 1081, 13, "cylinder", 2, 0, 255, 255, 30)
local player = getLocalPlayer()



GUIEditor = {
    gridlist = {},
    button = {},
    edit = {}
}
        okno = guiCreateGridList(521, 265, 516, 405, false)
        guiSetAlpha(okno, 0.88)

        edit = guiCreateEdit(356, 125, 86, 26, "", false, okno)
        kup = guiCreateButton(309, 216, 179, 38, "KUP", false, okno)
        GUIEditor.gridlist[2] = guiCreateGridList(25, 150, 147, 222, false, okno)
        guiGridListAddColumn(GUIEditor.gridlist[2], "Bron", 0.4)
        guiGridListAddColumn(GUIEditor.gridlist[2], "ID", 0.4)
        for i = 1, 7 do
            guiGridListAddRow(GUIEditor.gridlist[2])
        end
        guiGridListSetItemText(GUIEditor.gridlist[2], 0, 1, "Bazuka", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 0, 2, "36", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 1, 1, "Sniper", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 1, 2, "34", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 2, 1, "Ak-47", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 2, 2, "30", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 3, 1, "Uzi", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 3, 2, "29", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 4, 1, "Shotgun", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 4, 2, "27", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 5, 1, "Colt-45", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 5, 2, "22", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 6, 1, "Granaty 10x", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 6, 2, "16", false, false)
        zamknij = guiCreateButton(317, 349, 161, 41, "Wyjdz", false, okno)   
        guiSetVisible ( okno, false )

    function draw()
        dxDrawText("Bronie Servera Polskiego RPG", 531, 284, 971, 342, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawLine(655, 324, 919, 324, tocolor(255, 255, 255, 255), 1, true)
        dxDrawText("Aby zakupic bron, musisz wpisac jej ID ponizej :", 551, 352, 939, 391, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Koszt : 1000 $", 857, 438, 1097, 472, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Przykladowe bronie", 541, 391, 781, 425, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Copyright by @BrudnyAnal.\nWiecej na originalgta.pl", 531, 637, 673, 670, tocolor(255, 255, 255, 255), 0.80, "default-bold", "left", "top", false, false, true, false, false)
    end

    
    
function abrir ( hitElement )
if getElementType(hitElement) == "player" and (hitElement == localPlayer) then
guiSetVisible(okno, true)
showCursor(true)
addEventHandler ( "onClientRender", getRootElement(), draw )
outputChatBox ( "Witamy w sklepie z broni?.", 255, 0, 0 )
end
end
addEventHandler("onClientMarkerHit", marker, abrir)

function cerrarv()
    guiSetVisible ( okno, false )
    showCursor ( false )
    guiSetInputEnabled ( false )
    removeEventHandler ( "onClientRender", getRootElement(), draw )
end
addEventHandler("onClientGUIClick", zamknij, cerrarv, false)


function weapon ()
if (source == kup) then
outputChatBox ( "Kupile? bro?.", player, 0, 0, 205 )
local bron = guiGetText ( edit )
triggerServerEvent("weapon", getRootElement(), player, weapon)
end
end
addEventHandler ( "onClientGUIClick", kup, weapon )


Gdzie zrobilem blad?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-05, 13:53


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Serwer:
function weapon( player, bron)
giveWeapon ( player, tonumber(bron), 100 )
takePlayerMoney ( player, 1000 )
end
addEvent ("weapon", true )
addEventHandler("weapon", getRootElement(), weapon)


Klient:
local marker = createMarker( 124, 1081, 13, "cylinder", 2, 0, 255, 255, 30)
local player = getLocalPlayer()



GUIEditor = {
    gridlist = {},
    button = {},
    edit = {}
}
        okno = guiCreateGridList(521, 265, 516, 405, false)
        guiSetAlpha(okno, 0.88)

        edit = guiCreateEdit(356, 125, 86, 26, "", false, okno)
        kup = guiCreateButton(309, 216, 179, 38, "KUP", false, okno)
        GUIEditor.gridlist[2] = guiCreateGridList(25, 150, 147, 222, false, okno)
        guiGridListAddColumn(GUIEditor.gridlist[2], "Bron", 0.4)
        guiGridListAddColumn(GUIEditor.gridlist[2], "ID", 0.4)
        for i = 1, 7 do
            guiGridListAddRow(GUIEditor.gridlist[2])
        end
        guiGridListSetItemText(GUIEditor.gridlist[2], 0, 1, "Bazuka", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 0, 2, "36", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 1, 1, "Sniper", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 1, 2, "34", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 2, 1, "Ak-47", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 2, 2, "30", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 3, 1, "Uzi", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 3, 2, "29", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 4, 1, "Shotgun", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 4, 2, "27", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 5, 1, "Colt-45", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 5, 2, "22", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 6, 1, "Granaty 10x", false, false)
        guiGridListSetItemText(GUIEditor.gridlist[2], 6, 2, "16", false, false)
        zamknij = guiCreateButton(317, 349, 161, 41, "Wyjdz", false, okno)   
        guiSetVisible ( okno, false )

    function draw()
        dxDrawText("Bronie Servera Polskiego RPG", 531, 284, 971, 342, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawLine(655, 324, 919, 324, tocolor(255, 255, 255, 255), 1, true)
        dxDrawText("Aby zakupic bron, musisz wpisac jej ID ponizej :", 551, 352, 939, 391, tocolor(255, 255, 255, 255), 0.60, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Koszt : 1000 $", 857, 438, 1097, 472, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Przykladowe bronie", 541, 391, 781, 425, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("Copyright by @BrudnyAnal.\nWiecej na originalgta.pl", 531, 637, 673, 670, tocolor(255, 255, 255, 255), 0.80, "default-bold", "left", "top", false, false, true, false, false)
    end

    
    
function abrir ( hitElement )
if getElementType(hitElement) == "player" and (hitElement == localPlayer) then
guiSetVisible(okno, true)
showCursor(true)
addEventHandler ( "onClientRender", getRootElement(), draw )
outputChatBox ( "Witamy w sklepie z broni?.", 255, 0, 0 )
end
end
addEventHandler("onClientMarkerHit", marker, abrir)

function cerrarv()
    guiSetVisible ( okno, false )
    showCursor ( false )
    guiSetInputEnabled ( false )
    removeEventHandler ( "onClientRender", getRootElement(), draw )
end
addEventHandler("onClientGUIClick", zamknij, cerrarv, false)


function weapon ()
if (source == kup) then
outputChatBox ( "Kupile? bro?.", player, 0, 0, 205 )
local bron = guiGetText ( edit )
triggerServerEvent("weapon", getRootElement(), player, bron)
end
end
addEventHandler ( "onClientGUIClick", kup, weapon )


Licz? na zimne piwko :)

Postaw piwo autorowi tego posta
 

 
Tagi: @bad :: argument
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