-
Posts
1,193 -
Joined
-
Last visited
Everything posted by tosfera
-
try this; bodypartImage = { [3] = "torso.png", [4] = "ass.png", [5] = "leftarm.png", [6] = "rightarm.png", [7] = "leftleg.png", [8] = "rightleg.png", [9] = "head.png", }
-
haha well, wich line does the error say; its normally like; filename:error - error.
-
wich line, cause it looks good to me. ( the first one )
-
haha sure, I'll wait for your reply.
-
hmmm,,, function(killer, weapon, bodypart) and if ( attacker ) and ( attacker ~= source ) then Can you see your own mistake now?
-
Okee I've been knocked-out for a few days, whats not working? my comment was posted WAY tolate cause the internet was being a bitch at my intership
-
oh, try this then; addCommandHandler("startFunc", function ( source, commandName ) for i, players in ipairs(getElementType("player")) do local team = getPlayerTeam ( player ) if ( team and getTeamName(team) == "criminal" ) then function_name_here(Parameters, here) end end end )
-
wich team, wich function? edit: try this; addCommandHandler("startFunc", function ( source, commandName ) for i, players in ipairs(getElementType("player")) do local team = getPlayerTeam ( player ) if team then function_name_here(Parameters, here) end end end )
-
dude, this will totally not work for him cause he wont add the "occupation" to any character as data. You should give it first, but he didn't. (as far as we can see cause he didn't post that part of the script). @Sasuke, You could try to do it with a onMarkerHit. just easy like; addEventHandler("onMarkerHit", root, function ( hitElement ) if ( root == markerProsti and getElementType( hitElement ) == "player" ) then destroyElement(markerProsti) end end )
-
Okee I've been knocked-out for a few days, whats not working?
-
Wrong, if i wasn't on a project, i would have been scripting for free. Wait wait wait, so you're going to script for free. Should I google the word 'free' for you? O_O You wont get anything back,,, like. You script it, and bam. You're out... O_O
-
Howmuch does it pay? Stuff I made myself; Fuel system, vehicle shop, radio system, login, jobs like; mechanic, cop, pilot, trashman. Job levels, shops and a few more useless things.
-
If I can remember it good, it has an option to view the code. Just copy the code and save it in a file.
-
The thing what I did with this was; I created a database table, inluding the model, x, y, z and the owner. (Also the upgrades). When the owner is spawning his car, he'll get a total new car with the same hpgrades. Try looking at this; executeSQLQuery I can write something like that for you tomorrow. Just pm me your skype, Im about to go sleeping. (On my phone atm)
-
Just go into the admin resource en copy it out, make a new resource with that code and the functions. No need to remaKe all the functions.
-
The thing you can do for the admin panel is, create a gridview containing all the players, then select one and press the butten. After the button is pressed, use a triggerClientEvent to pop it up at the selected player.
-
okee you want players not to chat but you want them to see the outputChatBox msg's, well then just cancel the event, if you want to make it for admins only, lookup if the name is in the ACL, if you want registered uesrs only, check if its an account or not. O_O
-
something like addEventHandler("onPlayerchat", root, function ( ) cancelEvent() end) ?
-
Omfg, finally I can get rid of the wiki for like,,, 90%! thanks mate!
-
It is possible, I've seen servers that were like; press 9 to browse 9-gag.Just dont know wich function it is. if You know it, let me know. Might use it to browse youtube and stream the movies. n_n
-
is it case sensitive?! O_O Of course. learned something new again! @illestiraqi, you made the same mistake as I did. you said this; addEventHandler("onClientMarkerHit", , ) And thats something that is wrong! You should do it like this; addEventHandler("onClientMarkerHit", root, ) And inside your function, check if the marker is the job marker; if ( source == marker ) then try this, client: local SAPDJobMarker = createMarker( 186.30000305176, 1938.3000488281, 16.700000762939, "cylinder", 2, 0, 40, 0, 150) GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} function guiMyCwindow(w,h,t) local x,y = guiGetScreenSize() return guiCreateWindow((x-w)/2,(y-h)/2,w,h,t,false) end windowjob = guiMyCwindow(301,170,"Armed Soldier") guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,80,108,35,"Take job",false,windowjob) GUIEditor_Button[3] = guiCreateButton(22,120,108,35,"Quit Job",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,120,110,36,"Cancel",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(19,33,273,20,"Are you sure you want to take/leave this job?",false,windowjob) function SAPDjob(hitElement) if (getElementType(hitElement) == "player") and (hitElement == localPlayer) and (source == SAPDJobMarker) then guiSetVisible(windowjob, true) showCursor(true) end end addEventHandler("onClientMarkerHit", root, SAPDjob) function SAPDjobleave(leaveElement) if (source == SAPDJobMarker) and (getElementType(leaveElement) == "player") and (leaveElement == localPlayer) then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", root, SAPDjobleave) function joinTeam() triggerServerEvent("setSAPD",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeTeam() triggerServerEvent("removeSAPD",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[3] , removeTeam, false) function removeSAPDWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeSAPDWindow, false)
-
is it case sensitive?! O_O
-
You know, there are a few people rly active on this forum wich I keep seeing as reply's on people their posts; SolidSnake, 50p, Sasuke, Manve1, X~|Mr.ALM,karthik_184(not that much, but alot), Shazzimal and us! There is 1 more but I couldn't find his name . But still, this forum has somuch 1-day flies... Anyways, good work mate. And to all those people I mentioned above, great work!
-
Got it fixed already. To clear it up abit, I made a vehicle panel for the users. That panel has a button called; engine. This will toggle the users vehicle's engine, but it wasn't working right. It keept spamming new timers for the fuel loss. But right now I removed the total function (client side) of the button, and just triggered the /engine command server sided. So it works now. :3
-
Right now I'm setting the fuel and pos's every 100ms, client sided. it doesn't bring any lag to the client nor server. Just having some trouble, I fixed it for the server command (/engine) that it starts and stops the fuel loss, but I'm trying to make it so for my button to, it just doens't work. It keeps starting a new timer in the function... O_O client: function btnEngineF() local v = getPedOccupiedVehicle( getLocalPlayer() ) if ( v ) then local fuel = getElementData(v, "fuel") if ( tonumber(fuel) > 0.1 ) then local state = getVehicleEngineState(v) if ( state == false ) then setVehicleEngineState(v, true) guiSetText( lblEngineStatus, "Engine status: Started") outputChatBox(getVehicleEngineState(v)) else setVehicleEngineState(v, false) guiSetText( lblEngineStatus, "Engine status: Stopped") outputChatBox(getVehicleEngineState(v)) end triggerServerEvent("fuelUse", getLocalPlayer(), getLocalPlayer()) else errorMsg("You can't start the engine without fuel.") end else errorMsg("You have to be in a vehicle to do this.") end end server: addEvent("fuelUse", true) function fuelUse(p) local vehicle = getPedOccupiedVehicle(p) local engine = getVehicleEngineState(vehicle) if vehicle and engine then setTimer(fuelUse,1000,1,p); if getVehicleEngineState(vehicle) == false then return end local fuel = getElementData(vehicle, "fuel") if fuel == 0 then setVehicleEngineState(vehicle,false); return end local newX,newY,newZ = getElementPosition(vehicle); local oldX = getElementData(vehicle,'oldX') or newX; local oldY = getElementData(vehicle,'oldY') or newY; local oldZ = getElementData(vehicle,'oldZ') or newZ; local vel = (getDistanceBetweenPoints2D(oldX,oldY,newX,newY)/70)+(math.random(100,1000)/50000); local oldX = setElementData(vehicle,'oldX',newX); local oldY = setElementData(vehicle,'oldY',newY); local oldZ = setElementData(vehicle,'oldZ',newZ) local fuel = getElementData(vehicle, "fuel") setElementData(vehicle, "fuel", tonumber(fuel) - (vel / 4)) outputChatBox(fuel) local remainingFuel = getElementData(vehicle, "fuel"); if ( tonumber(remainingFuel) < 0.001) then setElementData(vehicle, "fuel", "0") outputChatBox('Your car has ran out of fuel.',v); setVehicleEngineState(vehicle,false); end end end addEventHandler("fuelUse", getRootElement(), fuelUse)
