ertlflorian1 Posted September 11, 2012 Share Posted September 11, 2012 I already have a bug fixed but now everything is working, but if the time is up and you are out side and make reconnect the wanteds back? (Its from Godmother) function portjail(thePlayer) takeAllWeapons(thePlayer) local rnd = math.random(1,2) if rnd == 1 then setElementInterior(thePlayer,3, 193.7802734375, 174.71875, 1003.0234375) elseif rnd == 2 then setElementInterior(thePlayer,3,197.900390625, 174.5732421875, 1003.0234375) end end function portoutjail(thePlayer) setElementInterior(thePlayer,0, 2289.52734375, 2423.654296875, 10.8203125) setElementRotation (thePlayer, 0, 0, 180) end Zelle1 = createColCuboid ( 2278.166015625, 2424.8486328125, 3.0, 6.799804685, 10.05, 4.08400478363 ) function arrest(theCop, Command, target) local skinID = getElementModel ( theCop ) local targetplayer = getPlayerFromName(target) local wantedlevel = getPlayerWantedLevel(targetplayer) if getElementData(theCop, "Fraktion") == 1 or (getElementData(theCop,"Fraktion") == 5) or (getElementData(theCop,"Fraktion") == 4) then if wantedlevel >= 1 then if (isElementWithinColShape(theCop, Zelle1) == true) and (isElementWithinColShape(targetplayer, Zelle1) == true) then local knastzeit = wantedlevel*8 setElementData(targetplayer, "Jailtime", knastzeit) portjail(targetplayer) setPlayerWantedLevel(targetplayer,0) outputChatBox("Du wurdest für "..tostring(knastzeit).." Minuten eingesperrt!", targetplayer,255,0,0) outputChatBox("Der Spieler wurde für "..tostring(knastzeit).." Minuten eingesperrt!", theCop,0,255,0) else outputChatBox("Fehler!", theCop,255,0,0) end else outputChatBox("Dieser Spieler hat keine Wanteds!", theCop) end else outputChatBox("Du bist kein Beamter oder nicht im Dienst!", theCop,255,0,0) end end addCommandHandler("arrest", arrest) function wantedout(thePlayer,command) local faction = getElementData(thePlayer, "Fraktion") local skinID = getElementModel ( thePlayer ) if (dutySkins[skinID]) or (getElementData(thePlayer,"Fraktion") == 5) or (getElementData(thePlayer,"Fraktion") == 4) then outputChatBox("Polizeibericht:",thePlayer,0,255,0) for index, cPlayer in pairs(getElementsByType( "player" )) do local wanteds = getPlayerWantedLevel(cPlayer) if wanteds >= 1 then outputChatBox(""..getPlayerName(cPlayer).." wird mit Fahndungslevel "..tostring(wanteds).." gesucht!",thePlayer,255,0,0) end end outputChatBox("______________________",thePlayer,0,255,0) end end addCommandHandler("wanteds", wantedout) function Jailtime() for theKey,thePlayer in ipairs(getElementsByType ( "player" )) do if ( getElementData(thePlayer, "Jailtime") ) then local Jailtime = getElementData ( thePlayer, "Jailtime" ) if Jailtime ~= 0 then setElementData ( thePlayer, "Jailtime", Jailtime - 1 ) if getElementData(thePlayer,"Jailtime") == 0 then portoutjail(thePlayer) setPlayerWantedLevel(thePlayer,0) end end end end end setTimer ( Jailtime, 60000, 0 ) function showtime(thePlayer) local time = getElementData(thePlayer, "Jailtime") outputChatBox("Du musst noch "..time.." Minuten im Gefängnis bleiben!", thePlayer,255,0,0) end addCommandHandler("jailtime", showtime) and function onQuit ( quitType, reason, responsibleElement ) setElementData( source, "Money", getPlayerMoney( source ) ) setElementData( source, "Wantedlevel", getPlayerWantedLevel( source ) ) if getElementData( source, "LoggedIn" ) then local result = mysql_query(sqlcon, "UPDATE user_data SET Fraktion='"..getElementData(source,"Fraktion").."', Skin='"..getElementData(source,"Skin").."', Rank='"..getElementData(source,"Rank").."', \ Spawn='"..getElementData(source,"Spawn").."', Job='"..getElementData(source,"Job").."', Materials='"..getElementData(source,"Materials").."', Drugs='"..getElementData(source,"Drugs").."', \ LicA='"..getElementData(source,"LicA").."', LicB='"..getElementData(source,"LicB").."', LicC='"..getElementData(source,"LicC").."', Money='"..getElementData(source,"Money").."', Bank='"..getElementData(source,"Bank").."', \ Adminlevel='"..getElementData(source,"Adminlevel").."', PlayedM='"..getElementData(source,"PlayedM").."', PlayedH='"..getElementData(source,"PlayedH").."', \ Wanted='"..getElementData(source,"Wanted").."', Jailtime='"..getElementData(source,"Jailtime").."', \ Slot1='"..getElementData(source,"Slot1").."', Slot2='"..getElementData(source,"Slot2").."', Slot3='"..getElementData(source,"Slot3").."', Slot4='"..getElementData(source,"Slot4").."', Slot5='"..getElementData(source,"Slot5").."', \ Slot6='"..getElementData(source,"Slot6").."', Slot7='"..getElementData(source,"Slot7").."', Slot8='"..getElementData(source,"Slot8").."', Slot9='"..getElementData(source,"Slot9").."', Slot10='"..getElementData(source,"Slot10").."', \ Housekey='255' WHERE Username='"..getElementData(source,"Username").."';") mysql_free_result( result ) end end addEventHandler ( "onPlayerQuit", getRootElement(), onQuit ) Can somebody help me? Link to comment
Castillo Posted September 11, 2012 Share Posted September 11, 2012 What you are saying is that is not saving the wanted level correctly? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now