-
Posts
467 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Gravestone
-
Here's the same function with comments. function position() local x,y,z = getElementPosition(localPlayer) -- this will get the position of the player in 'x, y, z' who types the /getpos command outputChatBox(x..", "..y..", "..z+.5, 0, 255, 0) -- this will output the position to the chatbox setClipboard(x..", "..y..", "..z+.5) -- this will copy the position to the player's clipboard outputChatBox("Position has been copied to your clipboard.", 0, 255, 0) -- this will output another text to the chatbox end -- end the function addCommandHandler("getpos", position) -- attach a command to the function '/getpos' By saying this he meant that you'll have to define vehicle ID before 'x, y, z' arguments since the first argument of createVehicle is the model ID of the vehicle to be created and after that the x, y, z argument come. So it would have to be like {Vehicle model, x, y, z}. Example: {520, 0, 0, 4} <-- this will create a hydra in the middle of the GTA's map. // Hope I was enough understandable //
-
CEF Plugins were disabled, not CEF itself.
-
I guess default cmd is the command set by SolidSnake14, however you can change it in settings.
-
PlaySound3D would play a 3rd dimensional sounds which means players near the sound position would be able to hear the sound too and if multiple players join then the sounds will get merged, So PlaySound3D is a bad option, use PlaySound and StopSound onPlayerLogin. You'll have to trigger an event client side from server side because you can't check the login from client.
-
There might be some other code which sets the player's position. For example when you login, you spawn and the play resource sets your position to a random spawn point.
-
There's a bug with this MTA wiki button. When you click on this button and enter some text, the line on which you're entering gets removed replacing the wiki link you wrote it.
-
Oh, setPlayerStat is deprecated, use setPedStat instead.
-
The second argument of addEventHandler is the element the handler should be attached to. 'root' is a predefined variable which gets the root element of any function. Use this: addEventHandler("onPlayerJoin", root, stats) Visit addEventHandler for more information.
-
anyway to fix it so the blades do not kill when they hit you?
Gravestone replied to Andres99907's topic in Scripting
Which blades? -
Does 'edit' table exist?
-
Use isElementVisibleTo to check if the player element can see the marker, if not, cancel the event.
-
'playeraccount' isn't defined.
-
cdTimer = {} function antiSpamRPG(weapon) if isTimer(cdTimer[localPlayer]) then return end if (weapon == 35) then toggleControl("aim_weapon", false) toggleControl("fire", false) cdTimer[localPlayer] = setTimer( function() toggleControl("aim_weapon", true) toggleControl("fire", true) killTimer(cdTimer[localPlayer]) end, 7000, 1 ) end end addEventHandler("onClientPlayerWeaponFire",localPlayer, antiSpamRPG)
-
After seeing the first photo I can see that your file 'backfire.wav' isn't defined in meta.xml of the resource.
-
This made my day
-
It directs you back to this topic, eh.
-
I don't understand, on game-state there are more than 10 servers which have 500+ players but in MTA there aren't that much. What's the reason for this?
- 24 replies
-
- press
- rockpapershotgun
-
(and 1 more)
Tagged with:
-
setPlayerBlurLevel
-
Have you tried using names instead of IDs?
-
No problem.
-
-- server -- function sendRowsToClient() local result = dbPoll(dbQuery( connection, "SELECT * FROM `VList`", -1)) if result and type( result ) == 'table' then for i, v in ipairs(result) do triggerClientEvent(source, "onClientDataReceived", source, v.id, v.name, v.price) end end end -- client -- addEvent("onClientDataReceived", true) addEventHandler("onClientDataReceived", root, function(sID,sName,sPrice) local row = guiGridListAddRow ( PlayerVehicleList ) guiGridListSetItemText ( PlayerVehicleList, row, 1, sID, false, false ) guiGridListSetItemText ( PlayerVehicleList, row, 2, sName, false, false ) guiGridListSetItemText ( PlayerVehicleList, row, 3, sPrice, false, false ) end ) Try this, not tested
-
for index, value in ipairs(result) do -- code here end
-
[HELP ME] Disabled fire in my script, but players can shoot.. Why?
Gravestone replied to Turbe$Z's topic in Scripting
@Bonsai, toggleControl will disable fire from every key that fire is bound to. Use this if your code is server sided: for _, player in ipairs(getElementsByType("player")) do toggleControl(player, "fire", false) end