-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
What exactly doesn't work?
-
Remember, you cannot change the skin models.
-
addEvent("Text", true) addEventHandler("Text", getRootElement(), function() outputChatBox( " Text for only one player ", source ) outputChatBox( " Text for all players ") end)
-
Get the latest 1.0.4 nightly build here (also for linux) https://nightly.multitheftauto.com/
-
This is not the right topic/section to ask for help, but you can read this manual and you will know how to add yourself as admin. https://wiki.multitheftauto.com/wiki/Server_Manual
-
es chasing no chansing.
-
You are using this table "aGamemodeMapTable" but i don't see it on the script you posted, is the full script?
-
Ur kidding me? i know how to read, i'm asking, where is that table?
-
function onLoginSetStats ( ) if not isGuestAccount ( getPlayerAccount ( source ) ) then account = getPlayerAccount(source) if getAccountData ( account, "data.cash" ) then givePlayerMoney(source, tonumber(getAccountData(account,"data.cash"))) outputChatBox ( "Your stats are transfered back!", source ) else setAccountData( account, "data.cash", 0 ) setAccountData( account, "data.deaths", 0 ) outputChatBox ( "Your stats will now be saved." ) end end end function onLogoutSaveStats() if not isGuestAccount ( getPlayerAccount ( source ) ) then account = getPlayerAccount(source) setAccountData(account,"data.cash",tonumber(getAccountData(account,"data.cash"))+tonumber(getPlayerMoney(source))) setAccountData( account, "data.deaths", 0 ) setPlayerMoney(source,0) end end addEventHandler ( "onPlayerLogout", root, onLogoutSaveStats ) addEventHandler ( "onPlayerLogin", root, onLoginSetStats ) function myStats ( thePlayer ) if not isGuestAccount ( getPlayerAccount ( thePlayer ) ) then account = getPlayerAccount(thePlayer) local cash = getAccountData ( account, "data.cash" ) local deaths = getAccountData ( account, "data.deaths" ) outputChatBox ( "Stats: Money: ".. tostring( cash ) , thePlayer ) end end addCommandHandler ( "cash", myStats ) function myStats2 ( thePlayer ) if not isGuestAccount ( getPlayerAccount ( thePlayer ) ) then account = getPlayerAccount(thePlayer) local deaths = getAccountData ( account, "data.deaths" ) outputChatBox ( "Stats2: Deaths: ".. tostring( deaths ), thePlayer ) end end addCommandHandler ( "deaths", myStats2 ) function onWasted (ammo, killer) local account = getPlayerAccount(source) local getPlayerDeaths = getAccountData(account, "data.deaths" ) if getPlayerDeaths then local getPlayerCash = getAccountData(account, "data.cash" ) setTimer( spawnPlayer, 2000, 1, source, 1187.19,-1324.01,13.55 ) outputChatBox ( "You've paid 100$ for medical bill.", source ) setAccountData ( account, "data.cash", tonumber(getPlayerCash) - 100 ) setAccountData ( account, "data.deaths", tonumber(getPlayerDeaths) + 1 ) else setAccountData ( account, "data.deaths", 1 ) end end addEventHandler ( "onPlayerWasted", root, onWasted )
-
This makes no sense, where's this table? aGamemodeMapTable
-
use the following functions & events to make it: setAccountData getAccountData setElementData onPlayerWasted onPlayerLogin https://wiki.multitheftauto.com/wiki/Main_Page
-
function onWasted (ammo, killer) local account = getPlayerAccount(source) local getPlayerDeaths = getAccountData(account, "data.deaths" ) local getPlayerCash = getAccountData(account, "data.cash" ) setTimer( spawnPlayer, 2000, 1, source, 1187.19,-1324.01,13.55 ) outputChatBox ( "You've paid 100$ for medical bill.", source ) setAccountData ( account, "data.cash", tonumber(getPlayerCash) - 100 ) setAccountData ( account, "data.deaths", tonumber(getPlayerDeaths) + 1 ) end addEventHandler ( "onPlayerWasted", root, onWasted ) Try it.
-
function onLoginSetStats ( ) if not isGuestAccount ( getPlayerAccount ( source ) ) then account = getPlayerAccount(source) if getAccountData ( account, "data.cash" ) then givePlayerMoney(source, tonumber(getAccountData(account,"data.cash"))) outputChatBox ( "Your stats are transfered back!", source ) setAccountData(account,"data.deaths",tonumber(getAccountData(account,"data.deaths"))) else setAccountData( account, "data.cash", 0 ) setAccountData( account, "data.deaths", 0 ) outputChatBox ( "Your stats will now be saved." ) end end end function onLogoutSaveStats() if not isGuestAccount ( getPlayerAccount ( source ) ) then account = getPlayerAccount(source) setAccountData(account,"data.cash",tonumber(getAccountData(account,"data.cash"))+tonumber(getPlayerMoney(source))) setAccountData( account, "data.deaths", 0 ) setPlayerMoney(source,0) end end addEventHandler ( "onPlayerLogout", root, onLogoutSaveStats ) addEventHandler ( "onPlayerLogin", root, onLoginSetStats ) function myStats ( thePlayer ) if not isGuestAccount ( getPlayerAccount ( thePlayer ) ) then account = getPlayerAccount(thePlayer) local cash = getAccountData ( account, "data.cash" ) local deaths = getAccountData ( account, "data.deaths" ) outputChatBox ( "Stats: Money: ".. tostring( cash ) , thePlayer ) end end addCommandHandler ( "cash", myStats ) function myStats2 ( thePlayer ) if not isGuestAccount ( getPlayerAccount ( thePlayer ) ) then account = getPlayerAccount(thePlayer) local deaths = getAccountData ( account, "data.deaths" ) outputChatBox ( "Stats2: Deaths: ".. tostring( deaths ), thePlayer ) end end addCommandHandler ( "deaths", myStats2 ) addEventHandler("onPlayerWasted",getRootElement(), function (ammo,killer) if not isGuestAccount ( getPlayerAccount ( source ) ) then account = getPlayerAccount(source) setAccountData(account,"data.deaths",tonumber(getAccountData(account,"data.deaths"))+1) end end)
-
I use notepad++ best program ever
-
function setCash ( sourcePlayer,cmd,who,amount) if ( not who and not amount ) then outputChatBox("*Use /setcash [Name] [amount]", sourcePlayer, 180, 0, 0 ) end local gived = getPlayerFromName ( who ) account = getPlayerAccount(gived) if not isGuestAccount ( account ) then local playerCash = getAccountData ( account, "data.cash" ) local success = setAccountData ( account, "data.cash", tonumber(playerCash)+tonumber(amount) ) if success then outputChatBox ( "Your cash has been setted.", gived ) outputChatBox ( "You've setted his cash.", sourcePlayer ) else outputChatBox("ERROR: Player is not connected", sourcePlayer, 180, 0, 0 ) end end end addCommandHandler ( "setcash", setCash )
-
Pues es lo mismo, esta en el lado server side verdad?
-
Just wanted to make sure
-
Oh, my bad, excuse me, i didn't wanted to insult you
-
Ayuda en Lista de Server
Castillo replied to Vixo10's topic in Ayuda relacionada al cliente/servidor
Entonces usa la tecla "Impr Pant Pet Sis" y pegalo con Ctrl + V en paint. -
Oh, my bad i forgot about that
-
Acitano, aren't you taking the scripts from another public gamemode, right? like mta paradise.
-
What's the point of posting what i already said?
-
Acording to what i understand, he wants to do something like /setcash playername amount so he must use getPlayerFromName function setCash ( sourcePlayer,cmd,who,amount) local gived = getPlayerFromName ( who ) if not gived then gived = sourcePlayer end if not isGuestAccount ( getPlayerAccount ( gived ) ) then account = getPlayerAccount(gived) local getPlayerCash = getAccountData ( account, "data.cash" ) setAccountData ( account, "data.cash", tonumber(getPlayerCash) + tonumber(amount) or 100 ) outputChatBox ( "Your cash has been setted.", gived ) outputChatBox ( "You've setted his cash.", sourcePlayer ) end end addCommandHandler ( "setcash", setCash ) Try it.
-
g_ForcedNextMap, that's a race function if i'm right, you can't use it outside the race gamemode if it's not exported.
