· 8 years ago · Aug 01, 2018, 09:08 AM
1ocal con = dbConnect("sqlite", ":/registry.db")
2dbExec(con, "CREATE TABLE IF NOT EXISTS goTeam ('accountname','team')")
3
4AF = createTeam("Armed Forces")
5SWAT = createTeam("SWAT Team")
6Gov = createTeam("Government")
7
8AddAcc = {
9"AFODusty",
10"Kreature",
11"JosefMTD",
12"Gonzalomanya",
13"bossnico"
14}
15
16--AF Team
17function goAF (source, commandName)
18 if dbQuery(con, "SELECT getPlayerAccount(source), af FROM goTeam") then
19 if ( getPlayerWantedLevel ( source ) < 3 ) then
20 setPlayerTeam ( source, AF )
21 setElementData( source, "o", "Armed Forces")
22 setElementModel ( source, 287 )
23 outputServerLog ( getPlayerName ( source ) .. " went to AF job with wanted level: " .. getPlayerWantedLevel ( source ))
24 else
25 outputChatBox("Your wanted level is too high", source)
26 end
27 end
28end
29
30addCommandHandler("goaf", goAF)
31
32--SWAT Team
33function goSWAT (source, commandName)
34 if dbQuery(con, "SELECT getPlayerAccount(source), swat FROM goTeam") then
35 if ( getPlayerWantedLevel ( source ) < 3 ) then
36 setPlayerTeam ( source, SWAT )
37 setPlayerNametagColor ( source, 65, 105, 225 )
38 setElementData( source, "o", "SWAT Team")
39 setElementModel ( source, 285 )
40 outputServerLog ( getPlayerName ( source ) .. " went to SWAT job with wanted level: " .. getPlayerWantedLevel ( source ))
41 else
42 outputChatBox("Your wanted level is too high", source)
43 end
44 end
45end
46
47addCommandHandler("goswat", goSWAT)
48
49--FBI Team
50function goFBI (source, commandName)
51 if dbQuery(con, "SELECT getPlayerAccount(source), fbi FROM goTeam") then
52 if ( getPlayerWantedLevel ( source ) < 3 ) then
53 setPlayerTeam ( source, Gov )
54 setPlayerNametagColor ( source, 52, 52, 51 )
55 setElementData( source, "o", "Federal Agent")
56 setElementModel ( source, 286 )
57 outputServerLog ( getPlayerName ( source ) .. " went to FBI job with wanted level: " .. getPlayerWantedLevel ( source ))
58 else
59 outputChatBox("Your wanted level is too high", source)
60 end
61 end
62end
63
64addCommandHandler("gofbi", goFBI)
65
66--SAPD Team
67function goSAPD (source, commandName)
68 if dbQuery(con, "SELECT getPlayerAccount(source), sapd FROM goTeam") then
69 if ( getPlayerWantedLevel ( source ) < 3 ) then
70 setPlayerTeam ( source, Gov )
71 setPlayerNametagColor ( source, 52, 52, 51 )
72 setElementData( source, "o", "SAPD Officer")
73 outputServerLog ( getPlayerName ( source ) .. " went to SAPD job with wanted level: " .. getPlayerWantedLevel ( source ))
74 else
75 outputChatBox("Your wanted level is too high", source)
76 end
77 end
78end
79
80addCommandHandler("gosapd", goSAPD)
81
82--give access to goAF/goSWAT/goFBI/goSAPD
83function addgoaf(source, commandname, name)
84 if getPlayerFromName(name) then
85 if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("L5")) or getAccountName(getPlayerAccount(source)) == AddAcc then
86 dbExec(con, "INSERT INTO goTeam VALUES (?, ?)", af, getPlayerAccount(getPlayerFromName(name)))
87 outputChatBox("Added", source)
88 outputServerLog ( getPlayerName ( source ) .. " added /goaf for " .. name)
89 end
90 end
91end
92addCommandHandler("addgoaf", addgoaf)
93
94function addgoswat(source, commandname, name)
95 if getPlayerFromName(name) then
96 if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("L5")) or getAccountName(getPlayerAccount(source)) == "Dusty" then
97 dbExec(con, "INSERT INTO goTeam VALUES (?, ?)", swat,getPlayerAccount(getPlayerFromName(name)))
98 outputChatBox("Added", source)
99 outputServerLog ( getPlayerName ( source ) .. " added /goswat for " .. name)
100 end
101 end
102end
103addCommandHandler("addgoswat", addgoswat)
104
105function addgofbi(source, commandname, name)
106 if getPlayerFromName(name) then
107 if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("L5")) or getAccountName(getPlayerAccount(source)) == "Dusty" then
108 dbExec(con, "INSERT INTO goTeam VALUES (?, ?)", fbi,getPlayerAccount(getPlayerFromName(name)))
109 outputChatBox("Added", source)
110 outputServerLog ( getPlayerName ( source ) .. " added /gofbi for " .. name)
111 end
112 end
113end
114addCommandHandler("addgofbi", addgofbi)
115
116function addgosapd(source, commandname, name)
117 if getPlayerFromName(name) then
118 if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("L5")) or getAccountName(getPlayerAccount(source)) == "Dusty" then
119 dbExec(con, "INSERT INTO goTeam VALUES (?, ?)", sapd,getPlayerAccount(getPlayerFromName(name)))
120 outputChatBox("Added", source)
121 outputServerLog ( getPlayerName ( source ) .. " added /gosapd for " .. name)
122 end
123 end
124end
125addCommandHandler("addgosapd", addgosapd)