Jump to content

طلب فنكشات حفض الشخصيه


Recommended Posts

جرب:

-- Save Skin 
addEventHandler ( "onPlayerWasted", getRootElement ( ), onPlayerWasted ) 
function onPlayerWasted ( ) 
if getElementModel ( source ) == 281 then 
setElementModel ( localPlayer, skin ) 
setAccountData ( account, "skin", playerskin ) 
    end 
end) 
- Return Skin 
addEventHandler ( "onPlayerSpawn", getRootElement ( ), onPlayerSpawn ) 
function onPlayerSpawn ( ) 
local current = getElementData(source, "skin") 
local data = getAccountData() 
if getElementModel ( source ) == 281 then 
    end 
end) 

Link to comment
جرب:
-- Save Skin 
addEventHandler ( "onPlayerWasted", getRootElement ( ), onPlayerWasted ) 
function onPlayerWasted ( ) 
if getElementModel ( source ) == 281 then 
setElementModel ( localPlayer, skin ) 
setAccountData ( account, "skin", playerskin ) 
    end 
end) 
- Return Skin 
addEventHandler ( "onPlayerSpawn", getRootElement ( ), onPlayerSpawn ) 
function onPlayerSpawn ( ) 
local current = getElementData(source, "skin") 
local data = getAccountData() 
if getElementModel ( source ) == 281 then 
    end 
end) 

هريسة :D

Link to comment
-- Server Side # 
local skin = {} 
  
addEventHandler ( 'onPlayerWasted', root, function () 
    skin [ source ] = getElementModel ( source ) 
    end 
) 
  
addEventHandler ( 'onPlayerSpawn', root, function () 
    setTimer (setElementModel ,1000,1, source, skin [ source ] ) 
    end 
) 

ما زبط

اسلام عليكم في ب سيرفري مشكله يوم اموت الشخصيه ما تنحفض و تصير شخصيه 0

ابي فنكشات يوم اموت تضل الشخصيه

وين كود السباون؟

تفضل

function viewTheHospital() 
    local theWeapon = getPedWeapon (source) 
    local weaponAmmo = getPedTotalAmmo (source) 
    setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true) 
    local table = findHospital(source) 
    local theMessage = "You have died and been taken to "..table[11] 
    triggerClientEvent(source, "UIPhospital.addHospitalText", source, theMessage) 
    setCameraMatrix(source, table[1], table[2], table[3], table[4], table[5], table[6]) 
    showPlayerHudComponent(source, "all", false) 
    setTimer(finsihHospitalIntro, 4500, 1, source, getElementModel(source), table[7], table[8], table[9], table[10]) 
end 
addEventHandler("onPlayerWasted", root, viewTheHospital) 

Link to comment

جرب ذا

-- Server Side # 
addEventHandler('onPlayerWasted',root, 
function () 
    setElementData(source,"saveskin",0) -- 0 = ايدي الشخصيه 
end ) 
  
addEventHandler('onPlayerSpawn',root, 
function () 
    local saveskin = getElementData(source,"saveskin") 
    setElementModel(source,saveskin) 
end ) 

Link to comment

طيب جرب ذا شغال انا متاكد :/

-- Server Side # 
addEventHandler('onPlayerWasted',root, 
function () 
    setElementData(source,"saveskin",getElementModel(source)) 
end ) 
  
addEventHandler('onPlayerSpawn',root, 
function () 
    local saveskin = getElementData(source,"saveskin") 
    setTimer (setElementModel ,1000,1, source,saveskin) 
end ) 

Note: حفظ كذا تنكتب :/

Link to comment
-- Server Side # 
local skin = {} 
  
addEventHandler ( 'onPlayerWasted', root, function () 
    skin [ source ] = getElementModel ( source ) 
    end 
) 
  
addEventHandler ( 'onPlayerSpawn', root, function () 
    setTimer (setElementModel ,1000,1, source, skin [ source ] ) 
    end 
) 

ما زبط

يا رجل !! ما يحتاج اجربه شغال ...

اطرح ملف سيرفر والميتا .

Link to comment

هي ملف سيرفر

local hospitalTable = {} 
local hospitals = { 
    -- mx, my, mz, tarx, tary, tarz, x, y, z, rot, name 
    [1] = {1218, -1322, 15, 1217, -1322, 15, 1173, -1323, 15, 270, "All Saints Hospital"}, -- All Saints 
    [2] = {2033, -1439, 19, 2033, -1438, 18, 2038, -1411, 17, 130, "Jefferson Hospital."}, --Jefferson 
    [3] = {1254, 352, 21, 1254, 351, 21, 1242, 327, 19, 340, "Red County Hospital."}, -- Red County 
    [4] = {1590, 1862, 12, 1590, 1861, 12, 1609, 1816, 12, 360, "Las Venturas Hospital."}, -- Las Venturas 
    [5] = {-2660, 580, 16, -2660, 581, 16, -2655, 635, 14, 180, "San Fierro Hospital."}, -- San Fierro 
    [6] = {-2181, -2289, 32, -2181, -2290, 32, -2200, -2311, 30, 320, "Angel Pine Hospital."}, -- Angel Pine 
    [7] = {3886, 1498, 14, -2181, -2290, 32,3887, 1458, 13, 320, "Angel Hospital."} -- Angel 
} 
  
function viewTheHospital() 
    local theWeapon = getPedWeapon (source) 
    local weaponAmmo = getPedTotalAmmo (source) 
    setTimer (giveWeapon, 2000, 1, source, theWeapon, weaponAmmo, true) 
    local table = findHospital(source) 
    local theMessage = "You have died and been taken to "..table[11] 
    triggerClientEvent(source, "UIPhospital.addHospitalText", source, theMessage) 
    setCameraMatrix(source, table[1], table[2], table[3], table[4], table[5], table[6]) 
    showPlayerHudComponent(source, "all", false) 
    setTimer(finsihHospitalIntro, 4500, 1, source, getElementModel(source), table[7], table[8], table[9], table[10]) 
end 
addEventHandler("onPlayerWasted", root, viewTheHospital) 
  
function finsihHospitalIntro(player, model, x, y, z, rotation) 
    if (isElement(player)) then 
        fadeCamera(player, false, 0) 
        setTimer(fadeCamera, 1000, 1, player, true) 
        setCameraTarget(player, player) 
        showPlayerHudComponent(player, "all", true) 
        spawnPlayer(player, x, y, z, rotation, model, 0, 0) 
            hospitalTable[player] = nil 
      end 
      end 
  
function findHospital(plr) 
    if (isElement(plr)) then 
        local theHospital = nil 
        local miniumDistance = 2000 
        for index, pos in pairs(hospitals) do 
            local px, py, pz = getElementPosition(plr) 
            local x, y = pos[7], pos[8] 
            local distance = getDistanceBetweenPoints2D(px, py, x, y) 
            if (distance < miniumDistance) then 
                theHospital = pos 
                miniumDistance = distance 
            end 
        end 
        hospitalTable[plr] = theHospital 
        return hospitalTable[plr] 
    end 
end 
----------------------- 
local skin = {} 
  
addEventHandler ( 'onPlayerWasted', root, function () 
    skin [ source ] = getElementModel ( source ) 
    end 
) 
  
addEventHandler ( 'onPlayerSpawn', root, function () 
    setTimer (setElementModel ,1000,1, source, skin [ source ] ) 
    end 
) 

وهي الميتا

    

ملف سيرفر اسمه

hospital1.lua

Link to comment

Mr.alkmasha

جرب كودي الله يصلحك -_-

طيب جرب ذا شغال انا متاكد :/
-- Server Side # 
addEventHandler('onPlayerWasted',root, 
function () 
    setElementData(source,"saveskin",getElementModel(source)) 
end ) 
  
addEventHandler('onPlayerSpawn',root, 
function () 
    local saveskin = getElementData(source,"saveskin") 
    setTimer (setElementModel ,1000,1, source,saveskin) 
end ) 

Note: حفظ كذا تنكتب :/

Link to comment
  • Moderators

اخوي ملف السيرفر معك خليه فااضي امسح كل شي وخلي الاكواد هاذي فيه فقط

  
-- the Code By the Best  
local skin = {} 
  
  
  
addEventHandler ( 'onPlayerWasted', root, function () 
  
    skin [ source ] = getElementModel ( source ) 
  
    end 
  
) 
  
  
  
addEventHandler ( 'onPlayerSpawn', root, function () 
  
    setTimer (setElementModel ,1000,1, source, skin [ source ] ) 
  
    end 
  
) 
  

ارجع وأكرر ملف السيرفر الي معك خليه فاضي وحط الاكواد الي فوق فيه .

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...