Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- SERVER SIDE
- ]]
- -- Function to revive a player in the game
- function Revivir_a_Jugador(source, command, objetive)
- -- Retrieve the rank information of the player who issued the command
- local rank = exports["MR2_Cuentas"]:getValue(source, 'InfoCuenta')
- -- Check if the player's rank is high enough to use the command (rank 4 or higher)
- if not (rank["Rango"] >= 4) then
- return
- end
- -- If no target player is specified, inform the command issuer about the correct syntax
- if not (objetive) then
- return outputChatBox("#9AA498[#A03535Syntaxis#9AA498] #FFFFFF/"..command.." [Usuario]", source, 0, 0, 0, true)
- end
- -- Find the target player by their name
- local objetivo = getPlayerFromName(objetive)
- -- If the target player is not found (not connected), notify the command issuer
- if not (objetivo) then
- return outputChatBox("#56c450El jugador #24C5BE"..objetive.." #56c450no esta conectado.", source, 0,0,0, true)
- end
- -- Retrieve the death state of the target player
- local Estado = exports["MR2_Cuentas"]:getValue(objetivo, 'Estado')
- -- If the target player is not dead, notify the command issuer
- if not (Estado.Muerto == true) then
- return outputChatBox("#56c450El jugador #24C5BE"..objetive.." #56c450no esta muerto.", source, 0,0,0, true)
- end
- -- Set the target player's death state to false (revive them)
- Estado.Muerto = false
- exports["MR2_Cuentas"]:setValue(objetivo, 'Estado', Estado)
- -- Use a custom function to handle the revival process
- exports["MR3_Muertes"]:resucitar(objetivo)
- -- Notify the revived player and the command issuer about the revival
- local staff = getAccountName(getPlayerAccount(source))
- outputChatBox("#FF7800"..staff.." #56c450te ha revivido.", objetivo, 0,0,0, true)
- outputChatBox("#56c450Reviviste a #24C5BE"..objetive.."", source, 0,0,0, true)
- end
- -- Register the function with the command "revivir" and "revive"
- addCommandHandler("revivir", Revivir_a_Jugador)
- addCommandHandler("revive", Revivir_a_Jugador)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement