-
Posts
143 -
Joined
-
Last visited
Everything posted by Annas
-
help me please ! i need anyone Fix my code pls ! function changeSkin(oldModel, newModel) if (getElementType(source) == "player") then if (newModel == 0) then executeCommandHandler ("loadClothes", source) end end addEventHandler("onElementModelChange", root, changeSkin)
-
Make sure you have the script server side in the meta. : (it's SERVER SIDE) Does the command "loadClothes" work when you use it in F8? : (yes, working it load the last clothes ..) The command is in server side or client side? : (it's in SERVER SIDE) server.lua = function loadClothes(player) local account = getPlayerAccount(player) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(player, textures[i+1], models[i+1], i) end end exports.CSTtexts:output("Your CJ Clothes were added Back", 0, 255, 0, true) textures = {} models = {} else outputChatBox("Please login!", player, 255, 0, 0) end end addCommandHandler("loadClothes", loadClothes) HELP ..
-
when i changed skin number 0 (CJ) then Execute Command Handler ("loadClothes") i try to make this .. but idk why it's not work HELP function changeSkin(oldModel, newModel) if (getElementType(source) == "player") then if (newModel == 0) then executeCommandHandler ("loadClothes", source) end end addEventHandler("onElementModelChange", root, changeSkin)
-
not work , when i reconnect , clothes not saved ..
-
So .. MY CODE : --[[ original script by iAnnAs (iannas ben ahmed) --]] function saveClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) and ( getElementModel(source) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(source, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} end end addEventHandler("onPlayerQuit", getRootElement(), saveClothes) function setClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(source, textures[i+1], models[i+1], i) end end exports.CSTtexts:sendMessage("Your CJ Clothes were added Back", 0, 255, 0, true) textures = {} models = {} end end addEventHandler("onPlayerLogin", getRootElement(), setClothes) function loadClothes(player) local account = getPlayerAccount(player) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(player, textures[i+1], models[i+1], i) end end exports.CSTtexts:sendMessage("Your CJ Clothes were added Back", 0, 255, 0, true) textures = {} models = {} else outputChatBox("Please login!", player, 255, 0, 0) end end addCommandHandler("loadClothes", loadClothes) function saveClothes(player) local account = getPlayerAccount(player) if ( not isGuestAccount(account) ) then if ( getElementModel(player) == 0 ) then local texture = {} local 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, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} else exports.CSTtexts:sendMessage("Your skin must be skin 0 (CJ Skin)", 255, 0, 0, true) end else outputChatBox("Please login!", player, 255, 0, 0) end end addCommandHandler("saveClothes", saveClothes)
-
i try your code , but not working
-
not work .. 1-i add this LUA in SERVER SIDE 2-i get clothes 3-reconnect 4-clothes saved (thx) 5-i changed the skin id to 230 6-reconnect 7-back the CJ skin (not saved , the CJ didn't have any clothes) HELP pls .
-
as what i said mr.Walid , it's working , clothes saved but .. when i change it to any other Skin ID + reconnect and back the skin to CJ skin , (CLOTHES is setted back to 0)
-
tryed --[[ original script by iAnnAs (iannas ben ahmed) --]] function saveClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) and ( getElementModel(source) == 0 ) then local texture = {} local model = {} for i=0, 17, 1 do local clothesTexture, clothesModel = getPedClothes(source, i) if ( clothesTexture ~= false ) then table.insert(texture, clothesTexture) table.insert(model, clothesModel) else table.insert(texture, " ") table.insert(model, " ") end end local allTextures = table.concat(texture, ",") local allModels = table.concat(model, ",") outputDebugString("Clothessaver: Saved clothes") setAccountData(account, "Clothessaver:Texture", allTextures) setAccountData(account, "Clothessaver:Model", allModels) texture = {} model = {} end end addEventHandler("onPlayerQuit", getRootElement(), saveClothes) function setClothes() local account = getPlayerAccount(source) if ( not isGuestAccount(account) ) then local textureString = getAccountData(account, "Clothessaver:Texture") local modelString = getAccountData(account, "Clothessaver:Model") local textures = split(textureString, 44) local models = split(modelString, 44) for i=0, 17, 1 do if ( textures[i+1] ~= " " ) then addPedClothes(source, textures[i+1], models[i+1], i) end end exports.CSTtexts:sendMessage("Your CJ Clothes were added Back", 0, 255, 0, true) textures = {} models = {} end end addEventHandler("onPlayerLogin", getRootElement(), setClothes)
-
.. idk if it hard or not , but SCRIPTERS can make it .. i need to SAVE CLOTHES of CJ i one a SAVE SYSTEM FOR IT but when i change the skin to any number (not 0=CJ) and reconnect , + back to CJ skin , clothes will not still saved Help me with CLOTHES SAVE .. i wish you understand .. IF YOU NEED THE SCRIPT THAT'S I USED : clothes saver (saveclothes) https://community.multitheftauto.com/ind ... ls&id=1868
-
hi , i have a big problem : Occupation not saved .. how can i know the DATABASE of the Occupation ? when i do ./criminal , it showed in the TAB : |OCCUPATION| |Criminal| when i dead , the occupation saved , when i kill some one occupation saved , but when i reconnect or disconnect + when i back in game , the occupation will not saved .. and there are no any occupation in the OCCUPATION in Scoreboard pls help me ! the database : function createTeamsOnStart () teamCriminal = createTeam ( "Criminal", 255, 0, 0 ) end addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart) function goCrim ( player, command ) setPlayerTeam ( player, teamCriminal ) setPlayerNametagColor ( player, 255,0,0 ) setElementData(player, "Occupation", "Criminal") end addCommandHandler ( "criminal", goCrim ) setElementData(player, "Occupation", "Criminal") i wanna it when i be in any Occupation , it will be saved when i reconnect . and thx
-
Sure i do function consoleSetPlayerGravity ( player, commandName, level ) if ( player ) then local money = getPlayerMoney(player) if money >= 15000 then takePlayerMoney ( player, 15000) else outputChatBox("You dont have enough of money to use weed",player, 255, 0, 0) end local success = setPedGravity ( player, tonumber ( 0.0055 ) ) if (not success) then outputConsole( "Failed to set player gravity", player ) outputChatBox("Weed is now Activated (it will auto Disabled when you Disconnect)",player, 255, 171, 0) end end end addCommandHandler ( "sb", consoleSetPlayerGravity ) but the probelem it not showed this when you buy it: HELP
-
pls complete LUA and thxx <3
-
working thx , now i need it if you dont have money then say "you dont have enout of money to buy this"
-
i try to make (gravity) only Ped(player) have gravity , (no vehicles, no aircrafts) function consoleSetPlayerGravity ( player, commandName, level ) if ( player ) then local success = setPedGravity ( player, tonumber ( 0.0060 ) ) takePlayerMoney ( player, 50000) if (not success) then outputConsole( "Failed to set player gravity", player ) end end end addCommandHandler ( "setplayergravity", setPlayerGravity ) but idk why it not work + i wanna only who do this command "setplayergravity" can be in this type of gravity ."0.0060"
-
shit not work .. i make it CLEINT SIDE = not work SERVER SIDE = Not Work pls help me ..
-
i need a stuff for STAFF TEAM .. when i click "C" Bind , the vehicle stoped in 1sec in it PLACE . (i need it only team named "Staff" can do this ..) Thx.
-
guys still have a problem .. when im not in a vehicle it showed Flying Cars is now Enabled Flying Cars is now Disabled i wanna it only with vehicle can let it showed ..
-
not work --------------- trying WALID LUA .. --------------- Working thx @Walid , but can you make it if i press JUMP boutom it will start/stop the flying ? btw thx .. --------------- i add it with my self , ./lock
-
i try to make a simple script (Flying cars , only with team named "Staff") CLIENT SIDE cst = false function fly(player) if isPlayerInTeam(player, "Staff") then if (cst == false) then cst = true setWorldSpecialPropertyEnabled("aircars", true) triggerServerEvent("onFly", getLocalPlayer()) else cst = false setWorldSpecialPropertyEnabled("aircars", false) triggerServerEvent("offFly", getLocalPlayer()) end end addCommandHandler("fly", fly) SERVER SIDE function on() outputChatBox("Flying Cars is now Enabled", source, 255, 255, 255, true) end addEvent("onFly", true) addEventHandler("onFly", getRootElement(), on) function off(thePlayer) outputChatBox("Flying Cars is now Disabled", source, 255, 255, 255, true) end addEvent("offFly", true) addEventHandler("offFly", getRootElement(), off) this resource taked from the Community.mtasa , so i edit it + try to add some more things ..
-
hello community Member , so .. i try to create a simple resource But idk why it's not work CLIENT SIDE : function donatorL1 ( source, commandName, teamName ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "DL1" ) ) then outputChatBox("Welcome To Your Donator Level 1", source, 60, 255, 0) end end addEventHandler ( "onPlayerLogin", donatorL1 ) my work is about : when a player in ACL Group "DL1" then when he logged in (outPut in His ChatBox "Welcome To Your Donator Level 1" ) idk why it's not work ..
-
Yeh next time try to do it by yourself , so i recommend your to read this page before you start thinking to use leaked resources. so it's ok .. can you help me with this last script ? (i swear i just have 2 leaked scripts (Group system/Turf System) and others are mine ..
-
idk , let me check 1min .. ----------------------------------------- , Mr.Pro yes it's Server Side function="getPlayerGang" type="server"/> So what i'll do now ? make a copy and edit it to Client Side ? Like this function="getPlayerGang" type="client"/> lol, now i will never help you because you have proved to me that you are not the owner of the script . Leacked resource. so ?? , if it's not my script ? no help ?