onlinegenc Posted June 17, 2012 Share Posted June 17, 2012 Hi guys I try code panel but ı have a problem I dont give money winner and other player. What can I do? Link to comment
TAPL Posted June 17, 2012 Share Posted June 17, 2012 what panel? you can give money using this function https://wiki.multitheftauto.com/wiki/GivePlayerMoney Link to comment
onlinegenc Posted June 17, 2012 Author Share Posted June 17, 2012 I coding race panel Link to comment
TAPL Posted June 17, 2012 Share Posted June 17, 2012 You did not show any code so we can't help you more than given you this link for wiki. https://wiki.multitheftauto.com/wiki/GivePlayerMoney Hope This Help! Link to comment
onlinegenc Posted June 17, 2012 Author Share Posted June 17, 2012 function checkWinAndIfWinGiveWinCash (thePlayer) local cash = getPlayerCount()*100 savePlayerData (thePlayer,"wins",loadPlayerData(thePlayer,"wins") + 1) savePlayerData (thePlayer,"cash",loadPlayerData(thePlayer,"cash") + cash) outputChatBox ("#ffffff"..getPlayerName(thePlayer) .." #0fc0fcbu haritada 1. olduğu için #ffffff"..tostring(cash).."#0fc0fc$ kazandı!",getRootElement(),24,79,12,true) end addEvent("birinci",true) addEventHandler ("birinci",getRootElement(),checkWinAndIfWinGiveWinCash) this is my code.But this is not work function onplayerwasted () local racerank=tonumber(getElementData(source,"race rank")) if racerank== 1 then savePlayerData (thePlayer,"cash",loadPlayerData(thePlayer,"cash") + 1000) elseif racerank==2 then savePlayerData (thePlayer,"cash",loadPlayerData(thePlayer,"cash") + 500) elseif racerank==3 then savePlayerData (thePlayer,"cash",loadPlayerData(thePlayer,"cash") + 100) end end addEventHandler("onPlayerWasted",getRootElement(),onplayerwasted) this is mine code. Can you help me? Link to comment
TAPL Posted June 17, 2012 Share Posted June 17, 2012 function checkWinAndIfWinGiveWinCash (thePlayer) local cash = getPlayerCount()*100 savePlayerData (thePlayer,"wins",loadPlayerData(thePlayer,"wins") + 1) savePlayerData (thePlayer,"cash",loadPlayerData(thePlayer,"cash") + cash) outputChatBox ("#ffffff"..getPlayerName(thePlayer) .." #0fc0fcbu haritada 1. olduğu için #ffffff"..tostring(cash).."#0fc0fc$ kazandı!",getRootElement(),24,79,12,true) end addEvent("birinci",true) addEventHandler ("birinci",getRootElement(),checkWinAndIfWinGiveWinCash) this is my code.But this is not work function onplayerwasted () local racerank=tonumber(getElementData(source,"race rank")) if racerank== 1 then savePlayerData (thePlayer,"cash",loadPlayerData(thePlayer,"cash") + 1000) elseif racerank==2 then savePlayerData (thePlayer,"cash",loadPlayerData(thePlayer,"cash") + 500) elseif racerank==3 then savePlayerData (thePlayer,"cash",loadPlayerData(thePlayer,"cash") + 100) end end addEventHandler("onPlayerWasted",getRootElement(),onplayerwasted) this is mine code. Can you help me? thePlayer not definded anyway i think you need to use event onPlayerFinish check wiki https://wiki.multitheftauto.com/wiki/Resource:Race Link to comment
Cadu12 Posted June 17, 2012 Share Posted June 17, 2012 You're wrong, TAPL. Ontopic: Download MTA resource from googlecode, http://code.google.com/p/mtasa-resources/downloads/list You can use onPlayerFinishDD, onPlayerWinDD for DD/DM. Link to comment
Fury Posted June 18, 2012 Share Posted June 18, 2012 function checkWinAndIfWinGiveWinCash (thePlayer) local cash = getPlayerCount()*100 savePlayerData (thePlayer,"wins",loadPlayerData(thePlayer,"wins") + 1) savePlayerData (thePlayer,"cash",loadPlayerData(thePlayer,"cash") + cash) outputChatBox ("#ffffff"..getPlayerName(thePlayer) .." #0fc0fcbu haritada 1. olduğu için #ffffff"..tostring(cash).."#0fc0fc$ kazandı!",getRootElement(),24,79,12,true) end addEvent("birinci",true) addEventHandler ("birinci",getRootElement(),checkWinAndIfWinGiveWinCash) this is my code.But this is not work function onplayerwasted () local racerank=tonumber(getElementData(source,"race rank")) if racerank== 1 then savePlayerData (thePlayer,"cash",loadPlayerData(thePlayer,"cash") + 1000) elseif racerank==2 then savePlayerData (thePlayer,"cash",loadPlayerData(thePlayer,"cash") + 500) elseif racerank==3 then savePlayerData (thePlayer,"cash",loadPlayerData(thePlayer,"cash") + 100) end end addEventHandler("onPlayerWasted",getRootElement(),onplayerwasted) this is mine code. Can you help me? function ebeninami() local rank = exports.race:getPlayerRank( source ) + 1 if (rank == 2) then savePlayerData (source,"cash",loadPlayerData(source,"cash") + 1000) elseif(rank == 3) then savePlayerData (source,"cash",loadPlayerData(source,"cash") + 1000) elseif(rank == 4) then savePlayerData (source,"cash",loadPlayerData(source,"cash") + 1000) elseif(rank == 5) then savePlayerData (source,"cash",loadPlayerData(source,"cash") + 1000) end end addEventHandler("onPlayerWasted", getRootElement(), ebeninami) try that. // bunu dene. //// ayrıca savePlayerData ve LoadPlayerData fonksyonlarını paylaşta yanlışlığın nerde olduğuna bakalım. fonksyonları Nextreme'den aldıysan yanlış kullanıyorsun.. Link to comment
onlinegenc Posted June 18, 2012 Author Share Posted June 18, 2012 kardeşim bu şekilde ben para verdirtebiliyorum.Problemim birinciye para verdirmek.bu şekilde ölenlere para verdirtebiliyoruz. ama birinci ya ölmez ise? Birde fonksiyonları ben düzenledim fonksiyonlarda arza yok. dediğim gibi problemim 1.ye para vermek. Link to comment
ahdon Posted June 18, 2012 Share Posted June 18, 2012 This is an English part of the forums, use one of the other languages board if you're going to speak another language. Link to comment
onlinegenc Posted June 18, 2012 Author Share Posted June 18, 2012 sorry.I will speak english. Link to comment
ahdon Posted June 18, 2012 Share Posted June 18, 2012 sorry.I will speak english. Good, and since I did not understand the last replies what's not working/what do you need help with? Link to comment
Fury Posted June 18, 2012 Share Posted June 18, 2012 kardeşim bu şekilde ben para verdirtebiliyorum.Problemim birinciye para verdirmek.bu şekilde ölenlere para verdirtebiliyoruz.ama birinci ya ölmez ise? Birde fonksiyonları ben düzenledim fonksiyonlarda arza yok. dediğim gibi problemim 1.ye para vermek. addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function (winner) savePlayerData (winner,"cash",loadPlayerData(winner,"cash") + 1000) outputChatBox ("* " ..getPlayerName (winner).." wins!", root, 255, 255, 255, true ) end) you should learn english first if you wanna write scripts. /// biraz ingilizce öğren bence ne dediğin anlaşılmıyor. kodlamada ilerlemek istiyorsan ingilizcen çok iyi olmalı. Link to comment
onlinegenc Posted June 19, 2012 Author Share Posted June 19, 2012 Thanks Vendetta I will learn english 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