Jump to content

Daron90

Members
  • Posts

    3
  • Joined

  • Last visited

Daron90's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. Hello all. I downloaded a resource some days ago and it works very well, but i want to add a function. I'm a pawno scripter and i'm starting with Lua.. maybe its just a noob change but i don't know how to make it for now.. if you can help me, i'll really tank you. Here is the Lua code: --[[ Save Load System ]]-- --[[ By |Mr|-Talal07-| ]]-- --[[ Don't Remove This ]]-- LoadKey = "1" -- to load your position. SaveKey = "2" -- yo save your position. function getPlayerSaves(player) local x,y,z = getElementData(player,"x"),getElementData(player,"y"),getElementData(player,"z") local rx,ry,rz = getElementData(player,"rx"),getElementData(player,"ry"),getElementData(player,"rz") local vx,vy,vz = getElementData(player,"vx"),getElementData(player,"vy"),getElementData(player,"vz") local id,hp = getElementData(player,"id"),getElementData(player,"hp") return x,y,z,rx,ry,rz,vx,vy,vz,id,hp end function SavePosition(player,x,y,z,rx,ry,rz,vx,vy,vz,id,hp) setElementData(player,"x",x) setElementData(player,"y",y) setElementData(player,"z",z) setElementData(player,"rx",rx) setElementData(player,"ry",ry) setElementData(player,"rz",rz) setElementData(player,"vx",vx) setElementData(player,"vy",vy) setElementData(player,"vz",vz) setElementData(player,"id",id) setElementData(player,"hp",hp) setElementData(player,"SL",true) end function LoadPosition(player) local x,y,z,rx,ry,rz,vx,vy,vz,id,hp = getPlayerSaves(player) setElementModel(getPedOccupiedVehicle(player),tonumber(id)) setElementHealth(getPedOccupiedVehicle(player),hp) setElementPosition(getPedOccupiedVehicle(player),x,y,z) setElementRotation(getPedOccupiedVehicle(player),rx,ry,rz) addVehicleUpgrade(getPedOccupiedVehicle(player),1010) setTimer(setElementFrozen,1000,1,getPedOccupiedVehicle(player),false) setTimer(setElementVelocity,1000,1,getPedOccupiedVehicle(player),vx,vy,vz) end function LoadPlayer(player) if not isPedInVehicle(player) then return end if getElementData(player,"SL") == true then setElementFrozen(getPedOccupiedVehicle(player),true) LoadPosition(player) outputChatBox("*[LOAD] Position loaded !!",player,0,255,0) else outputChatBox("*[POSITION] You didn't saved any position yet. Use 2 key to save position.",player,255,0,0) end end function SavePlayer(player) if not isPedInVehicle(player) then return end local x,y,z = getElementPosition(getPedOccupiedVehicle(player)) local rx,ry,rz = getElementRotation(getPedOccupiedVehicle(player)) local vx,vy,vz = getElementVelocity(getPedOccupiedVehicle(player)) local id,hp = getElementModel(getPedOccupiedVehicle(player)),getElementHealth(getPedOccupiedVehicle(player)) SavePosition(player,x,y,z,rx,ry,rz,vx,vy,vz,id,hp) outputChatBox("*[sAVE] Position saved !!",player,0,255,0) end addEventHandler("onPlayerWasted",root, function () setElementData(source,"SL",false) outputChatBox("*[POSITION] The current position saved were removed.",source,255,0,0) end ) addEventHandler("onGamemodeMapStart",root, function () for i,player in ipairs(getElementsByType("player")) do setElementData(player,"SL",false) outputChatBox("*[POSITION] The current position saved were removed.",player,255,0,0) end end ) addEventHandler("onPlayerSpawn",root, function () setElementData(source,"SL",false) outputChatBox("*[POSITION] The current position saved were removed.",source,255,0,0) end ) addEventHandler("onPlayerJoin",root, function () setElementData(source,"SL",false) bindKey(source,LoadKey,"down",LoadPlayer) bindKey(source,SaveKey,"down",SavePlayer) end ) addEventHandler("onResourceStart",resourceRoot, function () for i,player in ipairs(getElementsByType("player")) do setElementData(player,"SL",false) bindKey(player,LoadKey,"down",LoadPlayer) bindKey(player,SaveKey,"down",SavePlayer) end end ) The change is add a limit to use the LOAD key. Maybe it's posible with a counter or something like ... For example.. you only can use 1 key (Load position) 5 times, and when the player is respawned set it as 0 again. Also a thing.. maybe can be added is.. save the nos. If you had NOS before saving.. load it, else.. no. This is just a plus But the most important is that about the limit. Hope you can help me. Regards
  2. amazing ..... at least would be amazing an basic version for free
  3. Hello.. i know this topic is old but i want to use it in my server... and it doesnt work by unknow reason :L i did everything writen on install.txt The window loads but it doesnt show the maps Do you know the problem? Regards
×
×
  • Create New...