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

Wysłany: 2021-09-18, 17:59


HarnesHa12







Wiek: 25
Na forum: 1825 dni
Posty: 5



Respekt: 50

Og?lnie to mam problem z kodem inaczej wywala ostrze?enie na temat WARNING: admin-system/Player/s_player_commands.lua:733: Expected number, got non-convertible string. This warning may be an error in future versions.

(Paczka to OwlGaming)

Kod
Kod:

function getAmmoPerClip(id)
if id == 0 then
return tostring(get( getResourceName( getThisResource( ) ).. '.fist' ))
elseif id == 1 then
return tostring(get( getResourceName( getThisResource( ) ).. '.brassknuckle' ))
elseif id == 2 then
return tostring(get( getResourceName( getThisResource( ) ).. '.golfclub' ))
elseif id == 3 then
return tostring(get( getResourceName( getThisResource( ) ).. '.nightstick' ))
elseif id == 4 then
return tostring(get( getResourceName( getThisResource( ) ).. '.knife' ))
elseif id == 5 then
return tostring(get( getResourceName( getThisResource( ) ).. '.bat' ))
elseif id == 6 then
return tostring(get( getResourceName( getThisResource( ) ).. '.shovel' ))
elseif id == 7 then
return tostring(get( getResourceName( getThisResource( ) ).. '.poolstick' ))
elseif id == 8 then
return tostring(get( getResourceName( getThisResource( ) ).. '.katana' ))
elseif id == 9 then
return tostring(get( getResourceName( getThisResource( ) ).. '.chainsaw' ))
elseif id == 10 then
return tostring(get( getResourceName( getThisResource( ) ).. '.dildo' ))
elseif id == 11 then
return tostring(get( getResourceName( getThisResource( ) ).. 'dildo2' ))
elseif id == 12 then
return tostring(get( getResourceName( getThisResource( ) ).. '.vibrator' ))
elseif id == 13 then
return tostring(get( getResourceName( getThisResource( ) ).. '.vibrator2' ))
elseif id == 14 then
return tostring(get( getResourceName( getThisResource( ) ).. '.flower' ))
elseif id == 15 then
return tostring(get( getResourceName( getThisResource( ) ).. '.cane' ))
elseif id == 16 then
return tostring(get( getResourceName( getThisResource( ) ).. '.grenade' ))
elseif id == 17 then
return tostring(get( getResourceName( getThisResource( ) ).. '.teargas' ))
elseif id == 18 then
return tostring(get( getResourceName( getThisResource( ) ).. '.molotov' ))
elseif id == 22 then
return tostring(get( getResourceName( getThisResource( ) ).. '.colt45' ))
elseif id == 23 then
return tostring(get( getResourceName( getThisResource( ) ).. '.silenced' ))
elseif id == 24 then
return tostring(get( getResourceName( getThisResource( ) ).. '.deagle' ))
elseif id == 25 then
return tostring(get( getResourceName( getThisResource( ) ).. '.shotgun' ))
elseif id == 26 then
return tostring(get( getResourceName( getThisResource( ) ).. '.sawed-off' ))
elseif id == 27 then
return tostring(get( getResourceName( getThisResource( ) ).. '.combatshotgun' ))
elseif id == 28 then
return tostring(get( getResourceName( getThisResource( ) ).. '.uzi' ))
elseif id == 29 then
return tostring(get( getResourceName( getThisResource( ) ).. '.mp5' ))
elseif id == 30 then
return tostring(get( getResourceName( getThisResource( ) ).. '.ak-47' ))
elseif id == 31 then
return tostring(get( getResourceName( getThisResource( ) ).. '.m4' ))
elseif id == 32 then
return tostring(get( getResourceName( getThisResource( ) ).. '.tec-9' ))
elseif id == 33 then
return tostring(get( getResourceName( getThisResource( ) ).. '.rifle' ))
elseif id == 34 then
return tostring(get( getResourceName( getThisResource( ) ).. '.sniper' ))
elseif id == 35 then
return tostring(get( getResourceName( getThisResource( ) ).. '.rocketlauncher' ))
--elseif id == 39 then -- Satchel
--elseif id == 40 then -- Satchel remote (Bomb)
elseif id == 41 then
return tostring(get( getResourceName( getThisResource( ) ).. '.spraycan' ))
elseif id == 42 then
return tostring(get( getResourceName( getThisResource( ) ).. '.fireextinguisher' ))
elseif id == 43 then
return tostring(get( getResourceName( getThisResource( ) ).. '.camera' ))
elseif id == 44 then
return tostring(get( getResourceName( getThisResource( ) ).. '.nightvision' ))
elseif id == 45 then
return tostring(get( getResourceName( getThisResource( ) ).. '.infrared' ))
--elseif id == 46 then -- Parachute
else
return "disabled"
end
return "disabled"
end
addEvent("onGetAmmoPerClip", true)
addEventHandler("onGetAmmoPerClip", getRootElement(), getAmmoPerClip)

function loadWeaponStats()
for id = 0, 45, 1 do
if id ~= 19 and id ~= 20 and id ~=21 then
local tmp = getAmmoPerClip(id)
if tmp == "disable" then
setWeaponProperty( id , "std", "maximum_clip_ammo", 0)
else
setWeaponProperty( id , "std", "maximum_clip_ammo", tmp)
end
end
end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-10-05, 00:06


etrnl

CLASSIC RPG






Wiek: 26
Na forum: 2200 dni
Posty: 86
Nick w MP: anonymous

Piwa: 57

Respekt: 50

Ostrzeżeń: 40%
Daj t? 733 linijk?, bez tego nikt nie sprawdzi co jest pi??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-12-31, 22:39


HarnesHa12







Wiek: 25
Na forum: 1825 dni
Posty: 5



Respekt: 50

"etrnl" napisał/a:

Daj t? 733 linijk?, bez tego nikt nie sprawdzi co jest pi??

Wszystko jest w wiadomo?ci, ca?a funkcja z linijki 733

Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-01-01, 18:37


etrnl

CLASSIC RPG






Wiek: 26
Na forum: 2200 dni
Posty: 86
Nick w MP: anonymous

Piwa: 57

Respekt: 50

Ostrzeżeń: 40%
Funkcja getAmmoPerClip ci zwraca string, a oczekiwa? numer czyli tonumber()

Postaw piwo autorowi tego posta
 

 
Wysłany: 2022-01-01, 21:42


HarnesHa12







Wiek: 25
Na forum: 1825 dni
Posty: 5



Respekt: 50

Zamykam, pobra?em ju? now? wersje (v6) bez ?adnych b??d?w (No prawie).

Postaw piwo autorowi tego posta
 

 
Tagi: niedziałający :: kod
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Niedziałający kod 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