Erhabi Posted April 7, 2010 Posted April 7, 2010 hi all I made the scripting for race mode But I have a problem I want to know how to make the player if he wins give him 100 I'm sorry for my bad English
darkdreamingdan Posted April 7, 2010 Posted April 7, 2010 Race provides events which you can use in combination with setPlayerMoney to achieve this. Refer to https://wiki.multitheftauto.com/wiki/Resource:Race As you can see, there's an onPlayerFinish event. VCP FOREVER!
Dark Dragon Posted April 7, 2010 Posted April 7, 2010 addEvent("onPlayerFinish",true) -- add the custom event so our resource knows about it addEventHandler("onPlayerFinish",getRootElement(), -- add an event handler for the event function (rank,finishtime) if rank == 1 then -- check if the player finished first givePlayerMoney(source,100) -- give him 100$ if so end end ) Loads of fun for free! Also a lot of fun for free!
Erhabi Posted April 7, 2010 Author Posted April 7, 2010 plzzz i need help the scrioting does not work i created a file.lua in race folder function win ( rank, finishtime ) if ( rank == 1 ) then givePlayerMoney ( source, 100 ) end end addEvent ( "onPlayerFinish", true ) addEventHandler( "onPlayerFinish", getRootElement(), win ) but that not work
Dark Dragon Posted April 7, 2010 Posted April 7, 2010 you know that you have to add your scripting files to the meta.xml don't you? by the way you should start a new resource, adding this to race wouldn't be too good for the organization and yes my code works, yours should too Loads of fun for free! Also a lot of fun for free!
dzek (varez) Posted April 7, 2010 Posted April 7, 2010 And AFAIR race gamemode has money HUD disabled by default.. Maybe you just don't know that script is working? Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
karlis Posted April 8, 2010 Posted April 8, 2010 showPlayerHudComponent(player,"money",true) [WIP]GTA IV style hud+custom blips + blip text + circular radar areas
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