Jump to content

Citizen

Moderators
  • Posts

    1,803
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Citizen

  1. Sorry, MatiasRuff, but i can't make that learn with your teacher Solidsnake
  2. @Solidsnake ho ok and he is paying you ? No problem so I don't make this scoreboard
  3. Hi Solidsnake, I don't understood what you mean but if you see the MTA Paradise, in the resources folder, there a lot of resources for this GM ( 3dtext, admin, anims, bank etc... ) so you have to start all resources ( except if there are a resources which start all requierd resources IDK ) I read quickly some files and I haven't found anything about the start of other resources so you have to start them manually. ( sry for my bad english )
  4. Hi Try, Try ( ) this: function delAllPeds(thePlayer, comandName) local peds = 0 for k,i in ipairs ( getElementsByType( "ped" ) )do destroyElement( i ) peds = peds+1 end outputChatBox( peds.." were destroyed !", thePlayer ) end addCommandHandler( "delpeds", delAllPeds, false, false ) It should work
  5. It's just because there are a space in the name of your resource replace it by a _ or delete the space I already have this problem and I passed all my saturday on this problem Tell me if it's work
  6. So create a setTimer like that: local marker = createMarker( x, y, z, ... ) setElementID( marker, "marker1" ) setTimer( updateThePosition, 50, 0 ) function updateThePosition() local veh = ... local marker = getElementByID( "marker1" ) if veh then local x, y, z= getElementPosition( veh ) if marker then setElementPosition( marker, x, y, z ) end end end Try that
  7. Hi tigerman, When you attach a marker on a vehicle, the marker take the position of the vehicle also if you use offsets. So create a marker ( don't hide during the test ) which is bigger than the vehicle and attach it to the vehicle. Try to enter in the marker and if he doesn't work, try to go on the vehicle. Tell me if you are detected and where.
  8. Hi GEN-Gavin, I see the events in server side, and I found onElementDestroy BUT ! this event is only triggered when an object was detroyed by destroyElement( the Element ) so he doesn't work. Then I go to the Client Events and I found this: OnClientExplosion So you can use it but he's triggered only when an object explode ( like barrels ) Try this and tell me if it works
  9. MTA Paradise is not in 1 resource but more than 15 resources ( or IDK ) if you want to start it, you have to start all resources and to setup a mySQL server ( you can use Easyphp or wamp ) But nobody want to help other "scripters" ( hum hum ) with a Gamemode downloaded on Internet so learn lua before to try start a RP server like MTA paradise. ( I make a server RP in French but I use notepadd++ and not a GM downloaded )
  10. Maybe try this: --{x, y, width, height, red, green, blue, alpha, name, id} local zones = { {1684, -2008, 200, 200, 0, 255, 0, 0, "LSspawn", 1}, {0, 0, 200, 200, 0, 255, 0, 0, "test", 2} } function buildSafeZones() for theKey, theZone in ipairs(zones) do local x = zones[theKey][1] local y = zones[theKey][2] local width = zones[theKey][3] local height = zones[theKey][4] local red = zones[theKey][5] local green = zones[theKey][6] local blue = zones[theKey][7] local alpha = zones[theKey][8] local name = zones[theKey][9] local id = zones[theKey][10] colShape[id] = createColRectangle ( x, y, width, height ) radarArea[id] = createRadarArea (x, y, width, height, red, green, blue, alpha) setElementData(colShape[id],"type","safezone") setElementData(radarArea[id],"type","safezone") end end function cancelVehicleDamage() cancelEvent() end function greenzoneEnter ( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then if getElementData(source,"type") == "safezone" then --hidden to prevent piracy end end end addEventHandler ( "onColShapeHit", getRootElement(), greenzoneEnter ) function greenzoneExit ( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then if getElementData(source,"type") == "safezone" then --hidden to prevent piracy end end end addEventHandler ( "onColShapeLeave", getRootElement(), greenzoneExit ) To read in a table named zones, you have to respect the syntax: zones[line][column] It should be work now
  11. Hi MatiasRuff, If I'm not wrong, you want a scoreboard with 2 columns, one with the name of players and another with his points. And when a player have 1000 points, he wins the round ? That's right ?
  12. This script work but he said -4000 ( I know, is not stupid but ... ) And no answer from Azu so we can say that he founds the solution to make that
  13. No problem volk-rus ! See you soon
  14. Stop crying seanny ^^, You can learn to script easier but you need some help for starting. Make a new folder in your resources folder ( seany for exemple ) Then with notepad++ create a new empty page. Paste this in your new page: function onGamemodInit() -- The instructions when the server started createVehicle( 522, 10, 10, 5 ) -- create a NRG-500 at the coordinates 10, 10, 5 end addEventHandler("onResourceStart", getRootElement(), onGamemodInit ) function OnPlayerJoin ( ) local thePlayer = source -- The source is the player who's joining the game local playername = getPlayerName( thePlayer ) -- we get his Name outputChatBox( "INFO: "..playername.." has joined the game", getRootElement(), 0, 180, 0 ) -- getRootElement() it's the same as "every players" outputChatBox( "Welcome"..playername.." !", thePlayer, 0, 180, 0 ) spawnPlayer( thePlayer, 0, 0, 3, 270)-- We spawn the player in the middle of the GTA's map fadeCamera( thePlayer, true ) setCameraTarget( thePlayer ) -- We set the camera like in single player end addEventHandler("onPlayerJoin", getRootElement(), OnPlayerJoin ) --Execute OnPlayerJoin () when a player joining the game Then save it in your seanny folder like this: seanny.lua After, you have to create a meta.xml: <?xml version="1.0" encoding="utf-8"?> <meta> <info author="Seanny" type="gamemode" name="" description="" /> <script src="seanny.lua" type="server" /> </meta> And save it. Now lunch MTA Server.exe wait a moment and you will see that your new resource is loaded. To lunch it, you have to stop freeroam if he is lunched as default: in the MTA Server, tape: stop freeroam Then he is stopped, lunch your resource like this: start seanny Then you can enter in your server by clicking on "Quick Connect" and enter in Host: 127.0.0.1 Port: 22003 And click on Connect. You have just made your own server on MTA Now you can add other things. When I started, I copy-paste the exemple of some functions and I modified it Server-Functions I have learn the lua only like that. Enjoy !
  15. Hi Azu, If you use notepad++, you would have of to see the extra " ( I can see it in the syntax highlighting of MTA's forum :lol ) You can change the language in notepad++: Language => L => Lua But sometimes I have an error when I start notepad++( Failed to load langs.xml ) and there are no syntax highlighting. To fix it: Go to the installation folder for Notepad++ and delete langs.xml. Then, in that same folder, find langs.model.xml, make a copy of it, and rename the copy to langs.xml.
  16. I'm not sure but I think that the Client side can't detect any other players in the Colshape ( I have to verify it ) And most of all, with the Server-Side, we can send the players who are in the colshape to all clients. Like that every players can see the gridlist with the name of players who are inside the Colshape Do you understand what I mean ? (sorry if I'm not speak very well 'cause I'm French ) And it's work so why not ?
  17. Hi Michcio, You have to make 2 parts: - One in Server-Side ( to detect players in colCircle and send the players to the Client-Side ) - One in Client-Side ( to create the Gridlist, to receive the players and show it in the gridlist I have tested it and he works very well: Server-Side: function createTheColCircle( thePlayer, commandName ) if ( colshape ) then -- If another colshape was created before with the command /createCol destroyElement( colshape ) killTimer( timerShape ) end local x,y,z = getElementPosition( thePlayer ) colshape = createColCircle ( x, y, 20.0 ) -- Create the ColCircle timerShape = setTimer( refreshPlayersInColShape, 2000, 0 ) -- Execute the refresh every 2 sec outputChatBox("col created" ) end addCommandHandler( "createCol", createTheColCircle, false, false ) function refreshPlayersInColShape() local nearbyPlayers = getElementsWithinColShape( colshape, "player" ) -- Found all Players in the ColShape for k, i in ipairs ( getElementsByType( "player" ) )do triggerClientEvent(i, "updatePlayerList", getRootElement(), nearbyPlayers ) -- send nearbyPlayers for all clients end end Client-Side: playerList = guiCreateGridList ( 0.70, 0.10, 0.30, 0.60, true ) columnplayerList = guiGridListAddColumn( playerList, "Player", 0.85 ) guiSetVisible(playerList,false) function click ( button ) if button == "left" and source == playerList then local playerName = guiGridListGetItemText ( playerList, guiGridListGetSelectedItem ( playerList ), 1 ) outputChatBox ( playerName ) end end function togglePlayerList() local show = guiGetVisible(playerList) guiSetVisible(playerList, not show) showCursor( not show ) end addCommandHandler("pokaz",togglePlayerList) addEvent("updatePlayerList", true) function updatePlayerList( nearbyPlayers ) guiGridListClear(playerList) -- Destroy all rows from the gridlist for k,i in ipairs( nearbyPlayers )do if (getPlayerName(i) ~= getPlayerName( getLocalPlayer() ) )then -- Don't show his name row = guiGridListAddRow(playerList) guiGridListSetItemText(playerList, row, columnplayerList, ""..getPlayerName(i), false, false) addEventHandler( "onClientGUIClick", playerList, click, false) end end end addEventHandler("updatePlayerList", getLocalPlayer(), updatePlayerList) If you don't understand a thing with this script, ask me
  18. If you want to keep yours elementData, try this: function addTabStaticsInfect ( attacker, weapon, bodypart, loss ) if attacker then if attacker ~= source then if ( weapon == 4 ) then -- killer killed victim with a knife local playerKills = getElementData(attacker, "kills" ) or 0 local playerDeaths = getElementData(source, "deaths" ) or 0 playerKills = playerKills+1 playerDeaths = playerDeaths+1 setElementData( attacker, "kills", playerKills ) setElementData( source, "deaths", playerDeaths ) outputChatBox( "Killer's kills:"..playerKills.." | player's deaths: "..playerDeaths ) end end end end addEventHandler ( "onPlayerDamage", getRootElement (), addTabStaticsInfect ) It should work I think. EDIT: I tested it and there was an error. Now this script works very well, you juste have to copy-paste
  19. Salut Texas, Nan nous n'utilisons pas MTA Paradise mais Notepadd++ ^^ ( en clair 100% fait main ). Et comme nous avions un serveur sur sa:mp, nous savons exactement ce qu'attendent les joueurs. De plus, nous aurons à l'ouverture environ 25 players assurés donc le serveur va être actif dès le départ ( c'est beaucoup plus dur lorsqu'il n'y a que 5 joueurs au lancement d'un server ) Vous avez commencé il y a combien de temps ? Utilisez vous un GM ( je penses à GTA Paradise surtout ) Nan mais tu seras invité à la Beta si tu veux Si tu as le moindre problème dans tes scripts n'hésite pas. Je t'aiderais au maximum à finir un système à la seule condition que tu es essayé de ton coté Je suis très doué dans l'automatisme et les Intelligences Artificiel Sinon j'ai fait cette petite vidéo il y a 1an ( je ne savais pas encore très bien scripter à ce moment la donc, je te laisse imaginé notre ( Famas et moi-même ) niveau sans prétention aucune . Je l'ai fait en 3 heures de codages: Vidéo: http://www.dailymotion.com/video/xcegb0_freight-trailer-train-wagon-train_videogames Le problème est que ça marche très bien lorsqu'on est pas beaucoup mais je suis persuadé qu'à partir de 10 joueurs ça doit surement buguer Voila Cordialement, Citizen PS: A ouai et j'ai oublié de dire le nom de notre serveur ^^ : [FR::RP] Evolution 187
  20. Bonsoir, je me présente: Je me surnomme Citizen. Je fais aussi un serveur RP Fr sur MTA et je l'ai commencé avec Famas ( mon frère ) en Novembre 2009 devant une feuille blanche avec aucune connaissance en lua. Pas la peine de te dire que maintenant nous sommes arrivés à un stade où la seule limite est notre imagination et que le server est donc bientôt fini ( Sorti prévue mois de Juillet 2011). Tu peux me demander de l'aide ici ou sur GTA Online: http://www.gtaonline.fr/forums/index.php/board,64.0.html Sasuke 78200 s'est allié à notre cause ^^ Tu peux voir des exemples de scripts que Sasuke et moi avons partagés. Tu peux les retrouver ici: http://www.gtaonline.fr/forums/index.php/topic,10450.0.html Pour plus d'info sur le serveur n'hésitez pas à me demander Cordialement, Citizen
×
×
  • Create New...