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

Wysłany: 2020-03-07, 18:42


Vander0832

Mapper/Grafik






Wiek: 28
Na forum: 3644 dni
Posty: 52
Nick w MP: Vanderek

Piwa: 1105

Respekt: 55,3

Witam, mam problem z frakcjami. Zawsze po restarcie serwera nie mog? nikomu nada? frakcji, bo jest napisane "Nieprawid?owe id Frakcji" , baza dzia?a, przy tworzeniu frakcja pokazuje si? w bazie i ci?gle tam jest, ale nada? si? nie da. Stawiam piwko za pomoc!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-07, 21:20


P.Wiśnia

Programista LUA






Wiek: 24
Na forum: 4045 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 376

Respekt: 100
Respekt: 100

Co? wi?cej? Wycinki skrypt?w?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-07, 22:29


Vander0832

Mapper/Grafik






Wiek: 28
Na forum: 3644 dni
Posty: 52
Nick w MP: Vanderek

Piwa: 1105

Respekt: 55,3

P.Wi?nia, Problem w tym, ?e nie wiadomo kt?ry skrypt za to odpowiada, bo na debugscript 3 nie ma ?adnego b??du. Nie wiem czy skrypt od systemu frakcji ci da? czy ten od komendy

[ Dodano: 2020-03-07, 22:59 ]
Vandeeeeer!#7096
Napisz tutaj na dc to si? szybciej dogadamy. Je?li m?g?bym prosi?

[ Dodano: 2020-03-07, 23:18 ]
Nie wiem o co chodzi, ale w wi?kszo?ci b??d?w wyskakuje tylko ten b??d

Kod:

admin-system/Player/s_player_commands.lua:734: Expected number, got non-convertible string. This warning may be an error in future versions.


Kod:

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) ------ 734 linijka
end
end
end
end
addEventHandler ( "onResourceStart", getRootElement(), loadWeaponStats )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-07, 23:44


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Wklej funkcj? getAmmoPerClip.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-07, 23:51


Vander0832

Mapper/Grafik






Wiek: 28
Na forum: 3644 dni
Posty: 52
Nick w MP: Vanderek

Piwa: 1105

Respekt: 55,3

Wilq, Ona jest wklejona nad tym

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-08, 00:08


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Dobrze.
No to przet?umacz? Ci b??d, a funkcj? getAmmoPerClip ju? sobie sam naprawisz (bo ja jej nie poosiadam i nie widz? jej we wklejonym przez Ciebie kodzie):
w funkcji setWeaponProperty czwarty (#4) argument musi by? liczb? - a pod zmienn? tmp kryje si? niekonwertowalny ci?g znak?w (s?owo).

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Vander0832
Wysłany: 2020-03-08, 00:27


Vander0832

Mapper/Grafik






Wiek: 28
Na forum: 3644 dni
Posty: 52
Nick w MP: Vanderek

Piwa: 1105

Respekt: 55,3

Wilq, Nie ogarn? tego za bardzo, bo jestem jeden stopie? do g?ry ni? "zielony", masz tutaj funkcj? tego, bo nie ogarn? co wstawi? za to tmp. Bo z tego co widz? to tmp jest danym id(chyba):

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)


[ Dodano: 2020-03-08, 01:31 ]
P.Wi?nia, Tutaj masz funkcj? odno?nie nadania frakcji

Kod:

function adminSetPlayerFaction(thePlayer, commandName, partialNick, factionID)
if exports.integration:isPlayerTrialAdmin(thePlayer) then
factionID = tonumber(factionID)
if not (partialNick) or not (factionID) then
outputChatBox("PRZYK?AD: /" .. commandName .. " [Player Partial Name/ID] [Faction ID (-1 for none)]", thePlayer, 255, 194, 14)
else
local targetPlayer, targetPlayerNick = exports.global:findPlayerByPartialNick(thePlayer, partialNick)

if targetPlayer then
local theTeam = exports.pool:getElement("team", factionID)
if not theTeam and factionID ~= -1 then
outputChatBox("Nieprawid?owe ID frakcji.", thePlayer, 255, 0, 0)
return
end

if mysql:query_free("UPDATE characters SET faction_leader = 0, faction_id = " .. factionID .. ", faction_rank = 1, faction_phone = NULL, duty = 0 WHERE id=" .. getElementData(targetPlayer, "dbid")) then
setPlayerTeam(targetPlayer, theTeam)
if factionID > 0 then
exports.anticheat:changeProtectedElementDataEx(targetPlayer, "faction", factionID, true)
exports.anticheat:changeProtectedElementDataEx(targetPlayer, "factionrank", 1, true)
exports.anticheat:changeProtectedElementDataEx(targetPlayer, "factionphone", nil, true)
--triggerClientEvent(targetPlayer, "updateFactionInfo", targetPlayer, factionID, 1)
exports.anticheat:changeProtectedElementDataEx(targetPlayer, "factionleader", 0, true)
triggerEvent("duty:offduty", targetPlayer)

outputChatBox("Gracz " .. targetPlayerNick .. " jest teraz cz?onkiem '" .. getTeamName(theTeam) .. "' (#" .. factionID .. ").", thePlayer, 0, 255, 0)

triggerEvent("onPlayerJoinFaction", targetPlayer, theTeam)
outputChatBox("Zosta?e? dodany do frakcji '" .. getTeamName(theTeam) .. "'.", targetPlayer, 255, 194, 14)

exports.logs:dbLog(thePlayer, 4, { targetPlayer, theTeam }, "SET TO FACTION")
else
-- Citizen bug fix by Anthony
local citizenTeam = getTeamFromName("Citizen")
setPlayerTeam(targetPlayer, citizenTeam)
exports.anticheat:changeProtectedElementDataEx(targetPlayer, "faction", -1, true)
exports.anticheat:changeProtectedElementDataEx(targetPlayer, "factionrank", 1, true)
exports.anticheat:changeProtectedElementDataEx(targetPlayer, "factionphone", nil, true)
exports.anticheat:changeProtectedElementDataEx(targetPlayer, "factionleader", 0, true)
--triggerClientEvent(targetPlayer, "updateFactionInfo", targetPlayer, -1, 1)
if getElementData(targetPlayer, "duty") and getElementData(targetPlayer, "duty") > 0 then
takeAllWeapons(targetPlayer)
exports.anticheat:changeProtectedElementDataEx(targetPlayer, "duty", 0, true)
end

outputChatBox("Gracz " .. targetPlayerNick .. " zosta? usuni?ty z frakcji.", thePlayer, 0, 255, 0)
outputChatBox("Zosta?e? usuni?ty z frakcji.", targetPlayer, 255, 0, 0)

exports.logs:dbLog(thePlayer, 4, { targetPlayer }, "REMOVE FROM FACTION")
end
end
end
end
end
end
addCommandHandler("setfaction", adminSetPlayerFaction, false, false)


[ Dodano: 2020-03-08, 01:45 ]
Dodam, ?e po restarcie skryptu w konsoli wszystko dzia?a, ale po restarcie wyrzuca z frakcji i nie dzia?a komenda

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-08, 13:51


NoTenTego







Wiek: 30
Na forum: 2294 dni
Posty: 11
Nick w MP: NoTenTego

Piwa: 53

Respekt: 50

Sk?d masz ten GM? U mnie mo?esz znale?? dzia?aj?c? wersje frakcji.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-08, 15:00


Vander0832

Mapper/Grafik






Wiek: 28
Na forum: 3644 dni
Posty: 52
Nick w MP: Vanderek

Piwa: 1105

Respekt: 55,3

NoTenTego, Najlepsze jest to, ?e od ciebie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-09-26, 23:29


RetinaXmapper







Wiek: 25
Na forum: 2195 dni
Posty: 1
Nick w MP: RetinaXmapper



Respekt: 50

"Vander0832" napisał/a:

Witam, mam problem z frakcjami. Zawsze po restarcie serwera nie mog? nikomu nada? frakcji, bo jest napisane "Nieprawid?owe id Frakcji" , baza dzia?a, przy tworzeniu frakcja pokazuje si? w bazie i ci?gle tam jest, ale nada? si? nie da. Stawiam piwko za pomoc!


/restart ID-system byczeq

Postaw piwo autorowi tego posta
 

 
Tagi: owl :: gaming :: frakcje
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Owl Gaming - Frakcje Odpowiedz do tematu

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