Jump to content

tosfera

Members
  • Posts

    1,193
  • Joined

  • Last visited

Everything posted by tosfera

  1. That's correct, 000webhost is a freehost and took a lot of your rights away. The SQL servers there are only accepting connections from their own servers and localhost. You'll not be able to use their storage as your database. Try setting up wamp/xampp. It gets the job done.
  2. A positive value is always true, as well as a string. the only things that are used as false are: false and nil. If you would add a simple check; if ( x and y ) then You're already there.
  3. You guys are all forgetting a single thing.. if you detach a trailer, it'll get attached right away again due to the position of the trailer and the truck. @OP: try to use setElementPosition on the trailer when it gets detached to move it away from the truck to avoid it being attached again. Also, try to avoid isPedInVehicle since it fails quite often, a more reliable approach would be getPedOccupiedVehicle. also make sure that this script is on the server's side, not a client sided file.
  4. use cancelEvent in combination with OnClientExplosion
  5. Not always the case, most of the times the dbPoll is being looped because of the fact that you're not going to write 150 times; createVehicle( pollResult [ 1 ].model, ..., ..., ... ) Loops are used to create things more dynamic and less of a pain. If you're selecting all your vehicles, you're not going to spawn them line by line. You're going to loop over them and spawn them in the loop to avoid the pain in the arshe
  6. My bad, you're not able to attach an element to a projectile. You should save some data on the projectile and link that to an onClientRender and set the position of the object while taking it from the nade.
  7. To go a bit more into detail, a vector3 position is a three dimensional coordinate which indicates a location in the game. As far as the current games are being built, you got 3 of these vectors in a three dimensional game; x-axis - goes for north - south y-axis - goes for east - west z-axis - goes for the height In 2D games you got.. indeed, 2 vectors. These can be compared to the y-axis and z-axis in a 3D game.
  8. Well, it really depends on what you're doing. If you're going to use a query each time a player says something, none of the actual sql systems are going to stay up. Your only chance would be RavenDB but that's not that easy to setup, requires quite a lot of knowledge of java/c# mvc systems and no-sql databases. Take care of the amount of queries you're using and you'll be fine. Fire a query once for a login, register, and when the resource starts/stops. save the rest in tables.
  9. There are several ways, but the way which Bonus gave you is seriously a nice way to go for. something which I like to do is set the data on the player his head with setElementData. No matter where you need the nickname, you can always retrieve it by using getElementData instead of calling your resource for the actual nickname. An approach would be; addCommandHandler ( "dsnr", function ( thePlayer, _, newNick ) if ( newNick ) then setElementData ( thePlayer, "player:customNick", newNick ); outputChatBox ( "Mos: Your new nickname has been assigned, new messages will now use the nickname: ".. newNick, thePlayer, 70, 200, 0, true ); return; end outputChatBox ( "Mos: You need to type a new name, you !", source, 200, 70, 0, true ); end, true ); addEventHandler ( "onPlayerchat", getRootElement(), function ( message ) cancelEvent(); local customNick = getElementData ( source, "player:customNick" ); outputChatBox ( ( customNick and customNick or getPlayerName ( source ) ) .."#FFFFFF: ".. message, root, 255, 255, 255, true ); outputServerLog ( "CHAT: ".. ( customNick and customNick or getPlayerName ( source ) ) ..": ".. message ); end );
  10. That'll require quite some math since there are no default functions for that. You would need some math about the force which is being used to throw the object, you need to calculate the angle, the speed and by taking the total distance you would be able to update the position from the object. It's seriously a pain in the ass so if you question was if there was a default function for that; no, I'm sorry. You can however let the user throw a nade and not make it explode + attach an object to it.
  11. For a trigger, no. You can always take a random player with getRandomPlayer and not add a check to see if the source or given player equals to getLocalPlayer.
  12. You're using root to trigger the function towards the client. Try to use getRandomPlayer. Root never really worked for me either.. no idea what the hell the problem is with that.
  13. Quite a strong meaning over there, I would never use a third party system to send emails. You're handing over an e-mail and some data in there to restore passwords. I'm not sure if your users would like that. They've given you the information for usage in the script, not to hand over to third parties so they can get spammed as hell or even contacted for bullsh*t. @OP; ViRuZ gave you the right answer for a safe approach, create a php script on a webserver or even a local wamp server from yourself, write a small mail() script with some protection so not everyone can use it, and send the mail from there. Don't forget the configuration of the smtp server if you're using a local server.
  14. The setPedControlState might be cancelled due to your setPedAimTarget. Try to first set the target and then toggle the fire state. Also, you need to take the position of the 'attacker' and I'm not quite sure if you can handle this in the client side. I guess it would be better to do this on the server's side. Since you don't want a ped to hit 2 different players when 2 clients start shooting at them. Both of them will randomly die for others.
  15. tosfera

    Save

    You want to keep this data or it's like an autologin? That's seriously the most rhetorical question I've seen in days.. have a cookie. @OP; if you want to have a little more control over the accounts and backups and so forth, you could use a MySQL approach. If you want to keep it inside of MTA, you can always use setAccountData, getAccountData and the default login/register functions from MTA.
  16. I'm not sure about the source == getRootElement() but I can say that these two are the same; triggerClientEvent ( source, "eventName", source ); triggerClientEvent ( "eventName", source, source ); You might even be able to leave out the second source is the second line since that'll only push the playerElement in the parameters in your client.
  17. I smell leaked files, are you sure these are your own files? If not, we're not supporting people with their leaked files.
  18. You should edit the code itself a bit and change the Y position. By using guiGetScreenSize you can get the bot position ( y - the height of your GUI ). The top position is quite simple, just make the Y position 0. Do note that you should make the Y - heightOfGui a calculation and not a static value.
  19. As stated on the wiki: Returns a table with the result of the query if it was a SELECT query, or false if otherwise. In case of a SELECT query the result table may be empty (if there are no result rows)..
  20. I know your concern about the .map files, if you're creating a zillion objects in a .map file it'll download it and I guess that it'll download it for the client and creates them on the client side. Every player that joins, or when a map gets started, downloads these files and this only happens when the client needs access to these files. Server files are only being loaded and never downloaded nor even loaded by the client. If you're going to think about it, all I can say is; a .map file is downloaded by the client and the objects are created on the client's side. If you want to avoid that, so that clients don't get these files nor get the download bar or something like that, create your own map system. Retrieve the maps from either xml files on the server or a database, spawn them all on the resource start and be done with it.
  21. Get the garbage bin, 1337. It's tiny, no one will ever miss those things in the entire world ( make sure to remove it though ) and it kinda fits the size of markers.
  22. By looking at the amount of parameters in his call, he's disabling colorcodes. Therefore the clipping should just work, the only thing that can be wrong is his offsets for the box. Try this; (untested) function testing() dxDrawRectangle ( ( sX / 2 ) - ( sizeX / 2 ), sY - sizeY, sizeX, sizeY, tocolor ( 0, 0, 0, 200 ) ); dxDrawRectangle ( ( sX / 2 ) - ( sizeX / 2 ), sY - sizeY, sizeX, line, tocolor ( 0, 0, 0, 200 ) ); dxDrawText ( songName, ( sX / 2 ) - ( sizeX / 2 ), sY - sizeY, ( ( sX / 2 ) - ( sizeX / 2 ) ) + sizeX, ( sY - sizeY ) + line, tocolor ( 255, 255, 255, 255 ), 1, "defauld-bold", "center", "center", true ); end
  23. It's a mistake you keep on making #RooTs, you're trying to replace the default source variable with a function variable. Stop doing that since it'll only cause a lot of trouble. Also, KariiiM is totally right. You're looping for a table which will only take more memory that required. Try something like this; addEventHandler ( "onPlayerVehicleEnter", getRootElement(), function () local account = getPlayerAccount ( source ); if ( account ) then if ( isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( "VIP" ) ) ) then setElementData ( source, "VehiclePainel", true ); end end end );
  24. Someone else tried to replace markers too but failed to do so by using the functions from MTA. I suggested the person to replace a default object ( for example 1337 ) and place it on the same location of the markers. Just hide the actual marker and make the object non-collidable.
  25. I would rather save the top scoring player in a variable and when someone gets killed, compare the killer's score with the highest score to see if he jumped over the score. Take care of the onPlayerQuit and onPlayerJoin too.
×
×
  • Create New...