
Michael#
Members-
Posts
168 -
Joined
-
Last visited
Everything posted by Michael#
-
I first was like "oh what" and then you said "It's Draken". Off-topic: What is with your old account? I just stopped using it, I hate it ( You'll not understand this, but..... ) Ann: I updated code now, I found something not needed.
-
My bad... pList = guiCreateGridList ( 17, 59, 166, 327, false, WinSend ) guiGridListSetSelectionMode ( pList, 2 ) onUpdateMoneyPlayerList = function ( ) local column = guiGridListAddColumn ( pList, 'Player', 0.85 ) if ( column ) then for _, player in ipairs ( getElementsByType 'player' ) do local row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( player ), false, false ) end addEventHandler ( 'onClientGUIClick', root, click ) elseif ( source == bhsh ) then guiGridListClear ( pList ) local sName = guiGetText ( source ) if ( sName ~= '' ) then for _, player in ipairs ( getElementsByType 'player' ) do if ( string.find ( getPlayerName ( player ):lower ( ), sName:lower ( ), 1, true ) ) then local row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( player ), false, false ) end end end end end addEventHandler ( 'onClientGUIClick', root, onUpdateMoneyPlayerList ) addEventHandler ( 'onClientPlayerChangeNick', root, onUpdateMoneyPlayerList ) addEventHandler ( 'onClientPlayerQuit', root, onUpdateMoneyPlayerList ) addEventHandler ( 'onClientPlayerJoin', root, onUpdateMoneyPlayerList ) addEventHandler ( 'onClientResourceStart', root, onUpdateMoneyPlayerList ) function click ( ) if ( source == pList ) then local row, col = guiGridListGetSelectedItem ( source ) if ( row and col and row ~= -1 and col ~= -1 ) then local pName = guiGridListGetItemText ( source, row, col ) guiSetText ( plnmedit, tostring ( pName ) ) end end end Copy all my code, not just a part!
-
Example: setWeaponProperty ( "ak47", "pro", "damage", 1000 )
-
I have done this and this works! You can trigger the "onMarkerHit" or "onCopShapeHit" event by attach an vehicle (like the tiny RC-Cam(594) to the object and sit a invisible PED into it, then the PED does trigger the event
-
Hi guys. Some time ago I created a GangWar mode but I don't wanna continue it.. So, I'm here to give you it. Features: -- Simple Gang System ( Uses SQLite ) -- Turf System ( Uses XML Files, you can create just zones by GTASA zone name, I haven't found another way to get wish colshape you hit ) -- Simple Spawn System ( I was thinking in something more ... cool, but I'm not going to continue it, so script by yourself ) -- Register / Login System It has some bugs that I haven't solved, so, solve them if you want Download here: http://www.mediafire.com/?1psxy2fk9p3ifh6 Hope you like PS: Thanks CapY to give me the idea of getting colshape by zone name And command /gangzona is just for creating the gangzones, it's more easy. Updated.
-
What is "sounds [ vehicle ]" ? What is "vehicle" ?
-
It must say something in the function page too Just in functions list is not enough, I think.
-
It seems to work, it has nothing related to version in the wiki.
-
What is "result" in the other code?
-
Just use: onResourceStart -- Server-side onClientResourceStart -- Client-side
-
Client-side: addEventHandler ( 'onClientResourceStart', resourceRoot, function ( ) triggerServerEvent ( 'requestForRadios', localPlayer ) end ) BIAC = guiCreateWindow(436,285,486,412,"Box In A Car -- BIAC",false) mList = guiCreateGridList(21,144,183,259,false,BIAC) guiGridListSetSelectionMode(mList,2) guiWindowSetSizable (BIAC, false) GUIEditor_column = guiGridListAddColumn(mList,"Muziek",0.9) --Buttons playM = guiCreateButton(251,154,175,49,"Play",false,BIAC) stopM = guiCreateButton(251,254,175,49,"Stop",false,BIAC) --Label vSrn = guiCreateLabel(258,331,82,80,"Version 1.0",false,BIAC) guiLabelSetColor(vSrn,255, 0 ,0) guiSetFont(vSrn,"default-bold-small") guiSetVisible ( BIAC, false ) bindKey ( 'f2', 'down', function ( ) guiSetVisible ( BIAC, not guiGetVisible ( BIAC ) ) showCursor ( not isCursorShowing ( ) ) end ) addEventHandler ( 'onClientGUIClick', root, function ( btn, btnState ) if ( btn == 'left' and btnState == 'up' ) then if ( source == playM ) then local row, col = guiGridListGetSelectedItem ( mList ) if ( row and col and row ~= -1 and col ~= -1 ) then local stationName = guiGridListGetItemText ( mList, row, col ) triggerServerEvent ( 'attachomg', localPlayer, tostring ( stationName ) ) end elseif ( source == stopM ) then triggerServerEvent ( 'testsoundwegserver', localPlayer ) end end end ) --Other events local sounds = {} stationsNames = {} stations = {} addEvent( "testsound", true ) addEventHandler("testsound", root,function(vehicle,stationPath,x,y,z) sirene = playSound3D (stationPath, 0,0,0) attachElements ( sirene, vehicle) setSoundVolume(sirene, 0.7) sounds[vehicle] = sirene end) addEvent( "testsoundremove", true ) addEventHandler("testsoundremove",root,function(com) local sirene = sounds [ vehicle ] stopSound(sirene) outputChatBox ( "gelukt") destroyElement (sirene) end) addEvent ("sendAllRadios", true) addEventHandler ("sendAllRadios",root,function(radia, names, st) stationsNames = names stations = st for k,v in ipairs(stationsNames) do local row = guiGridListAddRow ( mList) guiGridListSetItemText (mList, row, GUIEditor_column, tostring ( v ), false, false ) end end) Server-side: radios = {} stations = {} stationsNames = {} addEvent ("requestForRadios", true) addEventHandler ("requestForRadios",root,function() if radios then triggerClientEvent (client,"sendAllRadios",root, radios, stationsNames, stations) end end) function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(angle+90) local plusX = math.cos(a) * dist local plusY = math.sin(a) * dist return x+plusX, y+plusY end addEventHandler("onResourceStart",resourceRoot,function() xmlFile = xmlLoadFile ("radios.xml") if xmlFile then local children = xmlNodeGetChildren(xmlFile) for k,v in ipairs(children) do for name,value in pairs(xmlNodeGetAttributes(v)) do --outputChatBox (tostring(value)) if(name == "name")then stationName = value elseif(name == "path")then stationPath = value end end end end stations[stationName] = stationPath table.insert (stationsNames, 1, stationName) table.sort (stationsNames) end) addEvent ("attachomg", true) addEventHandler ("attachomg",root,function(station) if station then local stationPath = stations[station] if stationPath then local x,y,z = getElementPosition(client) local rx,ry,rz = getElementRotation (client) local newX, newY = getPointFromDistanceRotation (x,y, 1.5, rz) local newZ = z - 1 outputChatBox ("triggering sucses",client) local com = getPedOccupiedVehicle(client) triggerClientEvent (client,"testsound",root, com, stationPath,newX, newY, newZ) --triggerClientEvent ("onNewRadioCreate", getRootElement(), newX, newY, newZ, stationPath) --outputChatBox ("New station: " .. station .. " created, path: " .. tostring(stationPath), 0,220,0) table.insert (radios, 1, {newX, newY, newZ, stationPath}) end end end) addEvent ("testsoundwegserver", true) addEventHandler ("testsoundwegserver",root,function() local com = getPedOccupiedVehicle (client) outputChatBox ( "triggering sucsesNAARSERVERSIDE",client) triggerClientEvent (client,"testsoundremove",root,com) end) Sorry if something is wrong, just test it.
-
What is "result" ? Also, show connection and you should free result of query.
-
pList = guiCreateGridList ( 17, 59, 166, 327, false, WinSend ) guiGridListSetSelectionMode ( pList, 2 ) onUpdateMoneyPlayerList = function ( ) local pName = getPlayerName ( localPlayer ) local column = guiGridListAddColumn ( pList, 'Player', 0.85 ) if ( column ) then for _, player in ipairs ( getElementsByType 'player' ) do local row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( player ), false, false ) end addEventHandler ( 'onClientGUIClick', root, click ) -- where is click function? also, put in the start of function "if ( source == pList ) then" elseif ( source == bhsh ) then guiGridListClear ( pList ) local sName = guiGetText ( source ) if ( sName ~= '' ) then for _, player in ipairs ( getElementsByType 'player' ) do if ( string.find ( getPlayerName ( player ):lower ( ), sName:lower ( ), 1, true ) then local row = guiGridListAddRow ( pList ) guiGridListSetItemText ( pList, row, column, getPlayerName ( player ), false, false ) end end end end end addEventHandler ( 'onClientGUIClick', root, onUpdateMoneyPlayerList ) addEventHandler ( 'onClientPlayerChangeNick', root, onUpdateMoneyPlayerList ) addEventHandler ( 'onClientPlayerQuit', root, onUpdateMoneyPlayerList ) addEventHandler ( 'onClientPlayerJoin', root, onUpdateMoneyPlayerList ) addEventHandler ( 'onClientResourceStart', root, onUpdateMoneyPlayerList ) Just a edit. Also, what doesn't works? Player names don't appear?
-
I don't think you can create something good. viewtopic.php?f=91&t=42530#p430009
-
Lua is Case-Sensitive.
-
local tVehicles = { [ 411 ] = true; } addEventHandler ( 'onClientVehicleEnter', root, function ( uPlayer ) if ( tVehicles [ getElementModel ( source ) ] ) then -- if vehicle is any of the ids in the table triggerEvent ( 'checkForData', uPlayer ); -- trigger event [ THAT'S JUST AN EXAMPLE ] end end ) You can add more vehicles to the table doing: [ Vehicle ID ] = true; -- change to false if you don't wanna check if vehicle is that Hope you understand.
-
You can simply edit width / height parameter, isn't more easy?
-
guiSetVisible( root, false ); Isn't "guiRoot" ?
-
Fail I'm must learn about tables again