x1ABooDx Posted June 18, 2012 Share Posted June 18, 2012 السلام عليكم اخواني انا سويت مود للزومبي وتلقون السيرفر في التوقيع اتمنى تزورونه هذا شغلي انا واحد مبتدأ اتمنى تشوفونه وهيك اخواني حبيت استفسر الحين اللي في السيرفر يقتلون بعض كيف اخلي الزوار ما يقتلون بعض + ابي حفظ الفلوس لاهنتم انتظر ردودكم Link to comment
abu5lf Posted June 18, 2012 Share Posted June 18, 2012 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
TAPL Posted June 18, 2012 Share Posted June 18, 2012 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
abu5lf Posted June 18, 2012 Share Posted June 18, 2012 addEventHandler ( "onClientPlayerDamage", getRootElement(), cancelEvent ) Link to comment
x1ABooDx Posted June 18, 2012 Author Share Posted June 18, 2012 طيب الحين وش الكود الصح هع ؟ Link to comment
X-SHADOW Posted June 18, 2012 Share Posted June 18, 2012 ---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
abu5lf Posted June 18, 2012 Share Posted June 18, 2012 طيب الحين وش الكود الصح هع ؟ حفظ الفلوس 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
Sora Posted June 18, 2012 Share Posted June 18, 2012 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
TAPL Posted June 18, 2012 Share Posted June 18, 2012 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
X-SHADOW Posted June 18, 2012 Share Posted June 18, 2012 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
TAPL Posted June 18, 2012 Share Posted June 18, 2012 lol TAPL shame on Sora HaHa. Your post is out of topic and has no benefit at all, just increase cont. Link to comment
Sora Posted June 18, 2012 Share Posted June 18, 2012 lol i forgot change this , x-shadow No one not misses and please keep away of my posts Link to comment
top sniper Posted June 19, 2012 Share Posted June 19, 2012 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now