Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 24/07/19 in all areas

  1. سلام عليكم ورحمة الله آخخبااركم ان شاء الله طيبين ------------------------------------- في هذا الموضوع عندي مود الميني مسج يعني تقدر ترسل رساله لشخص محدد بمبلغ من المال ض2 لمعرفة كل شي عن المود في هذا الرابط / الفيديو وبالتـــوفييقء ~~  |~ الإهداءات ~| @!#DesTroyeR_,) @Kareem Amer @MrKAREEM @Mr.Falcon @DABL @KillerX @NX_CI @[AcM] - Major . @MR_Mahmoud @Ahmed Ly @MR.Mosa @N3xT @Abu-Solo @SuperX @#BrosS @iMr.WiFi..! @Mr.CnTroL @Abdul KariM @Hakan @!#NssoR_) @Simple. @Abdo Nour @MR-HERO و جميع أعضاء المنتدى
    4 points
  2. Da pra fazer com isso: function isResourceRunning (resourceName) local res = getResourceFromName (resourceName) if (res) then if (getResourceState (res) == "running") then return true else return false end end end Adicione essa função acima no seu script. Depois quando quiser verificar se o resource Freeroam está ligado ou não, basta verificar com: if (isResourceRunning ("freeroam")) then -- Se o resource freeroam está ativo, então: -- Faz alguma coisa end Sua função vai ficar assim: function assignNewTeam (source, commandName) if (isResourceRunning ("freeroam")) then local theTeam -- Cria a variável do time mas não atribui valor nenhum a ela de propósito. if (getTeamFromName ("R7")) then -- Se já existe um time com o nome "R7", então: theTeam = getTeamFromName ("R7") -- A variável recebe o time que já existe. else -- Se não existe nenhum time com esse nome criado, então: theTeam = createTeam ("R7", 0, 255, 0) -- Cria o time e coloca ele nessa variável. end setPlayerTeam (source, theTeam) -- Coloca o player que digitou o comando nesse time. end end addCommandHandler ("navio", assignNewTeam)
    1 point
  3. A sua função do /navio e do /navio2 ficam tentando criar o time cada vez que alguém usa o comando. Na segunda vez ele dará erro, pois o time já existe. function assignNewTeam (source, commandName) local theTeam -- Cria a variável do time mas não atribui valor nenhum a ela de propósito. if (getTeamFromName ("R7")) then -- Se já existe um time com o nome "R7", então: theTeam = getTeamFromName ("R7") -- A variável recebe o time que já existe. else -- Se não existe nenhum time com esse nome criado, então: theTeam = createTeam ("R7", 0, 255, 0) -- Cria o time e coloca ele nessa variável. end setPlayerTeam (source, theTeam) -- Coloca o player que digitou o comando nesse time. end addCommandHandler ("navio", assignNewTeam)
    1 point
  4. Eu disse parâmetro de função e não parâmetro de evento. function unassignTeam () local theTeam = getPlayerTeam (source) if theTeam then setPlayerTeam (source, nil) end end addEventHandler ("onPlayerWasted", root, unassignTeam)
    1 point
  5. OnPlayerWasted não usa aqueles parâmetros de função. No seu caso, daria pra deixar sem parâmetro nenhum.
    1 point
×
×
  • Create New...