Jump to content

pa3ck

Members
  • Posts

    1,141
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by pa3ck

  1. Who would actually think that the problem might be with the command name..? I found out the hard way as well... You're welcome.
  2. Yea... the command "test" cannot be used in MTA, your code looks fine and will work as soon as you change the command to something else, like "myaccount".
  3. No matter how experienced you are, you always use the wiki, I have been scripting for years and I can never memorize the parameter list for dxDrawText and I don't actually have to.. Whenever I need something, I open the wiki and I can see the full list of needed/optional parameters. "Debug says it needs argument at argument 3, but I can't think of what to put there..." -> this is when you go to the wiki and look at the examples for that given function, fortunately almost all function have at least 1 example
  4. function adminuzi(thePlayer, commandName, ...) outputDebugString("function is working P1") for group, serverGroupName in pairs( names ) do if group then outputDebugString("P2") if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group )) then outputDebugString("P3 - acl valid") message = table.concat({...}, " ") groupName = names[group] outputChatBox("#0088FF[SUPERFUN-Rangos]#d8001f "..groupName.." "..getFixedName(thePlayer)..": "..message,root,0,0,0,true) end end end end addCommandHandler("asay", adminuzi) Try that
  5. pa3ck

    blip attach

    https://wiki.multitheftauto.com/wiki/OnPlayerJoin No parameters, source is the player.
  6. pa3ck

    blip attach

    See the problem is that g_PlayerData[player] is not a table, you cannot use the '.key' property on it, since it hasn't been initialized yet. Add this before line 10 to make sure it is a table g_PlayerData[player] = {}
  7. Try with simple words like "hello", maybe you go over the character limit of outputChatBox Edit: What is the purpose of this script? You do /asay and every single player sees the message, right? If so change this outputChatBox("#0088FF[SUPERFUN-Rangos]#d8001f "..groupName.." "..getFixedName(thePlayer)..": "..message,v,0,0,0,true) To this: outputChatBox("#0088FF[SUPERFUN-Rangos]#d8001f "..groupName.." "..getFixedName(thePlayer)..": "..message,root,0,0,0,true) And you don't need the for loop with players anyway..
  8. Self-explanatory, looking for a player element @getPlayerAccount, but you passed through something else. What did you pass through? Variable "player", do you have that variable? No, you have "thePlayer", make sure you are always using the correct variable names.
  9. As far as I know client side vehicles are just useless. There are very limited things you can do with them, what you would need to do (or what I did in my cut-scenes), I created like 10-15 vehicles, put them in a table and triggered that table with triggerClientEvent then warp the peds and use setPedAnalogControlState And to set the vehicle velocity, you would need to use onClientRender client-side.
  10. That's just as close as it gets, basically it's the same as the picture you posted.. If that is not the result you expected, I don't think we are on the same page. What is the purpose of the script you're making? Do you want to create a function that will take a picture (as you posted) of the player / vehicle no matter where they are on the map?
  11. That should be in the PHP when you create the "mta instance" and call some resource functions. In your PHP code search for "new mta" and see if it passes your MTA credentials.
  12. I see, but the "proper" way to start up multiple individual resources that are not dependent on other resources, is to add them in the mtaserver.conf, scroll down to the very bottom and add the following line(s) <resource src="your-resource-name" startup="1" protected="0" /> Attributes: src: the resource name. This is the only mandatory flag. startup: controls whether the resource will be started with the server or not. If "1", "true" or "yes", the resource will be started. If not specified, defaults to not starting the resource. protected: if "1", "true" or "yes", the resource will not be able to be stopped when started. Otherwise, even if not specified, it will default to the normal behaviour. default: if given a "1", "true" or "yes" value, this resource will be the one who populates the built-in HTTP server main page, which is seen when no resource is given in the web address. It is not possible to have more than one default resource.
  13. What do you exactly want? Do you want number of resources to start when x resource starts? Or you want them to start when the server starts?
  14. Might be useless, but have you look at this yet: include( "mta_sdk.php" ); $mtaServer = new mta("example.com", 33004, "myUsername", "myPassword" ); $mtaServer->getResource("someResource")->call("someFunction"); Source: https://wiki.multitheftauto.com/wiki/PHP_SDK
  15. triggerEvent =/= triggerClientEvent To trigger from Client -> Server: triggerServerEvent To trigger from Server -> Client: triggerClientEvent To trigger from Client -> Client: triggerEvent To trigger from Server -> Server: triggerEvent
  16. You'll need to debug this issue better. When you create the sound, do an outputChatBox(tostring(soundEffect)) to see the userdata value. When you want to remove it, do an outputChatBox again to compare the soundEffect userdata value and one after you do the stopSound(soundEffect). Btw, you are not using onClientRender to create sound right?
  17. Yes to both (add to ACL as Admin)
  18. outputChatBox(tostring(drillSoundEffect)) -- try this and see what it returns @stopDrillSound
  19. So you want to color everything green? If so, take a look at this
  20. It doesn't actually take a string, it takes a font element. Replace "roboto" with roboto
  21. local weaponTable = { -- populate this list by adding weapons: -- [weap_id] = { torso, ass, left_arm, right_arm, left_leg, right_leg, head } [24] = { 45, 35, 30, 30, 25, 25, 70 }, } addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if getElementType(attacker) == "player" and getPlayerWeapon(attacker) and weaponTable[ getPlayerWeapon(attacker) ] then setElementHealth(source, getElementHealth(source) - weaponTable[ getPlayerWeapon(attacker) ] [ bodyPart - 2] + loss) end end ) You're welcome, you can use the following code to create a fully dynamic system. You can set each body part for each weapon using the weaponTable, just follow the current layout of weapon ID 24.
  22. addEventHandler("onPlayerDamage", getRootElement(), function (attacker, weapon, bodypart, loss) if bodypart == 9 then if getPlayerWeapon(attacker) == 24 then setElementHealth(source, getElementHealth(source) -50) end end end ) Man, please at least look at your code again and double check it, I know you're trying to help but try to make sure you're not making at least syntax mistakes..
  23. HTML5 doesn't allow you to have spaces in the id attribute. Are you able to change the ID? If not, you can maybe use the https://www.w3schools.com/cssref/sel_nth-child.asp selector.
×
×
  • Create New...