Jump to content

[Help] Tickets to criminals


ville

Recommended Posts

Hi, i want to modify this script so polices can give tickets to criminals, i added that wanted line .. but its not working. I want to know what im doing wrong

function mandat(player, cmd, who, ile) 
local who = getPlayerFromName(who) 
if getPlayerTeam(player) == getTeamFromName("Police") then 
takePlayerMoney(who, tonumber(ile)) 
outputChatBox("Player "..getPlayerName(who).." has been given ticket ("..tonumber(ile).."$)") 
end 
end 
addCommandHandler("ticket", mandat) 

Link to comment

Debugscript 3??

I think would be more easy use a variable for getPlayerTeam, then a variable for getTeamName

If teamName == "desired" then

Edit: I changed this code like this..try now.

function mandat(player, cmd, who, amount) 
local who = getPlayerFromName(who) 
local team = getPlayerTeam(player) 
    if team then 
    local name = getTeamName(team) 
        if name == "Police" then 
        local money = takePlayerMoney(who, tonumber(amount)) 
            if money then 
                outputChatBox("Player "..getPlayerName(who).." has been given ticket ("..tonumber(ile).."$)") 
            else 
                outputDebugString("Something fails!") 
            end 
        end 
    end      
end 
addCommandHandler("ticket", mandat) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...