Author Topic: need some help  (Read 1988 times)

0 Members and 1 Guest are viewing this topic.

Offline [FL:RP] Jimakis98

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
need some help
« on: June 04, 2015, 01:40:19 AM »
So i made a new command for ulx but i want it to show me that a player is alive if he is and end the fuction there but if a player is alive then it respawns him. So what i want is when a players is dead i want it to respawn the player and if not to show a message that the player is alive

Code: [Select]
function ulx.respawn (calling_ply, target_ply )
if not target_ply:Alive() then

ulx.fancyLogAdmin( target_ply, "is not dead")

else

target_ply:Spawn()
ulx.fancyLogAdmin( calling_ply, true, "#A forced respawned #T", target_ply )

end
end

Offline Tomzen

  • Full Member
  • ***
  • Posts: 115
  • Karma: -1
  • A new lua adventurer
    • Thirdage Gaming
Re: need some help
« Reply #1 on: June 04, 2015, 01:59:01 AM »
So i made a new command for ulx but i want it to show me that a player is alive if he is and end the fuction there but if a player is alive then it respawns him. So what i want is when a players is dead i want it to respawn the player and if not to show a message that the player is alive

Code: [Select]
function ulx.respawn (calling_ply, target_ply )
if not target_ply:Alive() then

ulx.fancyLogAdmin( target_ply, "is not dead")

else

target_ply:Spawn()
ulx.fancyLogAdmin( calling_ply, true, "#A forced respawned #T", target_ply )

end
end

Wait so you want it to end the function if he is alive, and respawn him if he is not? or respawn him if he is alive and end if he is dead?
Finished:
Impersonate
<==> FakePromote/Demote <==> RandomMap <==> ForceMic <==> Search <==> PlayMenu <==
WIP:
ServerMode <==

Offline [FL:RP] Jimakis98

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: need some help
« Reply #2 on: June 04, 2015, 02:03:05 AM »
Let me make this clear.

If player is dead > respawn him , show message that you respawned him

If player alive > show message player is alive

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given