Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. I already gave you a way... example: setElementData(playerElement,"team","Admin") setElementData(playerElement,"team","Member")
  2. Castillo

    Race Stats

    Don't post if you don't know of what are you talking about, he's using SQLite no Mysql, SQLite doesn't require that module.
  3. You want to his their passwords also? o,o that would be really bad.
  4. function getPlayer(thePlayer) local players = {} for id, player in ipairs(getElementsByType("player")) do local playerName = getPlayerName(player) local playerName = playerName:gsub("#%x%x%x%x%x%x", "") table.insert(players, playerName) end if string.find(players, thePlayer) then return playerName else return false end end Why do you need a table for this? also, why do you need to make a new function if there is getPlayerFromName already...? function getPlayer(thePlayer) for id, player in ipairs(getElementsByType("player")) do local playerName = getPlayerName(player) local playerName2 = playerName:gsub("#%x%x%x%x%x%x", "") if string.find(tostring(playerName2), tostring(thePlayer)) then return playerName else return false end end Try it (not tested)
  5. Do you have the right object ID also, do you have the required TXD files into meta.xml?
  6. I don't understand, do you mean like groups? such as: Moderator, Admin, Trial moderator? if so, you could use setAccountData or setElementData to set their "groups".
  7. Take a look at this page: https://wiki.multitheftauto.com/wiki/Main_Page You will find anything you need to know.
  8. that's because you forgot to add getRootElement to RespawnPlayer function RespawnPlayer() setTimer(SpawnPlayerAgain, 3000, 1, source) end addEventHandler("onPlayerWasted", getRootElement(), RespawnPlayer) function SpawnPlayerAgain(player) local x = 2228.9583 local y = -1722.1108 local z = 13.5625 succes = spawnPlayer(player, x, y, z) if(succes) then outputChatBox("Yay! Alpha Fixed The Respawn hes soo happy can u plz thank him??", player, 0, 255, 0, true) fadeCamera(player,true) else outputChatBox("OMG Alpha failed to fix the spawn thingy tell him plz", player, 0, 0, 255, true) end end
  9. function RespawnPlayer() setTimer(SpawnPlayerAgain, 3000, 1, source) end addEventHandler("onPlayerWasted", RespawnPlayer) function SpawnPlayerAgain(player) local x = 2228.9583 local y = -1722.1108 local z = 13.5625 succes = spawnPlayer(player, x, y, z) if(succes) then outputChatBox("Yay! Alpha Fixed The Respawn hes soo happy can u plz thank him??", player, 0, 255, 0, true) fadeCamera(player,true) else outputChatBox("OMG Alpha failed to fix the spawn thingy tell him plz", player, 0, 0, 255, true) end end
  10. function RespawnPlayer() setTimer(SpawnPlayerAgain, 3000, 1, source) end addEventHandler("onPlayerWasted", RespawnPlayer) function SpawnPlayerAgain(player) local x = 2228.9583 local y = -1722.1108 local z = 13.5625 succes = spawnPlayer(player, x, y, z) if(succes) then outputChatBox("Yay! Alpha Fixed The Respawn hes soo happy can u plz thank him??", player, 0, 255, 0, true) else outputChatBox("OMG Alpha failed to fix the spawn thingy tell him plz", player, 0, 0, 255, true) end end You forgot to pass the "source" element with setTimer, source element is the player who died.
  11. Use colshapes, https://wiki.multitheftauto.com/wiki/OnColShapeHit https://wiki.multitheftauto.com/wiki/CreateColRectangle
  12. Oh and btw, about respawning (i forgot o,o) addEventHandler("onPlayerWasted",getRootElement(), function () local x = 2228.9583 local y = -1722.1108 local z = 13.5625 setTimer(spawnPlayer,2000,1,source,x,y,z) outputChatBox("You will respawn in 2 seconds!",source,255,0,0) end) It should work.
  13. MTA has no ID's, you have to make your own script (look at community.multitheftauto.com, there was one). about move objects from maps, you can give the object an ID if i'm right. Example: map file: <map> <object id="a51MainGateKeypadCode" model="971" posX="96.736" posY="1918.352" posZ="20.694" rotX="0" rotY="0" rotZ="270.40" newPosX="96.751" newPosY="1914.474" newPosZ="20.694" /> </map> then in your script you can do: gate = getElementByID("a51MainGateKeypadCode") if gate then local x = tonumber(getElementData(gate,"newPosX")) local y = tonumber(getElementData(gate,"newPosY")) local z = tonumber(getElementData(gate,"newPosZ")) moveObject(gate,1500,x,y,z) x = tonumber(getElementData(gate,"posX")) y = tonumber(getElementData(gate,"posY")) z = tonumber(getElementData(gate,"posZ")) setTimer(moveObject,5000,1,gate,1500,x,y,z) end
  14. function getPlayerWeapons(player) local weaponsTable = {} for slot=0, 12 do local ammo = getPedTotalAmmo(player, slot) if (getPedWeapon(player, slot) ~= 0) then local weapon = getPedWeapon(player, slot) local ammo = getPedTotalAmmo(player, slot) table.insert(weaponsTable, {weapon, ammo}) end end return weaponsTable end Should work.
  15. I won't him to name every scripter here, just is unfair to say just two are helping
  16. "this forum would be useless without you 2" I don't think that's correct, many others are helping in the forum, not just them.
  17. onClientPlayerJoin is not triggered for the client.
  18. You are doing it wrong, please read again about event handlers, onPlayerJoin uses "source" as joined player event, same with onPlayerSpawn. you are using "theplayer" which is wrong.
  19. I joined yesterday to help you to test it, and it worked so, case close.
  20. Another car mod https://community.multitheftauto.com/index.php?p= ... ls&id=1922
  21. You aren't starting the map via /start ?
  22. So, you start the map and "laserpointer" is not being started?
  23. Do you have that resource on Map editor server?
  24. What i have to explain? i have told you how to add multiple colours in your nickname
×
×
  • Create New...