TorNix~|nR Posted November 18, 2017 Posted November 18, 2017 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)
Moderators IIYAMA Posted November 19, 2017 Moderators Posted November 19, 2017 There is no 'event' in this code. Please add more debuglines, because I am very sure this is a human error. 1
TorNix~|nR Posted November 19, 2017 Author Posted November 19, 2017 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?
Moderators IIYAMA Posted November 19, 2017 Moderators Posted November 19, 2017 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. 1
TorNix~|nR Posted November 19, 2017 Author Posted November 19, 2017 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
quindo Posted November 19, 2017 Posted November 19, 2017 You are checking if boss is true after you already changed player stats, you need to do that before, and return from function if it's true.
Moderators IIYAMA Posted November 19, 2017 Moderators Posted November 19, 2017 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) 1
Ahmed Ly Posted November 19, 2017 Posted November 19, 2017 -- 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) 1
TorNix~|nR Posted November 19, 2017 Author Posted November 19, 2017 @Ahmed Ly, thank you but, it's always unable to use even when the boss is not activated. You can not use this now while boss is activated.
Ahmed Ly Posted November 19, 2017 Posted November 19, 2017 1 hour ago, TorNix~|nR said: @Ahmed Ly, thank you but, it's always unable to use even when the boss is not activated. You can not use this now while boss is activated. I tested it it's working for me post your full code 1
Moderators IIYAMA Posted November 19, 2017 Moderators Posted November 19, 2017 I get the feeling that you are not taking me seriously. (I am out of here,) 1 1
TorNix~|nR Posted November 19, 2017 Author Posted November 19, 2017 (edited) @IIYAMA, you are free, whenever you want, but please don't come back take care ! Edited November 19, 2017 by TorNix~|nR
Ahmed Ly Posted November 19, 2017 Posted November 19, 2017 10 minutes ago, TorNix~|nR said: You mean the boss script? NO
msyyn Posted November 20, 2017 Posted November 20, 2017 17 hours ago, TorNix~|nR said: @IIYAMA, you are free, whenever you want, but please don't come back take care ! Read what IIYAMA said he has solution to figure out where your code went wrong Your fault if you don't read
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