Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. What exactly doesn't work?
  2. Remember, you cannot change the skin models.
  3. Castillo

    AMX

    AMX doesn't works with 0.3 SA-MP scripts.
  4. addEvent("Text", true) addEventHandler("Text", getRootElement(), function() outputChatBox( " Text for only one player ", source ) outputChatBox( " Text for all players ") end)
  5. Get the latest 1.0.4 nightly build here (also for linux) https://nightly.multitheftauto.com/
  6. 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
  7. You are using this table "aGamemodeMapTable" but i don't see it on the script you posted, is the full script?
  8. Ur kidding me? i know how to read, i'm asking, where is that table?
  9. 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 )
  10. This makes no sense, where's this table? aGamemodeMapTable
  11. use the following functions & events to make it: setAccountData getAccountData setElementData onPlayerWasted onPlayerLogin https://wiki.multitheftauto.com/wiki/Main_Page
  12. 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.
  13. 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)
  14. I use notepad++ best program ever
  15. 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 )
  16. Pues es lo mismo, esta en el lado server side verdad?
  17. Oh, my bad, excuse me, i didn't wanted to insult you
  18. Entonces usa la tecla "Impr Pant Pet Sis" y pegalo con Ctrl + V en paint.
  19. Oh, my bad i forgot about that
  20. Acitano, aren't you taking the scripts from another public gamemode, right? like mta paradise.
  21. What's the point of posting what i already said?
  22. 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.
  23. 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.
×
×
  • Create New...