drk Posted December 10, 2011 Share Posted December 10, 2011 Hi ! I'm coding an pointing and money system for my clan server. I want that code add + 1500$ for player. The code is: setElementData ( player, "Dinheiro" ) -1500 ) It have a error, the symbol - is not recognized. How I can do this ? Link to comment
Evil-Cod3r Posted December 10, 2011 Share Posted December 10, 2011 You Mean Like This ? function M () local Evil-Cod3r = givePlayerMoney( 1500 ) setElementData ( source, "Dinheiro", Evil-Cod3r ) end addEventHandler( "onClientResourceStart", getRootElement( ), M) Link to comment
drk Posted December 10, 2011 Author Share Posted December 10, 2011 No, I want to set money to the Data "Dinheiro", not for the player like normal GTA:SA. Link to comment
Evil-Cod3r Posted December 10, 2011 Share Posted December 10, 2011 function Me ( thePlayer, command ) setElementData ( thePlayer, "Dinheiro" , +1500 ) end addCommandHandler ( "give", Me ) Link to comment
drk Posted December 10, 2011 Author Share Posted December 10, 2011 It is was I've writed before. I've tested on SciTE debugging mode and don't work. I will try on the server. Link to comment
Evil-Cod3r Posted December 10, 2011 Share Posted December 10, 2011 you mean my code dont work or what ? Link to comment
BinSlayer1 Posted December 10, 2011 Share Posted December 10, 2011 it doesnt work like that Evil-Cod3r function Me ( thePlayer, command ) setElementData ( thePlayer, "Dinheiro" , getElementData(thePlayer, "Dinheiro")+1500 ) end addCommandHandler ( "give", Me ) Link to comment
drk Posted December 10, 2011 Author Share Posted December 10, 2011 Thanks BinSlayer1, don't appear any error now. I'll test. Link to comment
Evil-Cod3r Posted December 10, 2011 Share Posted December 10, 2011 oh i was thinking does it need getElementData or not i think he need Thx BinSlayer1 Link to comment
drk Posted December 12, 2011 Author Share Posted December 12, 2011 Hi ! the script dont appear any error but don't work. Link to comment
Evil-Cod3r Posted December 12, 2011 Share Posted December 12, 2011 Try this then function save () local M = getElementData(source,"Dinheiro") setElementData(source,"Dinheiro",M+1500) end addEventHandler("onPlayerJoin",getRootElement(),save) Link to comment
BinSlayer1 Posted December 12, 2011 Share Posted December 12, 2011 Hi ! the script dont appear any error but don't work. You can't just use that code.. I only showed you how to do it but it obviously won't work because when you get the element data and it's non-existent, it will return false... you can't add a number to false You need to tweak your own "point system" that you say you have to make it work with this.. Link to comment
drk Posted December 13, 2011 Author Share Posted December 13, 2011 It is what I've done. 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