Jump to content

50p

Retired Staff
  • Posts

    2,973
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by 50p

  1. NEVER ever triggerClientEvent inside onResourceStart. This is because client has to download client-side files/script before he can use it, but because you try to trigger event before it's actually added then you will get this error. You should trigger server event inside onClientResourceStart event to tell server that client has downloaded all the files and the resource is running client-side too. This way, you can trigger client event after the download is done.
  2. Wiki is your bible and should always be opened in a tab in your browser (all new web browsers have tabs).. Look there whenever you need documentary. It's the place where everyone starts and it's the place that you should visit when you struggle, forum is your last place you should ask for help. I can't remember if I've ever asked for help here.. I've used wiki when I got into trouble.
  3. Your onClientMarkerHit will be triggered when "someone" enters the marker due to root element being attached to that event. Check if local player is the element that hit the marker and you will be fine.
  4. https://wiki.multitheftauto.com/wiki/Cli ... _functions https://wiki.multitheftauto.com/wiki/Cli ... tic_images There are many examples there...
  5. 50p

    text display

    Of course it doesn't. I asked you a few questions and you haven't replied to them.. I suppose "i don't know" answers the last question. Also, you send the text but you do not set it to text item. Try to find mytext in your test function.
  6. 50p

    text display

    You misunderstood what varez said. He said use either "this" OR "this" but you did both and you failed again. In your triggerServerEvent you pass getLocalPlayer as the first parameter to your test function... but it expects string which is not even used at all. At line 2, what is mytext? Is this your whole script? Your command will try to send command name in triggerServerEvent since first parameter in command handlers (client-side) are command names not what player typed after space when typing command in. If you want the whole text after command to be displayed you need to make a trick: function text( _, ... ) local textToBeDisplayed = table.concat( arg, " " ); triggerServerEvent( "ownText", getLocalPlayer(), textToBeDisplayed ); end addCommandHandler( "text", text ); Why don't you make the command server-side? Easier and quicker.
  7. 50p

    SCRIPTING FOR SERVER

    No, because it's him and this is his another topic, no idea what for though.
  8. Show some more code where the triggerClientEvent is located. What event triggers a function that triggers the client event?
  9. I must have missed one word but anyway he got the answer. That's exactly the same for car paintjobs and scope.
  10. I think you don't understand what I wrote. It doesn't matter what .txd file name is.. When you replace model's texture, you have to load .txd file first, but it doesn't matter what file name is but what texture names are inside. You can't replace radar textures because you need model ID of the object you are replacing texture... radar textures don't have IDs. This will replace texture of your sniper rifle: local txd = engineLoadTXD( "sniper.txd" ); engineImportTXD( txd, 358 );
  11. Yes but remember this even needs to be triggered by some script, if race resource doesn't trigger it don't expect this to work. If you said you get an error in this function, the event gets triggered and if the first parameter is the player who wins then it should work.
  12. He can change it within map manager resource or make a new resource with /new command which will execute /votemap command... It's been said above before me.
  13. Line 3, function has no parameters so winner is nil. Add winner to function parameters.
  14. 50p

    createobject

    Functions triggered by commands don't pass any source. Those functions need parameters. Add player argument to the function. AFAIR, commands can't have spaces but additional arguments are passed to the handler function. function showDisco( player, _, arg ) if ( arg == "disco" ) then ... After that, change all source to player. I hope you understood what I wrote and you'll be able to fix it yourself.
  15. Hahaha, I read his application and it looks like he has a hidden talent. Anyway, Rebellionman, it's very hard to find someone who would like to script for you without any reward.
  16. executeCommandHandler executes a command. It makes player "type in" the command without him actually typing it.
  17. 50p

    Player gridlist

    Or you can try my GUI lib which makes it easier to script gridlists. https://wiki.multitheftauto.com/wiki/GUI_Classes
  18. You can replace weapon textures. All you need to know is model ID. You can find these ID in \data\default.ide file. Model ID of your sniper rifle is 358. NOTE: Model ID is NOT the same as Weapon ID.
  19. See the 2nd example on the onPlayerConnect wiki page: https://wiki.multitheftauto.com/wiki/OnPlayerConnect
  20. dxDrawText expects you to put string in the first parameter but you put a number. Convert the number to string: dxDrawText( tostring( ammoinclip ), ...... ) dxDrawText( tostring( totalammo ), ...... )
  21. You have huge difficulty with English. PM me and I'll try to help you in Polish.
  22. Do you see this message when you start your resource or starting TXD workshop or opening .txd in workshop?
×
×
  • Create New...