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

Wysłany: 2016-06-30, 19:00


GamerHD11







Wiek: 24
Na forum: 4402 dni
Posty: 259
Nick w MP: SzokoHD

Piwa: 23

Respekt: 50

Witam mam pewien problem. W moim skrypcie z sklepem z ubraniami podczas zakupu ich nic si? nie dziej? a powinno da? ubranie graczowi. Nie ma nic w Debug Script 3.

function koszulki()
wybor = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 )
if wybor == "Koszulka I Love LS" then
addPedClothes(localPlayer, "tshirtilovels", "tshirt", 5)
elseif wybor == "Koszulka Homies" then
addPedClothes(localPlayer, "tshirtblunts", "tshirt", 6)
elseif wybor == "Koszulka Grill Boy" then
addPedClothes(localPlayer, "shirtbplaid", "shirtb", 7)
elseif wybor == "Koszulka Gangsta Bitch" then
addPedClothes(localPlayer, "bballjackrstar", "bbjack", 14)
elseif wybor == "Koszulka Ebis" then
addPedClothes(localPlayer, "tshirterisyell", "tshirt", 10)
end
end
addEventHandler("onClientGUIClick", zakup, koszulki)


for i = 1, 5 do
    guiGridListAddRow(grid)
end
guiGridListSetItemText(grid, 0, 1, "Koszulka I Love LS", false, false)
guiGridListSetItemText(grid, 0, 2, "30 $", false, false)
guiGridListSetItemText(grid, 1, 1, "Koszulka Homies", false, false)
guiGridListSetItemText(grid, 1, 2, "37 $", false, false)
guiGridListSetItemText(grid, 2, 1, "Koszulka Grill Boy", false, false)
guiGridListSetItemText(grid, 2, 2, "45$", false, false)
guiGridListSetItemText(grid, 3, 1, "Koszulka Gangsta Bitch", false, false)
guiGridListSetItemText(grid, 3, 2, "51 $", false, false)
guiGridListSetItemText(grid, 4, 1, "Koszulka Ebis", false, false)
guiGridListSetItemText(grid, 4, 2, "60 $", false, false)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-01, 22:58


eject

kurdebele






Wiek: 30
Na forum: 3800 dni
Posty: 182
Nick w MP: EjecT

Piwa: 2456

Respekt: 85,8

Ostrzeżeń: 60%
function koszulki(localPlayer) -- Tutaj zapomnia?e? da? argumentu gracza
wybor = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 )
if wybor == "Koszulka I Love LS" then
addPedClothes(localPlayer, "tshirtilovels", "tshirt", 5)
elseif wybor == "Koszulka Homies" then
addPedClothes(localPlayer, "tshirtblunts", "tshirt", 6)
elseif wybor == "Koszulka Grill Boy" then
addPedClothes(localPlayer, "shirtbplaid", "shirtb", 7)
elseif wybor == "Koszulka Gangsta Bitch" then
addPedClothes(localPlayer, "bballjackrstar", "bbjack", 14)
elseif wybor == "Koszulka Ebis" then
addPedClothes(localPlayer, "tshirterisyell", "tshirt", 10)
end
end
addEventHandler("onClientGUIClick", zakup, koszulki)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-01, 23:30


GabWas







Wiek: 24
Na forum: 4022 dni
Posty: 289
Nick w MP: GabWas

Piwa: 65

Respekt: 231,5
Respekt: 231,5Respekt: 231,5

"eject" napisał/a:

function koszulki(localPlayer) -- Tutaj zapomnia?e? da? argumentu gracza
wybor = guiGridListGetItemText ( grid, guiGridListGetSelectedItem ( grid ), 1 )
if wybor == "Koszulka I Love LS" then
addPedClothes(localPlayer, "tshirtilovels", "tshirt", 5)
elseif wybor == "Koszulka Homies" then
addPedClothes(localPlayer, "tshirtblunts", "tshirt", 6)
elseif wybor == "Koszulka Grill Boy" then
addPedClothes(localPlayer, "shirtbplaid", "shirtb", 7)
elseif wybor == "Koszulka Gangsta Bitch" then
addPedClothes(localPlayer, "bballjackrstar", "bbjack", 14)
elseif wybor == "Koszulka Ebis" then
addPedClothes(localPlayer, "tshirterisyell", "tshirt", 10)
end
end
addEventHandler("onClientGUIClick", zakup, koszulki)


Nie wprowadzaj go w b??d. Najpierw zapoznaj si? z Wiki MTA, a potem poprawiaj:

Więcej informacji znajdziesz w Wikipedii MTA:

onClientGUIClick

Jak mo?esz zauwa?y?, pierwszy argument w funkcji to nie gracz ("player"), tylko "button".

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-02, 08:32


GamerHD11







Wiek: 24
Na forum: 4402 dni
Posty: 259
Nick w MP: SzokoHD

Piwa: 23

Respekt: 50

Czyli w nawiasach mam wpisa? zakup ?

Postaw piwo autorowi tego posta
 

 
Tagi: dodawanie :: ubrań
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