-
Posts
563 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Stanley Sathler
-
You also can use the Qt. You can find on forum the plugin to convert the Qt graphics to MTA GUIs. I not found here, so you need search.
-
You already made the script to change the .dff and .txd files? Just asking...
-
Script so that a car does not start to burn as soon as it is
Stanley Sathler replied to BieHDC's topic in Scripting
If you wanna a script, can find in Community. -
Oh, thank you Seb. (: When you test, post your opinion here
-
No code, no help. Sorry, but you must post it here. And don't forget: use tags.
-
Script so that a car does not start to burn as soon as it is
Stanley Sathler replied to BieHDC's topic in Scripting
Nobody will make a script for you. If you wanna a script, must learn Lua: viewtopic.php?f=148&t=40809 -
Yes, use the Castillo example. The mainly information is: playSound() is not usable on server-side.
-
The playSound() function is usable only in client-side. Client-side function startMusic1 (state) local player = getLocalPlayer() if state == "left" then if source == GUIEditor_Button[13] then local song = playSound("music/everything.mp3", false) setSoundVolume(song, 1) triggerServerEvent("Music1", getLocalPlayer(), player) end end end addEventHandler("onClientGUIClick", getRootElement(), startMusic1) Server-side function Music1 (player) local name = getPlayerName(player) outputChatBox(name.." hat den Party-Knopf gedrückt!", getRootElement(), 0, 255, 255) end addEvent("Music1", true) addEventHandler("Music1", getRootElement(), Music1)
-
Yes FSX, is it. Try and come back to say to us. (:
-
Show us your meta.xml. Your must set the file (song) in this file. You did it? Something like this: <file src="everything.mp3" /> <script src="server.lua" type="server" /> <script src="client.lua" type="client" /> Oh, and please: show us your directory structure. If you have something like this: /MyGamemode/scripts/server.lua /MyGamemode/scripts/everything.mp3 /MyGamemode/meta.xml You must set, in code, the complete structure: playSound("scripts/everything.mp3", false) And remember: no double posts.
-
Well guys, some details: * I'm not good with design, so I tried do something. Is not so good, but maybe somebody like. * This theme was based on Subaru Theme and Lighter Black. Download: http://sathlerdesign.com/downloads/Lighter%20Blue.zip Well, I hope you like it guys. (: I'm accepting ideas and criticals.
-
Teteomar, I must agree with Kenix. I saw your other topics, and really, you looks not know Lua. You must learn it.
-
Look at your line 8: if (name == string.find(MOJRM-511))then I think it should be: if (name == string.find("MOJRM-511"))then --Added quotes
-
Oh, and remember: maybe is a good idea if you add another event handler, the "onPlayerChangeNick". So, if the player join with a nickname and change later to "MOJRM-511", he will be banned too.
-
It has many errors. First, as Kenix said, in the condition you don't use quotes, because 99999 is a number (integer), and not a string. And getPlayerMoney needs an argument (the player that you want get money). | Second, the function setPlayerName needs a string on second argument (Cheater, in your example, is a variable not declared). So, you must use with quotes (as mjr said: "Cheater"). HINT: Learn Lua. You don't know how to program, so you must learn "walk" before "run".
-
Why you don't post your code/problem here? If you do it, we will help you more easily.
-
[Hellp]I Can't Start Map's in my server
Stanley Sathler replied to Jokeℝ1472771893's topic in Scripting
Your imagem is very small, I can not see. Try upload an other image. -
First: you must learn how to use commas in a phrase. I'm not a english teacher, but if you don't use it, we will not understand you. If you wanna create a script to all players, can make a server-sided script. Or create a event in server-side (addEvent()) and call it in client-side (triggerServerEvent()).
-
You made this script? It does not exist: function createMarker createMarker == "1007.3994140625" posY="2302.7998046875" posZ="12.10000038147" type="cylinder" .../> end createMarker() is a function, you must use it like the rest. The correct is: function createMarker() --This function can not be called "createMarker". Use another name. createMarker(arg1, arg2, arg3 ...) end If you made that script, you'll understand what I'm saying. Otherwise, you must learn Lua first.
-
function OnPlayerIsDamaged(attacker, attackerweapon, bodypart, loss) -- In this function, "source" is the player damaged. PlayerWantedLevel = getPlayerWantedLevel(source) AttackerTeam = getPlayerTeam(attacker) if(PlayerWantedLevel == 0) then if(AttackerTeam == "Police") then setElementHealth(source, getElementHealth(source) + loss) --Health of player damaged setElementHealth(attacker, getElementHealth(attacker) - 20) --Health of cop (who shot) outputChatBox("Don't shot unwanted players or you will lose health!", attacker, 255, 0, 0) end end end addEventHandler("onPlayerDamage", getRootElement(), OnPlayerIsDamaged) Try it. I don't know if it will works, but you can try. In the line 9, I can't use cancelEvent() (because the event "onPlayerDamaged" don't accept), so I tried improvise. Oh, and remember friend: for this script works, the cop must be on the team "Police" (lua is case-sensitive, so is "Police" and not "police"). To create a team, use the function: createTeam()
-
go = createMarker(2093, 1434, 10, 'cylinder', 1.0, 0, 255, 255, 70) Team = createTeam('Police',0,255,255) function setTeam(player) if getElementData(player,"Police") then outputChatBox("You are already Police",player,255,0,0) elseif getElementData(player, "Robber") then outputChatBox("You can not be a Police. You are a Robber."), player, 255, 0, 0) else setElementData(player,"Police",true) setPlayerTeam(player, Team) setElementModel(player, 285) setPlayerMoney(player, 1000) giveWeapon ( player, 31, 50, true ) giveWeapon ( player, 24, 50, true ) giveWeapon ( player, 33, 50, true ) outputChatBox('You Are Now Police ! Stop The Robbers form Rob and Kill!',player,255,255,0) end end addEventHandler('onMarkerHit',go,setTeam) go1 = createMarker(2107, 1422, 10, 'cylinder', 1.0, 255, 0, 0, 70) Team1 = createTeam('Robbers',0,255,0) function setTeam1 (player) if getElementData(player,"Robber") then outputChatBox("You are already Robber",player,255,0,0) elseif getElementData(player, "Police") then outputChatBox("You can not be Robber. You are a Cop.", player, 255, 0, 0) else setElementData(player,"Robber",true) setPlayerTeam(player, Team1) setElementModel(player, 188) setPlayerMoney(player, 1000) giveWeapon ( player, 29, 50, true ) giveWeapon ( player, 25, 50, true ) giveWeapon ( player, 28, 50, true ) outputChatBox('You Are Now Robber Go To Rob And Kill !',player,255,255,0) end end addEventHandler('onMarkerHit',go1,setTeam1)
-
Well, then I don't know how you can do it. You also can go to Community (community.multitheftauto.com) and search by one example like this. So, open the code and get what you want.
-
MiX, I don't know how to do it. But if I needed this, I would try create a button (in the same position that image) and set the button alpha to 0. But I don't know if it works...
-
Post here the result from /debugscript 3
-
createObject() - Client-side or server-side?
Stanley Sathler replied to Stanley Sathler's topic in Scripting
But I can create a client-side object to all players. If I do it, I'll being idiot? (Obs: in this case, creating objects that will be visible to all players) Nice to know it. It was my preoccupation.
