Jump to content

استفسارات عن بعض الحاجات


Recommended Posts

السلام عليكم

اخواني انا سويت مود للزومبي وتلقون السيرفر في التوقيع اتمنى تزورونه :roll:

هذا شغلي انا واحد مبتدأ اتمنى تشوفونه وهيك

اخواني حبيت استفسر

الحين اللي في السيرفر يقتلون بعض

كيف اخلي الزوار ما يقتلون بعض

+

ابي حفظ الفلوس لاهنتم

انتظر ردودكم

Link to comment

https://wiki.multitheftauto.com/wiki/OnPlayerDamage

https://wiki.multitheftauto.com/wiki/CancelEvent

, وحفظ الفلوس / لوبحثت في الويكي لقيت مثال

function onPlayerQuit ( ) 
      -- when a player leaves, store his current money amount in his account data 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) and not isGuestAccount ( playeraccount ) then -- if the player is logged in 
            local playermoney = getPlayerMoney ( source ) -- get the player money 
            setAccountData ( playeraccount, "piraterpg.money", playermoney ) -- save it in his account 
      end 
end 
  
function onPlayerLogin (_, playeraccount ) 
      -- when a player logins, retrieve his money amount from his account data and set it 
      if ( playeraccount ) then 
            local playermoney = getAccountData ( playeraccount, "piraterpg.money" ) 
            -- make sure there was actually a value saved under this key (check if playermoney is not false). 
            -- this will for example not be the case when a player plays the gametype for the first time 
            if ( playermoney ) then 
                  setPlayerMoney ( source, playermoney ) 
            end 
      end 
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin) 

Link to comment

https://wiki.multitheftauto.com/wiki/OnPlayerDamage

https://wiki.multitheftauto.com/wiki/CancelEvent

, وحفظ الفلوس / لوبحثت في الويكي لقيت مثال

function onPlayerQuit ( ) 
      -- when a player leaves, store his current money amount in his account data 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) and not isGuestAccount ( playeraccount ) then -- if the player is logged in 
            local playermoney = getPlayerMoney ( source ) -- get the player money 
            setAccountData ( playeraccount, "piraterpg.money", playermoney ) -- save it in his account 
      end 
end 
  
function onPlayerLogin (_, playeraccount ) 
      -- when a player logins, retrieve his money amount from his account data and set it 
      if ( playeraccount ) then 
            local playermoney = getAccountData ( playeraccount, "piraterpg.money" ) 
            -- make sure there was actually a value saved under this key (check if playermoney is not false). 
            -- this will for example not be the case when a player plays the gametype for the first time 
            if ( playermoney ) then 
                  setPlayerMoney ( source, playermoney ) 
            end 
      end 
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin) 

It should also be noted that canceling this event has no effect. Cancel the client-side event onClientPlayerDamage instead.

الحين أنت حاط هالرابط ذا و أنت ما قرأت الي فيه؟

!!!!!!!!!!!!!!!!!!!!!

Link to comment
---Save Script By X-SHADOW ! 
----ServerSide 
function onPlayerQuit() 
    local playerAccount = getPlayerAccount(source) 
    if (playerAccount) and not isGuestAccount(playerAccount) then 
        local playerMoney = getPlayerMoney(source) 
        setAccountData(playerAccount, "money", playerMoney) 
    end 
end 
addEventHandler("onPlayerQuit", getRootElement(), onPlayerQuit) 
  
function onPlayerLogin() 
    local playerAccount = getPlayerAccount(source) 
    if (playerAccount) and not isGuestAccount(playerAccount) then 
        local playerMoney = tonumber(getAccountData(playerAccount, "money")) 
        if (playerMoney ) then 
            setPlayerMoney(source, playerMoney) 
        end 
    end 
end 
addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin) 
  
---ClientSide 
addEventHandler ( "onClientPlayerDamage", getRootElement(), cancelEvent ) 

Link to comment
طيب الحين وش الكود الصح هع ؟

حفظ الفلوس

function onPlayerQuit ( ) 
      -- when a player leaves, store his current money amount in his account data 
      local playeraccount = getPlayerAccount ( source ) 
      if ( playeraccount ) and not isGuestAccount ( playeraccount ) then -- if the player is logged in 
            local playermoney = getPlayerMoney ( source ) -- get the player money 
            setAccountData ( playeraccount, "piraterpg.money", playermoney ) -- save it in his account 
      end 
end 
  
function onPlayerLogin (_, playeraccount ) 
      -- when a player logins, retrieve his money amount from his account data and set it 
      if ( playeraccount ) then 
            local playermoney = getAccountData ( playeraccount, "piraterpg.money" ) 
            -- make sure there was actually a value saved under this key (check if playermoney is not false). 
            -- this will for example not be the case when a player plays the gametype for the first time 
            if ( playermoney ) then 
                  setPlayerMoney ( source, playermoney ) 
            end 
      end 
end 
  
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) 
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin) 

منع القتال

addEventHandler ( "onClientPlayerDamage", getRootElement(), cancelEvent ) 

Link to comment

Server side

وضع اللاعبين في فريق ومنعهم من قتل بعضهم البعض

players = createTeam ( "Players", 255, 255, 255 ) 
addEventHandler("onPlayerJoin", 
function () 
setPlayerTeam ( source, players ) 
end) 
setTimer(function() 
setTeamFriendlyFire ( players , true ) 
end,50,1) 

Link to comment
Server side

وضع اللاعبين في فريق ومنعهم من قتل بعضهم البعض

players = createTeam ( "Players", 255, 255, 255 ) 
addEventHandler("onPlayerJoin", 
function () 
setPlayerTeam ( source, players ) 
end) 
setTimer(function() 
setTeamFriendlyFire ( players , true ) 
end,50,1) 

players = createTeam ( "Players", 255, 255, 255 ) 
addEventHandler("onPlayerJoin",root, 
function () 
setPlayerTeam ( source, players ) 
end) 
setTimer(function() 
setTeamFriendlyFire ( players , false ) 
end,50,1) 

Link to comment
Server side

وضع اللاعبين في فريق ومنعهم من قتل بعضهم البعض

players = createTeam ( "Players", 255, 255, 255 ) 
addEventHandler("onPlayerJoin", 
function () 
setPlayerTeam ( source, players ) 
end) 
setTimer(function() 
setTeamFriendlyFire ( players , true ) 
end,50,1) 

players = createTeam ( "Players", 255, 255, 255 ) 
addEventHandler("onPlayerJoin",root, 
function () 
setPlayerTeam ( source, players ) 
end) 
setTimer(function() 
setTeamFriendlyFire ( players , false ) 
end,50,1) 

lol TAPL shame on Sora HaHa.

Link to comment
Server side

وضع اللاعبين في فريق ومنعهم من قتل بعضهم البعض

players = createTeam ( "Players", 255, 255, 255 ) 
addEventHandler("onPlayerJoin", 
function () 
setPlayerTeam ( source, players ) 
end) 
setTimer(function() 
setTeamFriendlyFire ( players , true ) 
end,50,1) 

players = createTeam ( "Players", 255, 255, 255 ) 
addEventHandler("onPlayerJoin",root, 
function () 
setPlayerTeam ( source, players ) 
end) 
setTimer(function() 
setTeamFriendlyFire ( players , false ) 
end,50,1) 

+

function setfire () 
ssss = getTeamFromName ("Players") 
for id, s in ipairs( getElementsByType ( "player" ) ) do 
sss = getPlayerTeam (s) 
if sss == ssss then 
setPedOnFire ( s, false ) 
end 
end 
end 
  
setTimer ( setfire, 50, 0) 

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...