-
Posts
282 -
Joined
-
Last visited
Everything posted by Gordon_G
-
I've already gave you.
-
I recommand you to use : I've worked on Notepadd++ several months but, now, I script on Sublime Text, I prefer this, you should try
-
As I said, use clients functions, no other way simplier.
-
Hum... guiCreateLabel() Or a dxText
-
If you want to do as NeXuS said, you will have to create a new admin panel or, modify the inclued panel. As you're saying, you can : - change the color of admin messages or notifications (to make a difference) - or create a new chatbox for admin logs
-
You didn't understand me, I was saying that for the optional arguments inside the cancelEvent() function
-
function sDog(source) local x, y, z = getElementPosition(source) local theTeam = getPlayerTeam(source) theDog = exports.slothbot:spawnBot(x, y+1, z, 0, 50,0,0,theTeam,0,"following", source) setElementData(source, "hisDog", theDog) end function createTeams(source) if not getPlayerTeam(source) then local myTeam = getPlayerName(source) createTeam(myTeam) setPlayerTeam(source, getTeamFromName(myTeam)) print("Team set" .. getTeamName(getPlayerTeam(source)) ) sDog(source) end end addCommandHandler( "my", createTeams) Try this on your server with the command /my It worked for me (when the bot spawn he doesn't move but, when I move, he moves). (it's just a test to identify the issue)
-
In your first function, you don't define the value source. So, in your second code, put sDog(source) and set function sDog(source) in your first. instead of sDog() and function sDog()
-
I see, I see. Slothbot works by team ; if you don't want to modify the slothbot's source code, put the player and the dog in the same team when the dog is created. createTeam() -- create a team where the player and the dog will be setPlayerTeam()-- set the player inside a team element spawnBot ( float x, float y, float z, int rotation = 0, [ int skinID = 0, int interior = 0, int dimension = 0, HERE PUT THE TEAM WHERE THE PLAYER AND DOG WILL BE, ... ] ) -- You can get the player team with to set it for the dog getPlayerTeam()
-
The cancelEvent() function does not requiere arguments, excepted : [ bool cancel = true, string reason = "" ] and, to be honest, I've never used them
-
You don't have to go client-side. Just put cancelEvent() Inside the function handled by the event onBotFindEnemy
-
Hey, instead of just copy and past the code, try to learn the SQL : I learnt with this (you'll speedly understand) : https://www.w3schools.com/sql/sql_syntax.asp good luck
-
Damn is he a kid to react like this ? You did not ask any help so, we undestand it is finish, that's all.
-
https://wiki.multitheftauto.com/wiki/Slothman/Slothbot#onBotFindEnemy Just make a check for the source who is the Enemy, if you don't want him to be attacked use : cancelEvent()
-
function rifleReloadCheck(_,weapon) if weapon ~= 33 then toggleControl ( "fire", true ) else toggleControl ( "fire", false ) end -- check if the player have a rifle in hands during the reloading, if it's not, enable the control state, else, disable end function rifleReloadTime(weapon,ammo) if weapon == 33 then -- Check player's weapon toggleControl ( "fire", false ) -- disable the shoot addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(),rifleReloadCheck) -- add a check to avoid the player can't shot with other weapon during reloading setTimer(function(source) -- Timer to disable the check, and toggle back the fire control toggleControl ( "fire", true ) removeEventHandler( "onClientPlayerWeaponFire", getLocalPlayer(), rifleReloadCheck) end,1000,1,source) end end addEventHandler("onClientPlayerWeaponFire", getlocalPlayer(), rifleReloadTime) I did'nt try but, I think it's correct @Fist
-
Oh, i'm so stupid. Do it client-sided, it will be easier I think because no need to killTimer... "onClientPlayerWeaponFire" "onClientPlayerWeaponSwitch"
-
Hum... The only way I see is to create a new HUD
-
Or disable the "fire" when he try to shut during the dalay You'll need these functions : event : "onPlayerWeaponFire" -- when a player shoots setTimer() -- to set a delay (1000 for 1 seconde) setControlState() -- to disable the fire when he shoots setElementData() getElementData() event : "onPedWeaponSwitch" -- Like this, the player can shoot with others weapons during the delay -- Don't forget to set back off the control state when he re-switch to the rifle Good luck
-
And you could use too the sloth bot ressource, it's easy to use : https://wiki.multitheftauto.com/wiki/Slothman/Slothbot You can choose the bot mod as you can read in this wiki. But, as far I remember, the bot will'nt go in the you vehicle, so, use setPedControlState() (as TheMOG said) But, you'll need to check when a player go inside a vehicle (an event, so) : OnPlayerVehicleEnter Good luck !
-
Check how many vehicle the player has in the base HELP URGENT
Gordon_G replied to Gabriel1375's topic in Scripting
He'll never understand if you make everything for him just explain next time NeXus... -
Damn guy, you made 2 topics and you always say that. If you want help, you need to give a script or a try of script, we'll help you to make it work. If it's really your friend's server, tell him to ask help here himself or to give you the script.
-
Oh, I did not noticed it, sorry. Thanks for you help !
-
local example = "an example string . an other ." sentences_ = {} sentence = "" for i in string.gmatch(example, "%S+") do -- This string.gmatch cut the string at every word sentence = sentence.." "..i if i == "." then -- Cut the string at the point and insert it into a table table.insert(sentences_,sentence) sentence = "" end end for k,v in ipairs(sentences_) do print(v) end I did it myself with the help of : http://lua-users.org/wiki/SplitJoin But it's not really optimized, any other way ? Edit : Sorry for the double post, I can't edit anymore the firt.
-
Hello guys, I want to do a new outputChatBox for every points in my string : Exemple : text = "I like potatoes. I like salad too." -- output in game : I like potatoes. -- output in game : I like salad too. Is it possible ? Thanks !
-
One more information : In french we call this operation : Division euclidienne In english it's probably : Euclidean division