Gabriel Vasconcelos Posted June 14, 2019 Share Posted June 14, 2019 elseif ( source == pages['home'].base_medic ) then executeCommandHandler("medic", ThePlayer) function medicGO(source) for i, player in ipairs(getElementsByType("player")) do local uj = getElementData ( player, "Job" )== "Medic" or false if type(uj) == "boolean" then if uj == true then outputMessage("#ffffff[ Clientes #ffffff] - #FFFFFFO Jogador #ffffff"..getPlayerName(source).." #ffffffChamou Por um Samu",player, 255, 255, 255, true ) outputMessage("#ffffff[ Clientes #ffffff] - #FFFFFFDigite /Localizar "..getPlayerName(source).." #ffffffPara Marcar O Jogador No Mapa",player, 255, 255, 255, true ) end end end end addCommandHandler("medic",medicGO) -------------------------------------------------------------------- function Comandomedic ( ThePlayer ) outputMessage("#ffffff[ Aviso #ffffff] - #FFFFFFOs SAMU's Foram Avisados, Aguente firme", ThePlayer, 255, 255, 255, true ) end addCommandHandler("medic", Comandomedic ) this would be on a cell phone, when the player clicks on the icon he calls a doctor. but I can not make it work :c Help me. Link to comment
Scripting Moderators ds1-e Posted June 14, 2019 Scripting Moderators Share Posted June 14, 2019 (edited) 1 hour ago, Gabriel Vasconcelos said: elseif ( source == pages['home'].base_medic ) then executeCommandHandler("medic", ThePlayer) function medicGO(source) for i, player in ipairs(getElementsByType("player")) do local uj = getElementData ( player, "Job" )== "Medic" or false if type(uj) == "boolean" then if uj == true then outputMessage("#ffffff[ Clientes #ffffff] - #FFFFFFO Jogador #ffffff"..getPlayerName(source).." #ffffffChamou Por um Samu",player, 255, 255, 255, true ) outputMessage("#ffffff[ Clientes #ffffff] - #FFFFFFDigite /Localizar "..getPlayerName(source).." #ffffffPara Marcar O Jogador No Mapa",player, 255, 255, 255, true ) end end end end addCommandHandler("medic",medicGO) -------------------------------------------------------------------- function Comandomedic ( ThePlayer ) outputMessage("#ffffff[ Aviso #ffffff] - #FFFFFFOs SAMU's Foram Avisados, Aguente firme", ThePlayer, 255, 255, 255, true ) end addCommandHandler("medic", Comandomedic ) this would be on a cell phone, when the player clicks on the icon he calls a doctor. but I can not make it work :c Help me. Try. function medicGO(source) local players = getElementsByType("player") for i = 1, #players do local player = players[i] local player_job = getElementData(player, "Job") or false if player_job and player_job == "Medic" then outputMessage("#ffffff[ Clientes #ffffff] - #FFFFFFO Jogador #ffffff"..getPlayerName(source).." #ffffffChamou Por um Samu", player, 255, 255, 255, true) outputMessage("#ffffff[ Clientes #ffffff] - #FFFFFFDigite /Localizar "..getPlayerName(source).." #ffffffPara Marcar O Jogador No Mapa", player, 255, 255, 255, true) end end end addCommandHandler("medic", medicGO) EDIT: Why do u attach two functions to one command? You could do it in one. Edited June 14, 2019 by majqq Link to comment
Gabriel Vasconcelos Posted June 15, 2019 Author Share Posted June 15, 2019 5 hours ago, majqq said: Try. function medicGO(source) local players = getElementsByType("player") for i = 1, #players do local player = players[i] local player_job = getElementData(player, "Job") or false if player_job and player_job == "Medic" then outputMessage("#ffffff[ Clientes #ffffff] - #FFFFFFO Jogador #ffffff"..getPlayerName(source).." #ffffffChamou Por um Samu", player, 255, 255, 255, true) outputMessage("#ffffff[ Clientes #ffffff] - #FFFFFFDigite /Localizar "..getPlayerName(source).." #ffffffPara Marcar O Jogador No Mapa", player, 255, 255, 255, true) end end end addCommandHandler("medic", medicGO) EDIT: Why do u attach two functions to one command? You could do it in one. Yes there are two functions in a single command one for the player that enters the command and another for the doctor to receive Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now