Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. What I'd on SAUR at my house system was: Create two 2 colshapes + pickups and set as element data the colshapes to each. Like this: setElementData ( entranceCol, "destination", exitCol ) setElementData ( exitCol, "destination", entranceCol ) This way you can just get the position/interior/dimension of that colshape and set it.
  2. https://community.multitheftauto.com/ind ... ils&id=977 That one could help, if it doesn't work, you can make your own one with the following functions: setAccountData -- To save. getAccountData -- To load.
  3. Found the problem, you have missing 'root' at addEventHandler of 'onPlayerWasted'. addEventHandler ( "onPlayerWasted", root, deathCheck )
  4. Try this: function respawn ( thePlayer ) if ( isPedDead ( thePlayer ) ) then local x, y, z = getElementPosition ( thePlayer ) spawnPlayer ( thePlayer, x, y, z ) setElementModel ( thePlayer, mySkin ) end end addCommandHandler ( "respawn", respawn ) function deathCheck ( ) local x, y, z = getElementPosition ( source ) spawnPlayer ( source, x, y, z ) end addEventHandler ( "onPlayerWasted", root, deathCheck ) function killcommand ( thePlayer ) killPed ( thePlayer, thePlayer) outputChatBox ( "Type /respawn to respawn immediately.", thePlayer, 255, 0, 0, true ) end addCommandHandler ( "kill", killcommand )
  5. That should work. Where's "mySkin" defined?
  6. De la manera que tu tabla funciona, tendrias que guardar el index. function cargaRadios() for id, RadiosName in ipairs(MisRadios.name) do rowR = guiGridListAddRow ( ListaRadios ) guiGridListSetItemText ( ListaRadios, rowR, columnRadios, RadiosName, false, false ) guiGridListSetItemColor ( ListaRadios, rowR, columnRadios, 0, 255, 0 ) guiGridListSetItemData ( ListaRadios, rowR, columnRadios, id ) end end Luego obtenes la URL del index seleccionado, asi: url = MisRadios.url [ index ]
  7. 'source' shouldn't be defined at the function name, there: function deathCheck(source)
  8. You can't rotate a GUI image.
  9. Is wrong. button1 = guiCreateButton( 0.01, 0.01, 0.2, 0.1, "Colt $".. price_colt, true, tab1 ) button2 = guiCreateButton( 0.01, 0.12, 0.2, 0.1, "Silencer $".. price_silencer, true, tab1 ) button3 = guiCreateButton( 0.01, 0.23, 0.2, 0.1, "Deagle $".. price_deagle, true, tab1 ) button4 = guiCreateButton( 0.01, 0.34, 0.2, 0.1, "Sawn off $".. price_sawn, true, tab1 ) button5 = guiCreateButton( 0.01, 0.45, 0.2, 0.1, "Shotgun $".. price_shotgun, true, tab1 ) button6 = guiCreateButton( 0.01, 0.56, 0.2, 0.1, "Spaz 12 $".. price_spaz12, true, tab1 )
  10. Eso es porque 'player' esta mal, tiene que ser 'source' y no debe estar en el nombre de la funcion.
  11. I made your script to work different, this way it'll work. -- client side: function levelup ( ) if isElement ( expLabel ) then destroyElement ( expLabel ) end local Exp = getElementData ( localPlayer, "ExP" ) or 0 local Level = getElementData ( localPlayer, "Level" ) or 0 expLabel = guiCreateLabel ( 0.777, 0.22, 0.1708, 0.0963, "ExP gained: ??\nTotal ExP: ".. tostring ( Exp ) .."\nLevel: ".. tostring ( Level ), true ) guiLabelSetColor ( expLabel, 0, 255, 0 ) guiLabelSetVerticalAlign ( expLabel, "top" ) guiLabelSetHorizontalAlign ( expLabel, "left", false ) guiSetFont ( expLabel, "clear-normal" ) setTimer ( levelup, 2000, 1 ) end setTimer ( levelup, 2000, 1 ) -- server side: exports.scoreboard:scoreboardAddColumn ( "ExP" ) exports.scoreboard:scoreboardAddColumn ( "Level" ) local levels = { 30, 55, 75, 85, 95, 120, 150, 230, 350, 500 } addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( killer ) addPlayerZombieKills ( killer ) end ) function addPlayerZombieKills ( killer ) local account = getPlayerAccount ( killer ) if isGuestAccount ( account ) then return end local H = tonumber ( getElementData ( killer, "ExP" ) ) or 0 local L = tonumber ( getElementData ( killer, "Level" ) ) or 0 setElementData ( killer, "ExP", tonumber ( H ) + 5 ) local H = ( H + 5 ) local L = ( L + 1 ) if ( L <= #levels ) and ( levels [ L ] ) and ( tonumber ( H ) >= tonumber ( levels [ L ] ) ) then setElementData ( killer, "Level", L ) triggerClientEvent ( killer, "playSound", killer ) end end function onLogin ( _, account ) setElementData ( source, "Level", getAccountData ( account, "lvl" ) or "Level 0 !" ) setElementData ( source, "ExP", getAccountData ( account, "exp" ) or "0" ) end addEventHandler ( "onPlayerLogin", root, onLogin ) function saveData ( thePlayer, theAccount ) if ( theAccount and not isGuestAccount ( theAccount ) ) then setAccountData ( theAccount, "lvl", getElementData ( thePlayer, "Level" ) ) setAccountData ( theAccount, "exp", getElementData ( thePlayer, "ExP" ) ) end end addEventHandler ( "onPlayerQuit", root, function ( ) saveData ( source, getPlayerAccount ( source ) ) end ) addEventHandler ( "onPlayerLogout", root, function ( prev ) saveData ( source, prev ) end )
  12. Just place the map on your server and start it.
  13. The only way to find them is search on every script.
  14. The way your script works is not good, because if the exact experience is not on the levels table, it won't level up.
  15. As I said above, use the map editor to place vehicles on your server.
  16. Even though I already sent PM. Happy Birthday
  17. By scripting it, as far as I know, vG scripts has it.
  18. What do you mean by insert vehicles? you want to map vehicles? if so, use the map editor.
  19. Colshapes has no alpha, because they are not visible, only radar areas has color. safeZoneRadar = createRadarArea ( 95.974617004395, 1751.3895263672, 255, 255, 240, 0, 0, 200 ) -- 200 = alpha.
  20. Start the resource called: "reload".
×
×
  • Create New...