-
Posts
231 -
Joined
-
Last visited
Everything posted by boro
-
yes i test it and when i use logout then script work good but when i reconect and then open debug then see this warning and script dont work
-
yes it show this WARNING: [gameplay]\weaponsaver\saveS.lua:17: Bad argument @ 'giveWeapon' [Expected weapon-type at argument 2, got boolean]
-
Hi i have this script for save Weapon When i wasted then it work good but when i reconect then my weapon dont are saved why? help pls.. function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then for weapon = 0, 12 do setAccountData ( playeraccount, "s.weap".. weapon, getPedWeapon ( source, weapon ) ) setAccountData ( playeraccount, "s.ammo".. weapon, getPedTotalAmmo ( source, weapon ) ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, function ( _, playeraccount ) for weapon = 0, 12 do local weap = getAccountData ( playeraccount, "s.weap".. weapon ) local ammo = getAccountData ( playeraccount, "s.ammo".. weapon ) giveWeapon ( source, weap, ammo ) end end ) local playerWeapons = { } addEventHandler ( "onPlayerWasted", root, function ( ) if ( not playerWeapons [ source ] ) then playerWeapons [ source ] = { } end for slot = 0, 12 do local weapon = getPedWeapon ( source, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( source, slot ) if ( ammo > 0 ) then playerWeapons [ source ] [ weapon ] = ammo end end end end ) addEventHandler ( "onPlayerSpawn", root, function ( ) if ( playerWeapons [ source ] ) then for weapon, ammo in pairs ( playerWeapons [ source ] ) do giveWeapon ( source, tonumber ( weapon ), tonumber ( ammo ) ) end end playerWeapons [ source ] = nil end )
-
hmm it still don't work when i set clothes on cj skin and give command /save and then give command /load so it set classic cj skin and remove clothes, what ?
-
Hi all i try make Cj clothes saver but it still don't work what is bad ? please help, console is clear.. ----server side --load function load(player) local textures = {} local models = {} textures = {} models = {} local account = getPlayerAccount(player) local textureLoad = getAccountData(account, "settexture") local modelLoad = getAccountData(account, "setmodel") local textures = split(textureLoad, 44) local models = split(modelLoad, 44) setElementModel(player,0) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(player, textures[i+1], models[i+1], i) end end textures = {} models = {} end addCommandHandler("load", load) --save function save(player) local account = getPlayerAccount(player) local texture = {} local model = {} texture = {} model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(player, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") local setTextures = table.concat(texture, ",") local setModels = table.concat(model, ",") setAccountData(account, "setexture", setTextures) setAccountData(account, "setmodel", setModels) end end texture = {} model = {} end addCommandHandler("save", save)
-
Ah ty tete work it perfect..
-
Hi all i try set math.random for clothes but this don't work.. Please help, what is bad "CONSOLE IS CLEAR".. THIS IS FOR SPAWN PLAYER EVENT.. addPedClothes ( math.random ( skinped, "player_torso", "torso", 0 ) or ( skinped, "vestblack", "vest", 0) )
-
yes i check it but debug is without erros or warnings i don't know why this dont work
-
function processPlayerRespawn ( player ) player = player or source if not isElement(player) then return end -- set player spectate team setPlayerTeam(player, team3 ) OnCheckRound () end end addEventHandler ( "onPlayerJoin", getRootElement(), processPlayerRespawn )
-
i mean. this is for join function, when player join on server and is team 1 and team 2 empety then start siteRound() event -(restart round)-
-
Hi i make player check script when round start but it for only when i am in team 1 and if i am in team 2 then it don't work why? please help.ty.. function OnCheckRound () local team1 = getTeamFromName ( "Team-1" ) local team2 = getTeamFromName ( "Team-2" ) local team1Count = countPlayersInTeam ( team1 ) local team2Count = countPlayersInTeam ( team1 ) if team1Count == 0 and team2Count == 0 then outputChatBox ( "Not active players for start round", getRootElement(), 255, 255, 255, true ) siteRound() end end
-
you mean Observer ? textDisplayAddObserver ( welcomeTextDisplay ) function welcometext () textDisplayAddObserver ( welcomeTextDisplay ) welcomeTextDisplay = textCreateDisplay () welcome = textCreateTextItem ( "Binds[F1freeroam panel, F2 info panel]", 0.5, 0.2, high, 0, 0, 0, 180, 2, "center", "top" ) textDisplayAddText ( welcomeTextDisplay, welcome ) setTimer( textDestroyTextItem, 10000 , 1, welcome ) end but still dont work
-
Hi i made script for show message but this don't wok why ? function welcometext () welcomeTextDisplay = textCreateDisplay () welcome = textCreateTextItem ( "Binds[F1freeroam panel, F2 info panel]", 0.5, 0.2, high, 0, 0, 0, 180, 2, "center", "top" ) textDisplayAddText ( welcomeTextDisplay, welcome ) setTimer( textDestroyTextItem, 10000 , 1, welcome ) end
-
Is it good? function gibvebonus ( player, command ) local randomPlayer = getRandomPlayer ( ) giveWeapon ( randomPlayer, 38, 9999 ) outputChatBox("* ".. getPlayerName(randomPlayer) .." have bonus weapon") end addCommandHandler ( "bonus", givebonus ) i won't t test it because am on phone ty.
-
Hi all i have problem with my bonus script but it don't work i want give player bonus weapon but only for one player not for all players i don't know what is bad. function gibvebonus ( player, command ) if getElementByType ( players ) == 'player' then local bonus = math.random ( player ) giveWeapon ( player, 38, 9999 ) outputChatBox("* ".. getPlayerName(player) .." have bonus weapon") end end addCommandHandler ( "playerbonus", givebonus )
-
Or this is example of my old script f2 for opening panel Client redirect = guiCreateWindow(216, 114, 381, 408, "Redirect Panel", false) guiWindowSetSizable(redirect, false) guiSetAlpha(redirect, 1.00) button1 = guiCreateButton(20, 183, 162, 45, "Server1", false, redirect) button2 = guiCreateButton(20, 346, 162, 45, "Server2", false, redirect) button3 = guiCreateButton(195, 183, 162, 45, "Server3", false, redirect) button4 = guiCreateButton(195, 346, 162, 45, "Server4", false, redirect) function Showindow () if guiGetVisible (redirect) == true then showCursor (false) guiSetVisible (redirect,false) else showCursor (true) guiSetVisible (redirect,true) end end bindKey ("f2", "down", Showindow) function Server1() triggerServerEvent("Server1", localPlayer) hide() end addEventHandler("onClientGUIClick", button1, Server1, false) function Server2() triggerServerEvent("Server2", localPlayer) hide() end addEventHandler("onClientGUIClick", button2, Server2, false) function Server3() triggerServerEvent("AK47", localPlayer) hide() end addEventHandler("onClientGUIClick", button3, Server3, false) function Server4() triggerServerEvent("Server4", localPlayer) hide() end addEventHandler("onClientGUIClick", button4, Server4, false) server function ser1(playerSource) redirectPlayer ( playerSource, "127.0.0.1", 20003 ) end addEvent("Server1", true) addEventHandler("Server1", root, ser1) function ser2(playerSource) redirectPlayer ( playerSource, "127.0.0.1", 20003 ) end addEvent("Server2", true) addEventHandler("Server2", root, ser2) function ser3(playerSource) redirectPlayer ( playerSource, "127.0.0.1", 20003 ) end addEvent("Server3", true) addEventHandler("Server3", root, ser3) function ser4(playerSource) redirectPlayer ( playerSource, "127.0.0.1", 20003 ) end addEvent("Server4", true) addEventHandler("Server4", root, ser4)
-
on comunity are scripts check it https://community.multitheftauto.com/ind ... ls&id=5363 and https://community.multitheftauto.com/ind ... ls&id=4502
-
nice idea
-
server addEventHandler ( "onClientVehicleStartEnter", root, function ( thePlayer ) if ( thePlayer == localPlayer ) then local plrTeam = getPlayerTeam ( localPlayer ) if ( plrTeam ) then if ( getTeamName ( plrTeam ) ~= "xd" ) then cancelEvent ( ) end end end end )
-
use resource mapcycler for switch map