Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. spawnsHospitals = {} spawnsHospitals[1] = {X=1177.4658203125,Y=-1323.8505859375,Z=14.072093963623,RZ=272.34698486328} spawnsHospitals[2] = {X=2033.337890625,Y=-1415.2353515625,Z=16.9921875,RZ=136.29571533203} spawnsHospitals[3] = {X=-2660.431640625,Y=633.8486328125,Z=14.453125,RZ=181.82925415039} spawnsHospitals[4] = {X=1578.947265625,Y=1768.3779296875,Z=10.8203125,RZ=93.712066650391} spawnsHospitals[5] = {X=1876.330078125,Y=2237.36328125,Z=11.125,RZ=5.7651672363281} spawnsHospitals[6] = {X=1244.9228515625,Y=332.85546875,Z=19.5546875,RZ=339.0514831543} spawnsHospitals[7] = {X=-321.7744140625,Y=1057.1728515625,Z=19.7421875,RZ=310.25588989258} spawnsHospitals[8] = {X=-1514.6015625,Y=2525.173828125,Z=55.780910491943,RZ=4.556640625} function playerKilled( ) setTimer( respawnToNearestHospital, 5000, 1, source ) end addEventHandler("onPlayerWasted", getRootElement(), playerKilled ) function respawnToNearestHospital( thePlayer ) local x, y, z = getElementPosition( thePlayer ) tableDist = {{index,dist}} for k,i in ipairs ( spawnsHospitals ) do local x2 = spawnsHospitals[k]["X"] local y2 = spawnsHospitals[k]["Y"] local dis = getDistanceBetweenPoints2D( x, y, x2, y2 ) tableDist[k] = {index=k,dist=dis} end local goodK = -1 for l,j in ipairs( tableDist ) do if ( l == 1 ) then goodK = 1 else local DIST1 = tableDist[goodK]["dist"] local DIST2 = tableDist[l]["dist"] if ( DIST2 < DIST1 ) then goodK = l end end end if ( goodK == -1 ) then return end spawnPlayer( thePlayer, spawnsHospitals[goodK]["X"], spawnsHospitals[goodK]["Y"], spawnsHospitals[goodK]["Z"], math.random (0,288), getElementModel(thePlayer), 0, 0, spawnTeam) setPedRotation( thePlayer, spawnsHospitals[goodK]["RZ"] ) if(tonumber(skin) == 199) then skin = math.random(0,200) end end You should check the function arguments .
  2. Post your script where you respawn the player.
  3. He meant's what happens if the team names aren't the one expecified on the script, I think you can change team names in Basemode.
  4. That's not going to happen, I'm not going to give you the script completed.
  5. You want to set the player team according to which button he press?
  6. Usando las funciones de "Engine": https://wiki.multitheftauto.com/wiki/Cli ... _functions
  7. Castillo

    Kill historic

    There's no such script for that, you must create it by your own. P.S: I suggest you to use SQL to save the data.
  8. Castillo

    Kill historic

    Oh, start a resource called "killmessages".
  9. Castillo

    Kill historic

    What? I don't understand, you mean like global server stats?
  10. Esta funcion tenia un bug, ya fue reportada y se supone que la arreglaron en una nightly, descargala y deberia funcionar bien.
  11. Nice one, keep up the good work mate!
  12. Castillo

    Question

    No veo en 'onClientMapStarting' en ningun lugar.
  13. @haseenaa: Are you blind? he's asking for MTA server hosting, not website hosting.
  14. Castillo

    Question

    onClientMapStarting -> playSound
  15. Castillo

    swat ropes

    Indeed, SAUR has the "abseil" script from the MTA community.
  16. function pingkick() local ping = getPlayerPing(source) if (tonumber(ping) > 400) then outputChatBox("Your ping is pretty high! Please fix it.", source) end end addEventHandler("onPlayerJoin", getRootElement(), pingkick) function checkPlayersPing() for index, player in ipairs(getElementsByType("player")) do local ping = getPlayerPing(player) if (tonumber(ping) > 400) then outputChatBox("Your ping is pretty high! Please fix it.", player) end end end setTimer(checkPlayersPing, 60000, 0)
  17. Castillo

    Functions.

    -- client side: local maxPing = 350 function checkPing() local ping = getPlayerPing(source) if (ping > tonumber(maxPing)) then outputChatBox("#FF0000Your ping is high, lower it please.", source,255,255,255,true) end end addEventHandler("onClientPlayerJoin", getRootElement(), checkPing) function triggerPingKicker() if (getPlayerPing(localPlayer) >= tonumber(maxPing)) then triggerServerEvent("ping.onKickHighPing",localPlayer,maxPing) end end setTimer(triggerPingKicker,5000,0) -- server side: function onHighPing(maxPing) kickPlayer ( thePlayer, "Your ping is over the limit. (over "..maxPing..")" ) outputChatBox("#FF0000"..getPlayerName(source).."#FF0000 has been kicked for high ping.",root,255,0,0,true) end addEvent( "ping.onKickHighPing", true ) addEventHandler( "ping.onKickHighPing", getRootElement(), onHighPing )
  18. myonlake, that resource only works for SQLITE, not the MTA account system (internal.db).
  19. https://wiki.multitheftauto.com/wiki/SetPedHeadless
  20. Then why did you reply? to increase your post count?
  21. Dude, do you think I'm one of these newbies who comes here to ask for help with all their problems? Nah, I come here ONLY when I have tried it all. And btw, copying a wiki example WON'T HELP ME. Now, please everyone who doesn't have idea of what is this about, DON'T REPLY.
  22. Again skin mod: https://community.multitheftauto.com/index.php?p= ... ls&id=3373
  23. Yo habia entendido que habias puesto eso de triggerEvent("onZombieCreated",zomb) y luego no te aparecian los zombies, me estas haciendo un lio.
×
×
  • Create New...