Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. function player_finish ( rank )
  2. if getPlayerCount () > 1 then
  3.     if rank == 1 then
  4.         money1 = getPlayerCount()*10
  5.         givePlayerMoney ( source, money1 ) 
  6.         outputChatBox ("Server: #FFAA00You were awarded with #ffffff$"..money1.."#FFAA00 for winning this map!", source, 255, 255, 255, true )
  7.         player_account = getPlayerAccount ( source )
  8.         if not isGuestAccount ( player_account ) then
  9.             playerwins = getAccountData ( player_account, "wins" )
  10.             setAccountData ( player_account, "wins", playerwins+1 )    
  11.         end
  12.         outputChatBox ( "test1" )
  13.     end
  14.     if rank == 2 then
  15.         money2 = getPlayerCount()*2
  16.         givePlayerMoney ( source, money2 )
  17.         outputChatBox ("Server: #FFAA00You were awarded with #ffffff$"..money2.."#FFAA00 for being second in this map!", source, 255, 255, 255, true )
  18.         outputChatBox ( "test2" )
  19.     end
  20.     if rank == 3 then
  21.         money3 = getPlayerCount()
  22.         givePlayerMoney ( source, money3 )
  23.         outputChatBox ("Server: #FFAA00You were awarded with #ffffff$"..money3.."#FFAA00 for being third in this map!", source, 255, 255, 255, true )
  24.         outputChatBox ( "test3" )
  25.     end
  26. end
  27. else
  28. outputChatBox ("Server: #FFAA00No money is awarded for winning this map, because there are only 2 people in the server!", source, 255, 255, 255, true )
  29. end
  30. addEventHandler ( "onPlayerFinish", getRootElement(), player_finish )
  31. addEventHandler ( "onPlayerFinishDD", getRootElement(), player_finish )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement