Witajcie, korzystam z gamemode GOYD, lecz mam ma?y problem, mianowicie wgra?em osobny plik na zapis skin?w i pieni?dzy, wszystko jest tam git. Problem polega na tym, ?e ten Gamemode ma w sobie plik "inne". Znajduje si? w nim co? takiego, ?e po respawnie nasz skin automatycznie zmienia si? na skin CJ, a chc? by pozosta? taki sam jak by?. Pomo?ecie?
addEventHandler("onPlayerConnect", root, function(playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber)
if string.find(playerNick, "#") ~= nil then
cancelEvent(true, "Na serwerze zakazuje si? gry z kolorowym nickiem, zmie? nick i po??cz si? ponownie!")
end
end)
-- needs configurable blip colors, and team support
root = getRootElement ()
color = { 0, 150, 100 }
players = {}
resourceRoot = getResourceRootElement ( getThisResource () )
function onResourceStart ( resource )
for id, player in ipairs( getElementsByType ( "player" ) ) do
if ( players[player] ) then
createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] )
else
createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] )
end
end
end
function onPlayerSpawn ( spawnpoint )
if ( players[source] ) then
createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] )
else
createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] )
end
end
function onPlayerQuit ()
destroyBlipsAttachedTo ( source )
end
function onPlayerWasted ( totalammo, killer, killerweapon )
destroyBlipsAttachedTo ( source )
end
function setBlipsColor ( source, commandName, r, g, b )
if ( tonumber ( b ) ) then
color = { tonumber ( r ), tonumber ( g ), tonumber ( b ) }
for id, player in ipairs( getElementsByType ( "player" ) ) do
destroyBlipsAttachedTo ( player )
if ( players[player] ) then
createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] )
else
createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] )
end
end
end
end
function setBlipColor ( source, commandName, r, g, b )
if ( tonumber ( b ) ) then
destroyBlipsAttachedTo ( source )
players[source] = { tonumber ( r ), tonumber ( g ), tonumber ( b ) }
createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] )
end
end
function destroyBlipsAttachedTo(player)
local attached = getAttachedElements ( player )
if ( attached ) then
for k,element in ipairs(attached) do
if getElementType ( element ) == "blip" then
destroyElement ( element )
end
end
end
end
function wybuch (loss)
local hp = getElementHealth(source) - loss
if hp <= 315 then
setVehicleDamageProof(source, true)
setElementHealth(source, 315)
setVehicleDamageProof(source, false)
cancelEvent()
end
end
addEventHandler("onVehicleDamage", getRootElement(), wybuch)
function message (thePlayer)
local pojazd = getPedOccupiedVehicle( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
outputChatBox("* Pomy?lnie ustawiono 100 litr?w paliwa!", thePlayer, 253, 0, 0)
setElementData(pojazd, "pojazd_paliwo", 100)
end
end
addCommandHandler("daj.paliwo", message)
addEventHandler("onPlayerLogin", root, function()
for _,v in ipairs ( getElementsByType("player") ) do
outputChatBox("Witaj na serwerze One Life!", source)
outputChatBox("Potrzebujesz pomocy? Zajrzyj pod F1.", source)
id = tonumber ( getAccountData ( getPlayerAccount ( source ), "stary:skin" ) )
setElementModel ( source, id )
setAccountData ( getPlayerAccount ( source ), "stary:skin", false )
removeElementData(source,"Praca")
takeWeapon(source, 22)
end
end)
addEventHandler("onResourceStart", resourceRoot,
function()
for i,player in ipairs(getElementsByType("player")) do
spawn(player)
end
end
)
function spawn(player)
if not isElement(player) then return end
repeat until spawnPlayer ( player, -1916.479,882.01,35.41, 0, "stary:skin" ) --Ustawiamy SPAWN Gracza po przecniku macie randomowe skiny.
fadeCamera(player, true)
setCameraTarget(player, player)
end
addEventHandler("onPlayerJoin", root,
function()
spawn(source)
end
)
addEventHandler("onPlayerWasted", root,
function()
setTimer(spawnwasted, 3500, 1, source)
end
)
function spawnwasted(player)
spawnPlayer ( player , -1916.479,882.01,35.41 ) --Spawn po zabicu takePlayerMoney to ile pieniedzy ma zabierac za szpital
takePlayerMoney ( player, 0 )
end
Podpis
Projekt serwera : ourStory
Adres Forum : www.our-story.pl
Rejestruj się już dziś !
FAQ: Potrzebujesz pomocy w kodowaniu LUA,PHP ? Pisz śmiało postaram się pomóc .
Pomagam tworzyć strony internetowe ! Potrzebujesz? Pisz
addEventHandler("onPlayerConnect", root, function(playerNick, playerIP, playerUsername, playerSerial, playerVersionNumber)
if string.find(playerNick, "#") ~= nil then
cancelEvent(true, "Na serwerze zakazuje si? gry z kolorowym nickiem, zmie? nick i po??cz si? ponownie!")
end
end)
-- needs configurable blip colors, and team support
root = getRootElement ()
color = { 0, 150, 100 }
players = {}
resourceRoot = getResourceRootElement ( getThisResource () )
function onResourceStart ( resource )
for id, player in ipairs( getElementsByType ( "player" ) ) do
if ( players[player] ) then
createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] )
else
createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] )
end
end
end
function onPlayerSpawn ( spawnpoint )
if ( players[source] ) then
createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] )
else
createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] )
end
end
function onPlayerQuit ()
destroyBlipsAttachedTo ( source )
end
function onPlayerWasted ( totalammo, killer, killerweapon )
destroyBlipsAttachedTo ( source )
end
function setBlipsColor ( source, commandName, r, g, b )
if ( tonumber ( b ) ) then
color = { tonumber ( r ), tonumber ( g ), tonumber ( b ) }
for id, player in ipairs( getElementsByType ( "player" ) ) do
destroyBlipsAttachedTo ( player )
if ( players[player] ) then
createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] )
else
createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] )
end
end
end
end
function setBlipColor ( source, commandName, r, g, b )
if ( tonumber ( b ) ) then
destroyBlipsAttachedTo ( source )
players[source] = { tonumber ( r ), tonumber ( g ), tonumber ( b ) }
createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] )
end
end
function destroyBlipsAttachedTo(player)
local attached = getAttachedElements ( player )
if ( attached ) then
for k,element in ipairs(attached) do
if getElementType ( element ) == "blip" then
destroyElement ( element )
end
end
end
end
function wybuch (loss)
local hp = getElementHealth(source) - loss
if hp <= 315 then
setVehicleDamageProof(source, true)
setElementHealth(source, 315)
setVehicleDamageProof(source, false)
cancelEvent()
end
end
addEventHandler("onVehicleDamage", getRootElement(), wybuch)
function message (thePlayer)
local pojazd = getPedOccupiedVehicle( thePlayer )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
outputChatBox("* Pomy?lnie ustawiono 100 litr?w paliwa!", thePlayer, 253, 0, 0)
setElementData(pojazd, "pojazd_paliwo", 100)
end
end
addCommandHandler("daj.paliwo", message)
addEventHandler("onPlayerLogin", root, function()
for _,v in ipairs ( getElementsByType("player") ) do
outputChatBox("Witaj na serwerze One Life!", source)
outputChatBox("Potrzebujesz pomocy? Zajrzyj pod F1.", source)
id = tonumber ( getAccountData ( getPlayerAccount ( source ), "stary:skin" ) )
setElementModel ( source, id )
setAccountData ( getPlayerAccount ( source ), "stary:skin", false )
removeElementData(source,"Praca")
takeWeapon(source, 22)
end
end)
addEventHandler("onResourceStart", resourceRoot,
function()
for i,player in ipairs(getElementsByType("player")) do
spawn(player)
end
end
)
function spawn(player)
if not isElement(player) then return end
repeat until spawnPlayer ( player, -1916.479,882.01,35.41, 0, "stary:skin" ) --Ustawiamy SPAWN Gracza po przecniku macie randomowe skiny.
fadeCamera(player, true)
setCameraTarget(player, player)
end
addEventHandler("onPlayerJoin", root,
function()
spawn(source)
end
)
addEventHandler("onPlayerWasted", root,
function()
setTimer(spawnwasted, 3500, 1, source)
end
)
function spawnwasted(player)
spawnPlayer ( player , -1916.479,882.01,35.41 ) --Spawn po zabicu takePlayerMoney to ile pieniedzy ma zabierac za szpital
takePlayerMoney ( player, 0 )
end
teraz si? zrespi?em, ale skin i tak zmienia si? na CJ'a
function spawnwasted(player)
id = tonumber ( getAccountData ( getPlayerAccount ( player ), "stary:skin" ) )
spawnPlayer ( player , -1916.479,882.01,35.41, 0, id ) --Spawn po zabicu takePlayerMoney to ile pieniedzy ma zabierac za szpital
takePlayerMoney ( player, 0 )
end
Podpis
San Fierro Stories Roleplay
Ostatnio zmieniony przez zabijaka2000 2016-12-12, 20:22, w całości zmieniany 1 raz
function spawnwasted(player)
id = tonumber ( getAccountData ( getPlayerAccount ( player ), "stary:skin" ) )
spawnPlayer ( player , -1916.479,882.01,35.41, 0, id ) --Spawn po zabicu takePlayerMoney to ile pieniedzy ma zabierac za szpital
takePlayerMoney ( player, 0 )
end
po tym jest cj
[ Dodano: 2016-12-12, 22:20 ]
function spawnWasted(player)
spawnPlayer ( player,-1936.62109375, 891.6923828125, 38.5078125 + 0.5, 0, getElementModel(player))
setCameraTarget(player, player)
setElementInterior(player, 0)
setElementDimension(player, 0)
end
addEventHandler("onPlayerWasted", root,
function()
setTimer(spawnWasted, 6000, 1, source)
end
)
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