bartje01
-
Posts
208 -
Joined
-
Last visited
Posts posted by bartje01
-
-
Alright np.
Take your time
-
Errors gone but still no saving
Dammiiieeet Not so easy I guess Your code looks really hard.
The step from sa-mp to MTA is so hard for me
-
WHere is the easy part of that
Didn't worked btw:(
In my console no errors or warnings
In my script editor there are errors:
')'Expected (to close '(' at line 45) near 'end'
'' expected near 'end'
')' expected (to close '(' at line 53) near 'setPlayerMoney'
Btw. Why setPlayerMoney?
I didn't need that with element date cash right?
-
Yay the text works now. I also get my cash when I die. But Solidsnake is right.
When I reconnect it doesn't save. How to save this?
Thanks so much guys
-
[2011-03-06 23:18:16] WARNING: testmode\server.lua:25: Bad argument @ 'getElementData'
And it must be there.
My whole script
function onLoginSetCash ( ) if not isGuestAccount ( getPlayerAccount ( source ) ) then if getElementData ( source, "data.cash" ) then outputChatBox ( "You're cash is transfered back!", source ) else setElementData ( source, "data.cash", 0 ) outputChatBox ( "You're new and your cash will now be saved." ) end end end function onWastedSetCash ( ) if not isGuestAccount ( getPlayerAccount ( source ) ) then local getPlayerCash = getElementData ( source, "data.cash" ) setElementData ( source, "data.cash", getPlayerCash + 100 ) outputChatBox ( "You got 100$ for your death.", source ) end end addEventHandler ( "onPlayerLogin", root, onLoginSetCash ) addEventHandler ( "onPlayerWasted", root, onWastedSetCash ) function myCash ( thePlayer ) local cash = getElementData ( source, "data.cash" ) outputChatBox ( "Your cash is: " .. tostring ( cash ), thePlayer ) end addCommandHandler ( "cash", myCash )
-
Yes it works all.Well almost
When I type /cash it says:
Your cash is: false
LOl?
Warning at this line
local cash = getElementData ( source, "data.cash" )
-
Well. On sa-mp it's like 80$ for a Roleplay script because it costs so much time
Not sure if it's the same here. I just started with MTA scripting
-
Thanks for helping but,
We're using element data cash now.
You can see that in the posts above.
I've edited it to this now
function myCash ( thePlayer ) local cash = getPlayerCash ( thePlayer ) outputChatBox ( "Your cash is: " .. tostring ( cash ), thePlayer ) end addCommandHandler ( "cash", myCash )
Just no message shows up
-
Alright. It shows me the outputchatbox texts.
But will this save? Even when I reconnect?
And can someone help me making the cmd to check my cash?
I tried:
function myCash ( thePlayer, commandName ) local cash = getPlayerCash ( thePlayer ) outputChatBox ( "Your cash is: " .. cash, thePlayer ) end addCommandHandler ( "cash", myCash )
And failed. No message shows up when I type /cash
Thank you very much Proracer
-
Nop. Even if I see the money thing. As proracer says: setPlayerMoney doesn't work for race.
So can someone help me doing it with element data?
-
Aaah proracer. I see. I already noticed that there was no money bar in the right cornor of the game.
But can you please give an example on how to do this? Or send me the right wiki page?
Because when I know how to make element data cash I can do much more.
-
@ Bamby. We're talking about money saving here:P
-
Damn. Still doesn't work
I'm using the race script of MTA by the way.
I put this in my race_server.lua
-
Doesn't have effect again
-
Hey guys,. Sorry that I'm asking something again but I want to save money but it doesn't work
I've got no errors
function onPlayerQuit ( ) -- when a player leaves, store his current money amount in his account data local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getPlayerMoney ( source ) setAccountData ( playeraccount, "savemoney.money", playermoney ) end end function onPlayerLogin ( ) -- when a player joins, retrieve his money amount from his account data and set it local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "savemoney.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 )
Please help
-
Thanks Timic. Works
-
Fixed!
The standard admin panel script has a white name setter or something
Thanks for helping
EDIT:
Wups. Sorry for dubble post
-
Hey guys.
I'm trying to make a createteam command here.
function createATeam ( source, commandName, teamName ) local newTeam = createTeam ( teamName ) end addCommandHandler ( "createteam", createATeam)
No errors or warnings.
Itj ust has no effect. :*(
-
Well. I think it should work like other gamemodes.
It's just so weird. My chat name color is white. My kill list color is colored.
So weird.
Maybe someone else?
-
Race
-
Awesome it works now With your last code.
But
It only works in the kill list
In the chat box my name is still white
Can I chagne that as well?
Thanks by the way
PS
I noticed the friend list is yours.
Well it's so damn awesome
-
EDIT:
THe problem is that it only turns black..
I can't do another color than Black
And it only works for kill list not for text box
-
Hey guys, I'm making a /namecolor command so people can set their name color.
I've followed instructions from the wiki here.
function nametagColorChange ( thePlayer, commandName, r, g, b ) setPlayerNametagColor ( thePlayer, r, g, b ) outputChatBox("HINT:/namecolor [Colorid 0-250]") end addCommandHandler ( "namecolor", nametagColorChange)
WARNING: race\race_server.lua:1431: Bad argument @ 'setPlayerNametagColor'
It sends me the message: Hint:/namecolor [colorid 0-250]
So I know it must be something with this line
setPlayerNametagColor ( thePlayer, r, g, b )
So what could it be?
Thanks
-
Moeny saving
in Scripting
Posted
OMFGOMFGOMFG I WORKS YAHIOOOOOO
PRORACER AWEEESOOME (L)
THANKYOU BOTH
BOTH OF YOU. AWWEEESOME HEROES!!!!!!
TYTY