Jump to content

justn

Members
  • Posts

    527
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by justn

  1. Source is the player who is getting the ticket... but the errors: ERROR:Police\server.lua:26:attempt to concatenate a boolean value
  2. So yeah, i have made this , and the problem is, when the cop aims at the player and presses N , nothing happens, can you help please? function onPlayerTargetA ( theCop ) if isPlayerInTeam( theCop, "Police" ) then if not isPlayerInTeam(source, "Police" ) then if ( getPlayerWantedLevel ( source ) == 1 ) then if ( getElementType ( theCop ) == "player" ) then bindKey ( theCop, "N", "down", function() exports["TopBarChat"]:sendClientMessage("You have given "..getPlayerName(source).." a ticket , Wait for him to pay it",theCop,255, 0, 0, true) exports["TopBarChat"]:sendClientMessage("You have gotten a ticket ! Press 'H' to pay it!",source,255, 0, 0, true) bindKey ( source, "H", "down", payTheTicket ) end) end end end end end addEventHandler ( "onPlayerTarget", getRootElement(), onPlayerTargetA ) function payTheTicket (theCop) if isPlayerInTeam( theCop, "Police" ) then if not isPlayerInTeam(source, "Police" ) then if ( getPlayerWantedLevel ( source ) == 1 ) then if ( getElementType ( theCop ) == "player" ) then givePlayerMoney(theCop,200) takePlayerMoney(source,200) exports["TopBarChat"]:sendClientMessage("The ticket has been paid by "..getPlayerName(source),theCop,255, 0, 0, true) exports["TopBarChat"]:sendClientMessage("You have paid the ticket to "..getPlayerName(theCop),source,255, 0, 0, true) end end end end end
  3. I know, when the police bribes the player, the press H message, will be displayed to the player. and you mean like this ? function onPlayerTargetA ( theCop ) if isPlayerInTeam( theCop, "Police" ) then if not isPlayerInTeam(source, "Police" ) then if ( getPlayerWantedLevel ( source ) == 1 ) then if ( getElementType ( theCop ) == "player" ) then exports["TopBarChat"]:sendClientMessage("You have bribed "..getPlayerName(source)..", Wait for him to pay it",theCop,255, 0, 0, true) exports["TopBarChat"]:sendClientMessage("You have gotten a ticket ! Press 'H' to pay it. !",source,255, 0, 0, true) bindKey ( theCop, "N", "down", onPlayerTargetA ) end end end end end addEventHandler ( "onPlayerTarget", getRootElement(), onPlayerTargetA )
  4. When the police targets the player, I want him to press N and then the player will get bribed
  5. e.e This is technically my first time using bindKey really so.. a little help please?
  6. Ahh, i have 1 last problem, it doesn't work, can you tell me the problem ? function onPlayerTargetA ( theCop ) if isPlayerInTeam( theCop, "Police" ) then if not isPlayerInTeam(source, "Police" ) then if ( getPlayerWantedLevel ( source ) == 1 ) then exports["TopBarChat"]:sendClientMessage("You have bribed "..getPlayerName(source)..", Wait for him to pay it",theCop,255, 0, 0, true) exports["TopBarChat"]:sendClientMessage("You have gotten a ticket ! Press 'H' to pay it. !",source,255, 0, 0, true) end end end end addEventHandler ( "onPlayerTarget", getRootElement(), onPlayerTargetA ) bindKey ( theCop, "N", "down", onPlayerTargetA )
  7. So, Hi, I need help with 2 functions .. The first one, I need help with, if the player has 1 or less wanted level, then his wanted will be set to '2' function onPlayerDamage ( attacker ) if isPlayerInTeam ( source, "Police" ) then if ( getElementType ( attacker ) == "player" and getElementModel ( source ) == 280 ) then setPlayerWantedLevel ( attacker, 2 ) end end end addEventHandler ( "onPlayerDamage", getRootElement(), onPlayerDamage ) Now the second one, is onPlayerWasted.. the problem is, this doesn't work, no errors in debugscript. function onPlayerWasted ( attacker ) if isPlayerInTeam ( source, "Police" ) then if ( getElementType ( attacker ) == "player" ) then setPlayerWantedLevel ( attacker, getPlayerWantedLevel(attacker)+1 ) end end end addEventHandler ( "onPlayerWasted", getRootElement(), onPlayerWasted )
  8. So, how do i make if the player is not doing anything (Shooting) for about 5 minutes, then the player's wanted level will be reduced by -1
  9. I never tried this but I think You can create your own custom command to set player's nick
  10. Well, maybe it's because you're triggering the same Event "onGreetinA" Sometimes when you do that the stuff gets bugged
  11. I wanted something's like Anubhav's code, if the player is in police team , and has 1 or more wanted level , it will remove the player's wanted level. I already have a onPlayerTarget Code, so if the attacker aims at the police he will get 1 star. but the problem is, sometimes police aims at police and gets 1 star that's why i need this code. Um, is this code correct ? function ifIsTeam (attacker) if not getElementType(attacker) == "player" then return end if isPlayerInTeam( attacker, "Police" ) then local wanted = getPlayerWantedLevel(attacker) if wanted < 6 then setPlayerWantedLevel ( attacker, 0 ) end end end setTimer(ifIsTeam ,100 ,1 )
  12. In my opinion it's a easy map. But it's always good to see a budya map.
  13. justn

    [Score]

    Ah my bad, i forgot to add setElementData To: Numinex97 You can use setElementData to set a value for the scores. setElementData
  14. You clearly don't understand what I'm trying to do, I don't want players in police team to get wanted levels.
  15. justn

    [Score]

    He wanted to save the scores when player leaves/joins. setAccountData for him to store it into his account.
  16. justn

    [Score]

    Not really in my opinion.
  17. justn

    [Score]

    Well, if you wanna create the "Score" column on scoreboard, you can use exports [ "scoreboard" ]:addScoreboardColumn ( "Score" ) and If you wanna save the scores on the account You must use setAccountData getAccountData If you wanna use 'scores' to buy ammo etc, i think you'll need to create your own functions like getPlayerScore etc.
  18. function ifIsTeam () if isPlayerInTeam( source, "Police" ) then local wanted = getPlayerWantedLevel(source) if wanted < 6 then setPlayerWantedLevel ( source, 0 ) end end end setTimer(ifIsTeam,50,ifIsTeam) Not working.
  19. Unexpected symbol on line 5
  20. No, what i mean is, i have created a wanted system, it has like if player aims at cops then the player will get 1 wanted level etc... and when a cop (attacker) aims at a cop, the cop (attacker) gets a wanted level, But i dont want the cop (attacker) to get wanted levels.
  21. So hi, I've been working on a script, so if the player is on team "Police" then he cant get wanted level, but i dont know how to make it so the player doesnt get wanted level, can someone help please ? This is what i made already. function ifIsTeam () if isPlayerInTeam( source, "Police" ) then -- CODE end end
  22. Hi !! the problem is the attacker, doesn't get a star when the police is dead , help please. function onPlayerWasted ( attacker ) if ( attacker ) then if isPlayerInTeam ( source, "Police" ) then if ( getElementType ( attacker ) == "player" ) then local Wanted = getPlayerWantedLevel(attacker) setPlayerWantedLevel ( attacker, Wanted+1 ) end end end end addEventHandler ( "onPlayerWasted", getRootElement(), onPlayerWasted )
  23. justn

    Tiny help *-*

    So i have created admins tag script. i need help with one thing.. This is when the player outputs the chatbox outputChatBox ( "#FF0000* #999999[Owner] " .. getPlayerName ( source ) .. ":#FFFFFF " .. msg, getRootElement(), r, g, b, true ) so what i need help with is, i want the player's name to be the color of his team.
  24. justn

    [Solved] Uhm Hi

    So you're saying this? sx,sy = guiGetScreenSize() lp = getLocalPlayer() mr = math.random(1,2) LanguageWindow = guiCreateComboBox(328, 229, 403, 435, "Please choose your language..", false) guiSetVisible(LanguageWindow,false) guiSetFont(LanguageWindow, "default-bold-small") guiSetProperty(LanguageWindow, "NormalEditTextColour", "FF170800") guiComboBoxAddItem(LanguageWindow, "Please choose your language..") guiComboBoxAddItem(LanguageWindow, "Arabic") guiComboBoxAddItem(LanguageWindow, "French") guiComboBoxAddItem(LanguageWindow, "Spanish") local language_handler = function(player,_,language,...) local text = table.concat({...}," ") outputChatBox("["..language.."] "..getPlayerName(player)..": "..text,root,255,255,255,true) end addCommandHandler("language",language_handler) bindKey("l","down","chatbox","language",guiComboBoxGetItemText(guiComboBoxGetSelected(LanguageWindow)))
×
×
  • Create New...