Jump to content

SDK

Members
  • Posts

    635
  • Joined

  • Last visited

Everything posted by SDK

  1. This is just a client ripoff, it has triggerServerEvent but no server script. Try this (you can edit it if you want) viewtopic.php?f=108&t=29033
  2. SDK

    Math Money

    It's not very clear, but I think the TS wants to give a player a random amount of money when he wins a DD/DM. He should explain himself better
  3. If it's still giving those errors then the player element must be wrong. You can also try to debug the values returned by the functions. outputDebugString ('player_ac = ' .. tostring(player_ac)) Is this onLogin function triggered by a custom event? Is so, please post the trigger part too please.
  4. what's the problem, more details please
  5. If you want it the easy way (server) use texts: https://wiki.multitheftauto.com/wiki/TextCreateTextItem Or use gui labels clientside. Ofc you first need to send the message to the server and then use one of these
  6. That's what he said, didn't he? When the zombies attack someone, the script uses setElementSyncer to set the player being attacked as syncer for the zombies attacking. setElementSyncer can not add more players syncing btw, it can only change the player syncing peds.
  7. SDK

    MTA Duplicating Keys

    1.1 isn't released yet, you should make a bug report for it then. Anyway, my guess is this will fix it for you http://code.google.com/p/mtasa-blue/sou ... ail?r=2351
  8. elseif table.have( noheadzombies, skinID ) then elseif not setPedHeadless( zombie, false ) then triggerClientEvent ("onnoheadzombies", getRootElement()) elseif table.have( speedzombies, skinID ) then elseif table.have( firezombies, skinID ) then elseif not setPedOnFire ( zombie, false ) then triggerClientEvent ("onfirezombies", getRootElement()) These parts don't make sense, fix your elseif's. Also, the only thing you should use clientside is setGamesSpeed (and I don't even know it would work the way you would want it), and setPedGravity instead of setGravity.
  9. I tried to play around with removing [ and ] with gsub and it seems that it expects a real pattern when using [ or ] ... Try this: addEvent('onMapStarting') addEventHandler('onMapStarting', g_rot, function(mapInfo, mapOptions, gameOptions) thisDriftMapName = string.gsub( "drift_records_on_map_" ..mapInfo.name, " ", "_" ) thisDriftMapName = string.gsub( thisDriftMapName, "[\]\[]", "_" ) executeSQLCreateTable ( thisDriftMapName, "player_nick TEXT, drift_record INTEGER, best_drift INTEGER, record_day TEXT" ) setTimer(selectDriftScoreFromDB, 1000, 1, "all") end )
  10. put the marker serverside and attacht the event to that marker
  11. Yeah, hadn't read his other topics yet
  12. Please use [ lua][ /lua] tags. You're function name is wrong, you really can detect that error yourself! About the script, your window doesn't need to be created if it already exists, check for the window variable before checking it's visible. (And the last guiSetVisible is wrong) function gui() if not window then --if the window doesn't exist, create it window = guiCreateWindow(471,278,366,401,"Xuju Vechile's",false) but1 = guiCreateButton(100,42,158,45,"BXM",false,window) addEventHandler("onClientGUIClick", but1, bmxBike, false) but2 = guiCreateButton(100,114,158,45,"Mountain Bike",false,window) but3 = guiCreateButton(101,192,158,45,"Bike",false,window) but4 = guiCreateButton(83,138,5,5,"",false,window) but5 = guiCreateButton(101,267,158,45,"Sanchez",false,window) but6 = guiCreateButton(26,362,82,30,"Close",false,window) elseif ( guiGetVisible (window) == true ) then -- check if the gui element is visible showCursor(false) guiSetVisible (window, false ) -- if it is, we hide it else guiSetVisible (window, true ) -- if not, we make it visible showCursor(true) end end
  13. Look in playback_client.lua and change these lines: setElementAlpha( result.ped, 100 ) setElementAlpha( result.vehicle, 100 )
  14. SDK

    [HELP]LUA

    I'm not sure why the timer doesn't work, but you can use this function instead (like you use setVehicleIdleRespawnDelay): https://wiki.multitheftauto.com/wiki/Set ... spawnDelay
  15. If you want the same functionality as SAMP use this then, it's for race and does actually exactly what you need ... If you want more drivers, you can use the code from it and record multiple drivers. Happy scripting!
  16. SDK

    [HELP]Lua

    Damn it, stop making so much topics ... viewtopic.php?p=335965#p335965
  17. Maybe it's time to learn Lua then. You should at least try to make something that works skipping the part you don't know how to script. So 1: Make a script that spawns a car with a command. 2: Make the script clientside and serverside (command clientside, trigger the server with a custom event to create the vehicle) 3: Make it so the command only works inside the marker. 4: NOW create the GUI when entering the marker. 5: Let the GUI trigger the same event.
  18. SDK

    Nametag Problem.

    Hm, you could try to export the updateNametagColor function in the meta.xml, and let it update the color itself. (but I don't know if it would set the color you want) Maybe you should put all the changes your script does into the paradise gamemode, it could prevent a lot of work for you.
  19. Are you sure you copied it right? Because Solidsnake14's code has messages and I don't see any messages on your video ..
  20. He probably doesn't know what he's doing. Don't start typing random events, use the WIKI! MTA has no event for team joins, so you'll have to dig in your code where teams are set and customize it there. Or if you're lucky onPlayerTeamJoin is triggered by one of your scripts, but then we'll need more details.
  21. That sentence was about the previous code, where one sound variable was created and used
  22. Serverside was wrong --server function stopSirene( player, cmd ) local commandant = getPedOccupiedVehicle(player) triggerClientEvent ( "stopSirene", getRootElement(), commandant ) end addCommandHandler ( "sireneoff", stopSirene)
  23. SDK

    Help:)

    https://wiki.multitheftauto.com/wiki/OnPickupHit Check the team on that event, if it's the wrong one use cancelEvent()
  24. If there's nothing on the slothbot wiki about driving, then it probably doesn't have it. There is no public resource afaik for peds driving vehicles, so you'll have to write it all from scratch. The closest thing you could get may be this (but it has no AI): https://community.multitheftauto.com/index.php?p= ... ils&id=665
  25. Why do you create a vehicle onResourceStart? Use getPedOccupiedVehicle and create a vehicle yourself using the admin panel or freeroam resource. There's still a problem with that code anyway. I guess you'll be using it on multiple vehicles but the sound variable is shared for them all. That will cause trouble when players will use the sirens at the same time. Oh well, try this: --client local sounds = {} function startSirene ( vehicle ) local x,y,z = getElementPosition( vehicle ) local sirene = playSound3D( "sons\\sirene1.wav", x, y, z, true) attachElements ( sirene, vehicle) sounds [ vehicle ] = sirene end addEvent( "startSirene", true ) addEventHandler("startSirene", getRootElement(), startSirene) function stopSirene( vehicle ) local sirene = sounds [ vehicle ] stopSound ( sirene ) end addEvent( "stopSirene", true ) addEventHandler("stopSirene", getRootElement(), stopSirene) --server function startSirene( player, cmd ) local commandant = getPedOccupiedVehicle(player) triggerClientEvent ( "startSirene", getRootElement(), commandant ) end addCommandHandler ( "sireneon", startSirene) function stopSirene( player, cmd ) local commandant = getPedOccupiedVehicle(player) triggerClientEvent ( "stopSirene", getRootElement() ) end addCommandHandler ( "sireneoff", stopSirene)
×
×
  • Create New...