-
Posts
244 -
Joined
-
Last visited
Everything posted by Price.
-
well my point is when i mute them or ban them it gets written in the punishlog of a specific player i banned or muted, Ex: i banned someone called Price Price has been banned be price for 3 hrs Punishlog: 3/11/2013 Price has been banned for 3 hours reason: test
-
actually someone told me to make that XML thingy, and i really have no idea how to make mysql or sql stuff to get this done. yea but it i still need the punishments gets written when i mute or ban anyone.
-
addEventHandler ( "onPedWasted", root, function ( ammo, killer, killerweapon, bodypart ) if ( killer ) and ( killer ~= source ) then givePlayerMoney ( killer, 2000 ) end end ) try this
-
actually this is new for me the mysql and stuff but uhm i was trying to make punishlog so i can do /punishlog opens me a gui so far i made that gui and command the thing i need help with is , when i mute or jail or ban....etc those kind of punishments it gets written in the player's punishlog and also i couldn't make the /punishlog to appear to specific person, i mean when i do /punishlog it appears for me only and for my serial number only bec of the punishments for me and if anyon e else did /punishlog it opens it for his serial number only, need help GUIEditor = { tabpanel = {}, tab = {} } windowhelp = guiCreateWindow(0, 0, 800, 600, "Punish Log", false) guiWindowSetSizable(windowhelp, false) GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 33, 781, 557, false, windowhelp) GUIEditor.tab[1] = guiCreateTab("PunishLog", GUIEditor.tabpanel[1]) rulesEN = guiCreateMemo(4, 4, 773, 525, "", false, GUIEditor.tab[1]) guiMemoSetReadOnly(rulesEN, true) buttonclose = guiCreateButton(691, 24, 99, 29, "Close Window", false, windowhelp) guiSetVisible (windowhelp,false) function windowhelpopen() if guiGetVisible (windowhelp) == true then guiSetVisible (windowhelp,false) showCursor (false) else showCursor (true) guiSetVisible (windowhelp,true) end end addCommandHandler( "punishlog", windowhelpopen ) function windowhelpclose () if source == buttonclose then showCursor (false) guiSetVisible (windowhelp,false) end end addEventHandler ("onClientGUIClick", root, windowhelpclose) function createFileHandler() local RootNode = xmlCreateFile("new.xml"," newroot") local NewNode = xmlCreateChild(RootNode, "newchild") xmlSaveFile(RootNode) end addCommandHandler("createfile", createFileHandler)
-
what bugs , if there are errors post them also.
-
i dont get it, what are you trying to do ?
-
you haven't named your function at line 19 , here try this not sure if it would work local Exercito = getTeamFromName ( "Exercito" ) function Exercitosobymanawydan ( thePlayer) local AclNome = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..AclNome, aclGetGroup ( "Admin" ) ) then nemesi = exports [ "slothBot" ]:spawnBot ( 103.65139007568,1902.8734130859,33.8984375, 90, math.random ( 300, 303 ), 0, 0, Exercito, 34, "guarding", true ) setElementModel ( nemesi, 287 ) BlipExercito = createBlipAttachedTo ( nemesi, 0, 2, 11, 86, 16, 255, 1) triggerClientEvent ( "nsound", root ) setElementData(nemesi, "exercito",true) if nemesi then exports.extra_health:setElementExtraHealth ( nemesi, 100 ) end end end addCommandHandler("exercito", Exercitosobymanawydan) setTimer ( destroyElement, 3600000, 0, slothbot) function onplayerkill( ammo, killer, killerweapon, bodypart ) if (source == nemesi) then if ( killer ) and ( killer ~= source ) then givePlayerMoney(killer,math.random(4000,6000)) outputChatBox ( getPlayerName ( killer ) .. " #081DBFmatou um soldado",getRootElement(), 255, 255, 255, true ) exports.exp_system:addPlayerEXP ( killer, 600 ) destroyElement(BlipExercito) addEventHandler ( "onPlayerWasted", getRootElement(), rewardOnWasted ) end end function SetAdmExercitoTeam(thePlayer) local AclNome = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..AclNome, aclGetGroup ( "Admin" ) ) then setPlayerTeam ( thePlayer, Exercito ) end end addCommandHandler("nemesiTeam",SetAdmExercitoTeam) EDIT: also mention your errors.
-
you can check wiki : function rewardOnWasted ( ammo, killer, killerweapon, bodypart ) --if there is a killer, and that killer is not the same person as whoever died if ( killer ) and ( killer ~= source ) then givePlayerMoney ( killer, 1000 ) --reward the killer with 1000 cash. end end addEventHandler ( "onPlayerWasted", getRootElement(), rewardOnWasted ) - Check if you have defined killer ammo and that stuff.
-
i've tried something else worked without chatbox, but your code is so much better thanks!
-
well is there a better code to do it?
-
well let's forget about the chatbox, let's do when i do /staff it gets me to team and starts godmode normally might this work? from 1st time. team = createTeam ( "Staff", 255, 255, 255 ) function teamSet ( thePlayer ) local team = getTeamFromName ( "Staff" ) local account = getPlayerAccount ( thePlayer ) if ( not account or isGuestAccount ( account ) ) then return end local accountName = getAccountName(account ) if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "L5" ) ) ) then if getElementData ( thePlayer, "invincible" ) then setElementData ( thePlayer, "invincible", false) setElementModel ( thePlayer, 217 ) setPlayerTeam ( thePlayer, team ) setPlayerNametagColor ( thePlayer, 255, 255, 255 ) else setElementData ( thePlayer, "invincible", true) end end end addEvent ( "sTeame", true ) addEventHandler ( "sTeame", root, teamSet ) addCommandHandler ( "staff", teamSet )
-
this what gives me when i do /staff PS: godmode or setteam not working nothing is working atm.
-
uhm no keeps saying same text wether if it said 1Enabled , it will keep saying Enabled all the time i do /staff
-
where i typed GodMode Enabled, if i made it true and the other false the other chatbox when it says GodMode Disabled will keep getting repeated, ex: /staff "GodMode Disabled", /staff "GodModeDisabled" , /staff "GodMode Disabled" doesnt say except 1 chatbox if i reversed it.
-
well i did that , then it tells me whenever i do /staff GodMode Disabled or Enabled when i do /staff again says same text
-
will you please fix it for me?
-
well uhm iam really confused , can you help ? uhm which arguments to use in client and server sided?
-
that means i cant make a marker opens a gui on hit, and use it as i wanted?
-
well guys this code will seem a big mess but its a carjacker job when i hit the marker a gui should get opened and tells me accept or close if i accepted i get into criminal team and the job starts where i go steal a car and bring it back , the problem is it tells me go and steal the car marked on your map without any gui or getting me into criminal team Server Sided: vehicleslocations = { {2376.79296875, -1928.578125, 13.3828125}, {2494.0791015625, -1751.0302734375, 13.484757423401} } idlist = {602, 496, 589, 429, 541, 562, 559, 411, 560, 506} addEventHandler("onPlayerQuit", root, function() if vehicle[source] then destroyElement(vehicle[source]) destroyElement(vehicleBlip[source]) vehicle[source] = nil vehicleBlip[source] = nil end end) Teame = createTeam("Criminal", 255, 255, 0) CriminalTeams = { [Teame] = true } CrimVehs = { [420] = true } function teamSet ( ) local team = getTeamFromName ( "Criminal" ) if team then setPlayerTeam ( source, team ) setPlayerNametagColor ( source, 0, 255, 0 ) setElementModel(source, 57) outputChatBox("You are now employed as a Carjacker!", thePlayer) else local teamw = getTeamFromName ( "Criminal" ) if teamw then cancelEvent() outputChatBox("You are already a Carjacker!", source) end end end addEvent ( "sTeame", true) addEventHandler ( "sTeame", root, teamSet ) function enterVehicle ( thePlayer, seat, jacked ) -- when a player enters a vehicle if getElementType ( thePlayer ) == "player" then if ( CriminalVehs[getElementModel ( source )] ) and ( not CriminalTeams[getPlayerTeam( thePlayer )] ) then -- if the vehicle is one of 4 police cars, and the skin is not a police skin removePedFromVehicle( thePlayer )-- force the player out of the vehicle outputChatBox("Only Carjackers can drive this vehicle!", thePlayer) end end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) markers = { } blips = { } peds = { } mposi = { } mposii = {} Client Sided: GUIEditor = { memo = {}, button = {}, window = {}, } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0.29, 0.24, 0.42, 0.49, "", true) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) bAccept = guiCreateMemo(0.08, 0.20, 0.41, 0.67, "", true, GUIEditor.window[1]) bAccept = guiCreateButton(0.60, 0.20, 0.34, 0.17, "Accept", true, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bAccept, showGUIbf, false) addEventHandler("onClientGUIClick", bAccept, joinTeam, false) bClose = guiCreateButton(0.67, 0.61, 0.20, 0.16, "CLOSE", true, GUIEditor.window[1]) guiSetProperty(bClose, "NormalTextColour", "FFAAAAAA") addEventHandler("onClientGUIClick", bClose, showGUIbf, false) GUIEditor.memo[1] = guiCreateMemo(0.08, 0.20, 0.41, 0.67, "Become a Carjacker and Steal the cars marked on your map and get it here to get your money", true, GUIEditor.window[1]) end ) CarJackerPed = createPed(250, 2744.6552734375, -2004.0751953125, 13.547199249268) createBlipAttachedTo(CarJackerPed,12, 2, 255, 0, 0, 255, 0, 200) setPedRotation(CarJackerPed, 358) setElementFrozen(CarJackerPed, true) pedMarker = createMarker(2744.5107421875, -2002.25390625, 12.5, "cylinder", 1.5, 255, 0, 255, 255) vehicleMarker = createMarker(2758.03101, -2000.57129, 12.5, "cylinder", 1.5, 0, 255, 0, 255) function showGUIbt(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then guiSetVisible(GUIEditor.window[1], true) showCursor( true ) end end function showGUIbf() guiSetVisible (GUIEditor.window[1], false ) showCursor ( false ) end addEventHandler("onClientMarkerHit", pedMarker, showGUIbt) function joinTeam() triggerServerEvent("sTeame", localPlayer, "teamSet") end local vehicle = {} local vehicleBlip = {} addEventHandler("onMarkerHit", root, function(player) if getElementType(player) == "player" then if source == pedMarker then if not vehicle[player] then local ID = idlist[math.random(#idlist)] local x, y, z = unpack(vehicleslocations[math.random(#vehicleslocations)]) vehicle[player] = createVehicle(ID, x, y, z) vehicleBlip[player] = createBlipAttachedTo(vehicle[player], 32) setElementVisibleTo(vehicleBlip[player], root, false) for i, p in ipairs(getElementsByType("player")) do if getPlayerTeam(player) == getTeamFromName("Criminal") then setElementVisibleTo(vehicleBlip[player], p, true) end end outputChatBox("Go and steal the car marked on your map and bring it here", player, 170, 0, 0) else outputChatBox("You already got a car to steal", player, 170, 0, 0) end elseif source == vehicleMarker then if vehicle[player] then local veh = getPedOccupiedVehicle(player) if veh then local contoler = getVehicleController(veh) if contoler == player then destroyElement(vehicle[player]) destroyElement(vehicleBlip[player]) vehicle[player] = nil vehicleBlip[player] = nil givePlayerMoney(player, math.random(1000, 1500)) end end end end end end)
-
this is awesome man gj!
-
a friend helped me, thx close this please
-
i've tried and failed as hell only thing I could have done is the gui nothing else.
-
guys someone help i need this script so fast