Jump to content

Command


TorNix~|nR

Recommended Posts

Guys, help, I do not know how to do it, it doesn't get the event.

help?

function blablabla (source, command)
local players = getPlayerTeam(source)
local team = getTeamName(players)
if team == "team" then
  setPedStat(source, 69, 999)
  setPedStat(source, 70, 999)
  setPedStat(source, 71, 999)
  setPedStat(source, 72, 999)
  setPedStat(source, 73, 999)
  setPedStat(source, 74, 999)
  setPedStat(source, 75, 999)
  setPedStat(source, 76, 999)
  setPedStat(source, 77, 999)
  setPedStat(source, 78, 999)
  setPedStat(source, 79, 999)
		outputChatBox("Done.", source)
  local boss = getElementData(source,'boss')
		if boss == true then
		outputChatBox("You can not use this now while boss is activated.", source)
		end
end
end
addCommandHandler("team", blablabla)

 

Link to comment
13 hours ago, TorNix~|nR said:

Guys, help, I do not know how to do it, it doesn't get the event.

help?


function blablabla (source, command)
local players = getPlayerTeam(source)
local team = getTeamName(players)
if team == "team" then
  setPedStat(source, 69, 999)
  setPedStat(source, 70, 999)
  setPedStat(source, 71, 999)
  setPedStat(source, 72, 999)
  setPedStat(source, 73, 999)
  setPedStat(source, 74, 999)
  setPedStat(source, 75, 999)
  setPedStat(source, 76, 999)
  setPedStat(source, 77, 999)
  setPedStat(source, 78, 999)
  setPedStat(source, 79, 999)
		outputChatBox("Done.", source)
  local boss = getElementData(source,'boss')
		if boss == true then
		outputChatBox("You can not use this now while boss is activated.", source)
		end
end
end
addCommandHandler("team", blablabla)

 

There is no debug problems, I just want when the boss event is activated, this command turn off, any help please?

Link to comment
  • Moderators

Try to test it with a different command, if you want to test if the command is blocked.

 


 

Quote

There is no debug problems

I never said that there are debug problems. I said that you have to add debuglines and test your code.

 

 

  • Confused 1
Link to comment
9 minutes ago, IIYAMA said:

Try to test it with a different command, if you want to test if the command is blocked.

 


 

I never said that there are debug problems. I said that you have to add debuglines and test your code.

 

 

The problem is the code doesn't detect the event, I already added a outputChatBox, and it doesn't appear. I do not know how to fix it

Link to comment
  • Moderators
4 minutes ago, TorNix~|nR said:

The problem is the code doesn't detect the event, I already added a outputChatBox, and it doesn't appear. I do not know how to fix it

bla bla bla bla I REALLY don't care!!!

DEBUG! DEBUG! DEBUG!!!

I do care!

 

iprint("script has been executed")
function blablabla (source, command)
	iprint("function blablabla has been executed")
	local players = getPlayerTeam(source)
	local team = getTeamName(players)
	iprint("player teamName", team)
	if team == "team" then
		iprint("team name is correct")
		setPedStat(source, 69, 999)
		setPedStat(source, 70, 999)
		setPedStat(source, 71, 999)
		setPedStat(source, 72, 999)
		setPedStat(source, 73, 999)
		setPedStat(source, 74, 999)
		setPedStat(source, 75, 999)
		setPedStat(source, 76, 999)
		setPedStat(source, 77, 999)
		setPedStat(source, 78, 999)
		setPedStat(source, 79, 999)
		outputChatBox("Done.", source)
		local boss = getElementData(source,'boss')
		iprint("boss value", boss)
		if boss == true then
			outputChatBox("You can not use this now while boss is activated.", source)
		end
	end
end
addCommandHandler("team", blablabla)

 

  • Sad 1
Link to comment
-- server 
Team = "ghosts"
function blablabla (p, command)
 boss = getElementData(p,'boss')-- check the player Have data  = true
if boss == true then
if getPlayerTeam( p )  then -- check if the player on team
if getTeamName( getPlayerTeam( p ) ) == Team then  -- check player on team ghosts
outputChatBox("Done.",p,255,0,0,true)
for loop = 69,79 do -- make loop 
 setPedStat(p,loop, 999) -- set player stat
end 
else 
outputChatBox("You Cant Use command",p,255,0,0,true) 
end
else
outputChatBox("You Cant Use command ",p,255,0,0,true) 
end
else
outputChatBox("You can not use this now while boss is activated.",p,255,0,0)
end
end
addCommandHandler("team", blablabla)

 

  • Sad 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...