-
Posts
1,312 -
Joined
-
Last visited
Everything posted by KariiiM
-
Its working now, i changed something and i fixed some warnings local sx, sy = guiGetScreenSize() function createImage() dxDrawImage((sx-68)/ 2, (sy-54)/2, 68, 54, "yourCrossHair.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end addEventHandler("onClientVehicleEnter", getRootElement(), function () local player = getLocalPlayer() local theVehicle = getPedOccupiedVehicle( player ) if ( getElementType ( theVehicle ) == 'vehicle' and isPedInVehicle ( player ) and getElementModel ( theVehicle ) == 432 ) then if (theVehicle) then addEventHandler ( "onClientRender", root, createImage ) end end end)
-
Edit the image.. you've to draw your own one, click on THIS to see how to draw a image and your picture must be defined in the meta.. and it exist in your resource dxDrawImage (sx,sy,sx,sy,"yourImage.png") --draw your image
-
Hey i scripted this part for you, maybe that's what you need as i understood -Client side addEventHandler("onClientVehicleEnter", getRootElement(), function(thePlayer, seat) local tank = {[432]=true} local theVehicle = getPedOccupiedVehicle(localPlayer) if (not theVehicle) then return end local model = getElementModel(theVehicle) if ( thePlayer == localPlayer) then if ( tank[model] ) then addEventHandler("onClientRender", getRootElement(),dxDraw) end end end) function dxDraw() dxDrawImage (sx,sy,sx,sy,"yourImage.png") --draw your image end
-
Yes it will
-
What do you mean by CCTV ,what it can do explain more?
-
As i see there's no jail time in this code it look like a wanted system script
-
I stole the script O_o? lmao, read the topic well -You just saw this line in my code, it's because he asked me to do for him jetpack script for vip players only and it's an exports on his code if ( exports.SAEGVIP:isPlayerVIP () ) then Please next time be sure of something before tell to someone or name him stealer, Thank you!
-
SQLite is perfect and with good execution, because it's able to get more size of data plus it's faster than other ways, it's creating an unique file and store all the things into it, instead of creating one for each resource. About XML it's just for saving normal stuffs but i recommend you to use sqlite in case you have more stuffs to save. Also you can use MySQL it's similar to SQLite but the advantage about MySQL is that you can use phpMyAdmin or any other PHP file and display the data to a web page. It's much more functional since, if you need, for example, to control your server from the web or from a smart phone, it's much easier to implement with MySQL than with SQLite, SQLite create a file complied so you can't manage it not like Mysql, but it still your choice.
-
I think they know the way of their works i also understood it, after they finishing the features they keep testing or releasing the beta or the preview version to test it with players like that they'll avoid problems not like if they released a main version in their first moment they finished the features, it may cause some problems if it was with unknown bugs, So one year without bugs better than 4months with bugs.
-
i don't have i wanna add it Okay no problem, i made this jetpack code for you, copy it correctly and put it to server side --Server side: bindKey(source,"J","down",jetpack) function jetpack(player,key,state) if ( exports.SAEGVIP:isPlayerVIP () ) then if (doesPedHaveJetPack(player)) then removePedJetPack(player) outputChatBox("Jetpack Removed.",player,255,0,0) else if (not doesPedHaveJetPack(player)) then givePedJetPack(player) outputChatBox("Jetpack Actived.",player,0,255,0) end end end end
-
No, they're just tables Copy this code replace it with server side, it should works local spawners = { ['Free'] = { }, ['Job'] = { } } local spawnedVehciles = { } function createFreeSpawner ( x, y, z, rz, sx, sy, sz ) local i = #spawners['Free']+1 local z = z - 1 local sx, sy, sz = sx or x, sy or y, sz or z+1.5 local rz = rz or 0 spawners['Free'][i] = createMarker ( x, y, z, 'cylinder', 2, 255, 255, 255, 120 ) setElementData ( spawners['Free'][i], "SpawnCoordinates", { sx, sy, sz, rz } ) setElementData ( spawners['Free'][i], "SAEGVehicles:SpawnVehicleList", JobVehicles['Free'] ) setElementData ( spawners['Free'][i], "SAEGVehicles:JobRestriction", false ) addEventHandler ( "onMarkerHit", spawners['Free'][i], onSpawnerHit ) return spawners['Free'][i] end function createJobSpawner ( job, x, y, z, colors, rz, sx, sy, sz ) local i = #spawners['Job']+1 local z = z - 1 local sx, sy, sz = sx or x, sy or y, sz or z+1.5 local rz = rz or 0 local r, g, b = unpack ( colors ) spawners['Job'][i] = createMarker ( x, y, z, 'cylinder', 2, r, g, b, 120 ) setElementData ( spawners['Job'][i], "SpawnCoordinates", { sx, sy, sz, rz } ) setElementData ( spawners['Job'][i], "SAEGVehicles:SpawnVehicleList", JobVehicles[job] ) setElementData ( spawners['Job'][i], "SAEGVehicles:JobRestriction", tostring ( job ) ) addEventHandler ( "onMarkerHit", spawners['Job'][i], onSpawnerHit ) return spawners['Job'][i] end function onSpawnerHit ( p ) local job = string.lower ( getElementData ( source, "SAEGVehicles:JobRestriction" ) or "false" ) if ( job == 'false' ) then job = false end local pJob = string.lower ( getElementData ( p, "Job" ) or "" ) if ( job ) then if ( pJob ~= job ) then exports['SAEGMessages']:sendClientMessage ( "This spawner is for the "..job.." job. You're not in the "..job.." job.", p, 255, 140, 40 ) return end end if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) ) then local list = getElementData ( source, "SAEGVehicles:SpawnVehicleList" ); triggerClientEvent ( p, 'SAEGSpawners:ShowClientSpawner', p, list, source ) triggerEvent ( "SAEGSpawners:onPlayerOpenSpawner", source, p ) end end addEvent ( "SAEGSpawners:spawnVehicle", true ) addEventHandler ( "SAEGSpawners:spawnVehicle", root, function ( id, x, y, z, rz, job ) local c = exports['SAEGAntiRestart']:createPlayerVehicle ( source, id, x, y, z, rz, true, job ) if ( exports.SAEGVIP:isPlayerVIP ( ) ) then addVehicleUpgrade(c, 1010) end end ) for i, v in pairs ( data ) do if ( i == 'Free' ) then for k, e in ipairs ( v ) do createFreeSpawner ( unpack ( e ) ) end elseif ( i == 'Jobs' ) then for k, e in ipairs ( v ) do createJobSpawner ( unpack ( e ) ) end end end addEvent ( "SAEGSpawners:onPlayerOpenSpawner", true )
-
Get the element data of vip and check it then set Netro
-
Where's your jetpack script part?
-
There are 2 events to uses in this situation, first one onPlayerJoin that mean when the player join into the server but his account still guest in this case you can hide it second event is onPlayerLogin as Deelman said, it's about the player who logged in with an account so in this case you can make it visible
-
What? The first problem is solved? Second problem , check in the meta.xml if the 'SAEGPolice:JailPlayer exports is exist or the file is SAEGPolice is like that
-
Function: showPlayerHudComponent Example: showPlayerHudComponent ( source, "clock", false )
-
Try that and tell me replace your jail_s.lua with this code local WARP_LOCS = { DEFAULT = { }, ADMIN = { }, RELEASE = { } } addEventHandler ( "onResourceStart", resourceRoot, function ( ) local warp_default = get ( "*JAIL_WARP_LOCATION" ); local warp_admin = get ( "*JAIL_WARP_ADMIN_LOCATION" ); local warp_release = get ( "*JAIL_WARP_RELEASE_LOCATION" ); if ( not warp_default ) then outputDebugString ( "Couldn't find '*JAIL_WARP_LOCATION' setting in SAEGPolice" ); WARP_LOCS.DEFAULT = { 0, 0, 0 } else local warp_default = split ( warp_default, "," ); if ( #warp_default ~= 3 ) then outputDebugString ( "'*JAIL_WARP_LOCATION' setting value should be x,y,z (no spaces, please confirm format is correct)" ); WARP_LOCS.DEFAULT = { 0, 0, 0 } elseif ( not tonumber ( warp_default[1] ) or not tonumber ( warp_default[2] ) or not tonumber ( warp_default[3] ) ) then outputDebugString ( "Failed to convert all '*JAIL_WARP_LOCATION' coordinates to floats. Please confirm they are numbers" ); WARP_LOCS.DEFAULT = { 0, 0, 0 } else WARP_LOCS.DEFAULT = { tonumber(warp_default[1]), tonumber(warp_default[2]), tonumber(warp_default[3]) }; end end if ( not warp_release ) then outputDebugString ( "Couldn't find '*JAIL_WARP_RELEASE_LOCATION' setting in SAEGPolice" ); WARP_LOCS.RELEASE = { 0, 0, 0 } else local warp_release = split ( warp_release, "," ); if ( #warp_release ~= 3 ) then outputDebugString ( "'*JAIL_WARP_RELEASE_LOCATION' setting value should be x,y,z (no spaces, please confirm format is correct)" ); WARP_LOCS.RELEASE = { 0, 0, 0 } elseif ( not tonumber ( warp_release[1] ) or not tonumber ( warp_release[2] ) or not tonumber ( warp_release[3] ) ) then outputDebugString ( "Failed to convert all '*JAIL_WARP_RELEASE_LOCATION' coordinates to floats. Please confirm they are numbers" ); WARP_LOCS.RELEASE = { 0, 0, 0 } else WARP_LOCS.RELEASE = { tonumber(warp_release[1]), tonumber(warp_release[2]), tonumber(warp_release[3]) }; end end if ( not warp_admin ) then outputDebugString ( "Couldn't find '*JAIL_WARP_ADMIN_LOCATION' setting in SAEGPolice" ); WARP_LOCS.ADMIN = { 0, 0, 0 } else local warp_admin = split ( warp_admin, "," ); if ( #warp_admin ~= 3 ) then outputDebugString ( "'*JAIL_WARP_ADMIN_LOCATION' setting value should be x,y,z (no spaces, please confirm format is correct)" ); WARP_LOCS.ADMIN = { 0, 0, 0 } elseif ( not tonumber ( warp_admin[1] ) or not tonumber ( warp_admin[2] ) or not tonumber ( warp_admin[3] ) ) then outputDebugString ( "Failed to convert all '*JAIL_WARP_ADMIN_LOCATION' coordinates to floats. Please confirm they are numbers" ); WARP_LOCS.ADMIN = { 0, 0, 0 } else WARP_LOCS.ADMIN = { tonumber(warp_admin[1]), tonumber(warp_admin[2]), tonumber(warp_admin[3]) }; end end outputDebugString ( "Default jail warp location: "..tostring ( table.concat( WARP_LOCS.DEFAULT, ", " ) ) ) outputDebugString ( "Admin jail warp location: "..tostring ( table.concat( WARP_LOCS.ADMIN, ", " ) ) ) outputDebugString ( "Release jail warp location: "..tostring ( table.concat( WARP_LOCS.RELEASE, ", " ) ) ) end ); local jailedPlayers = { } function isPlayerJailed ( p ) if ( p and getElementType ( p ) == 'player' ) then if ( jailedPlayers[p] ) then return tonumber ( getElementData ( p, 'SAEGPolice:JailTime' ) ) else return false end end return nil end function jailPlayer ( p, dur, announce, element, reason ) if( p and dur ) then local announce = announce or false jailedPlayers[p] = dur setElementInterior ( p, 0 ) setElementDimension ( p, 33 ) local __x, __y, __z = unpack ( WARP_LOCS.DEFAULT ) if ( element and reason ) then __x, __y, __z = unpack ( WARP_LOCS.ADMIN ) end setElementPosition ( p, __x, __y, __z ); --outputChatBox ( table.concat ( { __x, __y, __z }, ", " ) ); setElementData ( p, 'SAEGPolice:JailTime', tonumber ( dur ) ) setElementData ( p, "isGodmodeEnabled", true ) exports['SAEGJobs']:updateJobColumn ( getAccountName ( getPlayerAccount ( p ) ), 'TimesArrested', "AddOne" ) if ( announce ) then local reason = reason or "Classified" local msg = "" if ( element and reason ) then msg = getPlayerName ( p ).." has been jailed by "..getPlayerName ( element ).." for "..tostring ( dur ).." seconds ("..reason..")" elseif ( element ) then msg = getPlayerName ( p ).." has been jailed by "..getPlayerName ( element ).." for "..tostring ( dur ).." seconds" end exports['SAEGMessages']:sendClientMessage ( msg, root, 0, 120, 255 ) exports['SAEGLogs']:outputPunishLog ( p, element or "Console", tostring ( msg ) ) end triggerEvent ( "onPlayerArrested", p, dur, element, reason ) triggerClientEvent ( p, "onPlayerArrested", p, dur, element, reason ) return true end return false end function unjailPlayer ( p, triggerClient ) local p = p or source setElementDimension ( p, 0 ) setElementInterior ( p, 0 ) setElementPosition ( p, 1543.32, -1675.6, 13.56 ) exports['SAEGMessages']:sendClientMessage ( "You've been released from jail! Behave next time.", p, 0, 255, 0 ) jailedPlayers[p] = nil setElementData ( p, "SAEGPolice:JailTime", nil ) setElementData ( p, "isGodmodeEnabled", nil ) exports['SAEGLogs']:outputActionLog ( getPlayerName ( p ).." has been unjailed" ) if ( triggerClient ) then triggerClientEvent ( p, 'SAEGJail:StopJailClientTimer', p ) end end addEvent ( "SAEGJail:UnjailPlayer", true ) addEventHandler ( "SAEGJail:UnjailPlayer", root, unjailPlayer ) function getJailedPlayers ( ) return jailedPlayers end addCommandHandler ( "jail", function ( p, _, p2, time, ... ) if ( exports['SAEGAdministration']:isPlayerStaff ( p ) ) then if ( p2 and time ) then local toJ = getPlayerFromName ( p2 ) or exports['SAEGPlayerFunctions']:getPlayerFromNamePart ( p2 ) if toJ then jailPlayer ( toJ, time, true, p, table.concat ( { ... }, " " ) ) else exports['SAEGMessages']:sendClientMessage ( "No player found with \""..p2.."\" in their name.", p, 255, 0, 0 ) end else exports['SAEGMessages']:sendClientMessage ( "Syntax: /jail [player name/part of name] [seconds] [reason]", p, 255, 255, 0 ) end end end ) addCommandHandler ( "unjail", function ( p, _, p2 ) if ( not exports['SAEGAdministration']:isPlayerStaff ( p ) ) then return false end if ( not p2 ) then return exports['SAEGMessages']:sendClientMessage ( "Syntax: /unjail [player]", p, 255, 255, 0 ) end if ( not getPlayerFromName ( p2 ) ) then p2 = exports['SAEGPlayerFunctions']:getPlayerFromNamePart ( p2 ) if not p2 then return exports['SAEGMessages']:sendClientMessage ( "That player doesn't exist on the server.", p, 255, 0, 0 ) end end if ( jailedPlayers[p2] ) then exports['SAEGMessages']:sendClientMessage ( "You've unjailed "..getPlayerName ( p2 ).."!", p, 0, 255, 0 ) exports['SAEGMessages']:sendClientMessage ( "You've been unjailed by "..getPlayerName ( p ).."!", p2, 0, 255, 0 ) unjailPlayer ( p2, true ) setElementData ( p, "WantedPoints", 0 ) else exports['SAEGMessages']:sendClientMessage ( "That player isn't jailed.", p, 255, 0, 0 ) end end ) addEventHandler ( "onResourceStop", resourceRoot, function ( ) exports['NGSQL']:saveAllData ( false ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) setTimer ( function ( ) local q = exports['NGSQL']:db_query ( "SELECT * FROM accountdata" ) local data = { } for i, v in ipairs ( q ) do data[v['Username']] = v['JailTime'] end for i, v in pairs ( data ) do local p = exports['SAEGPlayerFunctions']( i ) if p then local t = tonumber ( getElementData ( p, 'SAEGPolice:JailTime' ) ) or i jailPlayer ( p, tonumber ( t ), false ) end end end, 500, 1 ) end ) addEvent ( "onPlayerArrested", true )
-
Does this RPG gamemode have wanted system if yes post part of it
-
function tazershootserverside ( ) toggleControl (source, "fire", false) setTimer(toggleControl, 5000, 1, source, "fire", true) setPedAnimation ( source, "RIFLE", "RIFLE_load") setTimer(setPedAnimation, 2000, 1, source, false) end addEvent ( "ontazershoot", true ) addEventHandler ( "ontazershoot", root, tazershootserverside )
-
Yes i understand this part, but what's the role of this image? moving or doing what also what's position of it you want it to take the crosshair place or at where
-
I think he want to do an custom crosshair
-
You mean, when you create the speaker object in different dimension the object keep showing in the default dimension 0? IF Yes, you've to get the player's dimension then set the object the dimension of the player that you got his dim with getElementDimension function. Here are all the functions that you need in this case getElementDimension setElementDimension