-
Posts
525 -
Joined
-
Last visited
-
Days Won
3
Everything posted by justn
-
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 )
-
When the police targets the player, I want him to press N and then the player will get bribed
-
e.e This is technically my first time using bindKey really so.. a little help please?
-
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 )
-
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 )
-
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
-
I never tried this but I think You can create your own custom command to set player's nick
-
Well, maybe it's because you're triggering the same Event "onGreetinA" Sometimes when you do that the stuff gets bugged
-
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 )
-
In my opinion it's a easy map. But it's always good to see a budya map.
-
You clearly don't understand what I'm trying to do, I don't want players in police team to get wanted levels.
-
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.
-
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.
-
Unexpected symbol on line 5
-
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.
-
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
-
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 )
-
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.
-
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)))
-
So yeah, I have a combobox (language chat ) , and i wanna know how to like, if the player clicks an item from the combobox then it will bindKey 'L' in chat and the language.
-
Okay so i have tried this code, it works, but the problem is, when i set my team to another, the occupation doesn't change. _setPlayerTeam = setPlayerTeam addEvent ( "onPlayerTeamChange", true ) function setPlayerTeam ( player, team ) if not team or not player then return false end local oldTeam = getPlayerTeam ( player ) triggerEvent ( "onPlayerTeamChange", player, oldTeam, team ) return _setPlayerTeam ( player, team ) end addEventHandler ( "onPlayerTeamChange", root, function ( oldTeam, currentTeam ) if ( currentTeam == "Police" ) then setElementData ( source, "Occupation", "Officer" ) elseif ( currentTeam == "Staff" ) then setElementData ( source, "Occupation", "Staff" ) else setElementData ( source, "Occupation", "Civillian" ) end end )