Jump to content

nic062

Members
  • Posts

    105
  • Joined

  • Last visited

Everything posted by nic062

  1. J'estime qu'il doit y avoir un minimum de remerciements envers pour les personnes qui t'aident. De plus il est grand temps d'apprendre à utiliser la fonction "Rechercher" soit "Search" en anglais, J'ai déjà répondu à cette question et en plus dans la catégorie "French / Français" du forum de MTA ! Voici la liste de tes topics : https://forum.multitheftauto.com/viewtopic.php?f=128&t=65636 https://forum.multitheftauto.com/viewtopic.php?f=128&t=63682 https://forum.multitheftauto.com/viewtopic.php?f=128&t=63526 https://forum.multitheftauto.com/viewtopic.php?f=128&t=63340 https://forum.multitheftauto.com/viewtopic.php?f=128&t=63355 https://forum.multitheftauto.com/viewtopic.php?f=128&t=63297 Aucun remerciements de ta part sur ces sujets. Et si tu ne trouve pas l'input pour faire une recherche regarde ce que j'ai pour toi : https://forum.multitheftauto.com/search.php N'est-ce pas magique ?
  2. Au plus grand plaisir L'equipe de Fox-Roleplay.
  3. Salut salut, En effet j'ai fais une belle M**** plus haut ^^. L'une des solutions serait d'utiliser le client side mais Maxur (developpeur principal de notre serveur) à trouvé une solution bien optimisé que voici : local lockedVehicle = { 432, -- Rhino 425 -- Hunter } local lockedWeapon = { 35, -- Rocket Launcher 36, -- Heat-Seeking RPG 38 -- Minigun } function checkLockedVehicle(player) if not hasObjectPermissionTo(player, "function.kickPlayer") then for k, veh in ipairs(lockedVehicle) do if getElementModel(source) == veh then cancelEvent() outputChatBox("Vous n'avez pas le droit d'utiliser ce véhicule.", player, 255, 0, 0) break end end end end addEventHandler("onVehicleStartEnter", getRootElement(), checkLockedVehicle) function checkLockedWeapon() if not hasObjectPermissionTo(source, "function.kickPlayer") then for k, weapon in ipairs(lockedWeapon) do if getPedWeapon(source) == weapon then takeWeapon(source, weapon) outputChatBox("Vous n'avez pas le droit d'utiliser cette arme.", source, 255, 0, 0) break end end end end addEventHandler("onPlayerTarget", getRootElement(), checkLockedWeapon) Note : Concernant le minigun, il sera automatiquement supprimé si le joueur cible un joueur ou un vehicule. Comme tu peux le remarqué il a également ajouté un tableau en debut de script te permetant d'ajouter supprimer les armes interdites/véhicules. Personnelement je pense que utilser l'event onPlayerTarget est la meilleur des solutions en attendant la sortie de la 1.4 pour garder la totalité coté du script coté serveur Bonne soirée.
  4. Avec la version 1.4 on utilisera l'event onWeaponFire mais l'heure est à la 1.3.4 alors on va contourner le probleme, on pourrait utiliser onPlayerDamage mais sans utiliser les damages une des solutions serai d'utiliser un timer qui fera appel à la fonction de verification. J'ai mis comme event onPlayerJoin donc à partir du moment ou le joueur va arriver sur le serveur toutes les 50ms il y aura une verification si le joueur a le minigun script coté server : function antiMiniGun() setTimer(removeW, 50, 0, source) end addEventHandler ( "onPlayerJoin", getRootElement(), antiMiniGun) function removeW(source) if not ( hasObjectPermissionTo (source, "function.kickPlayer")) and takeWeapon(source, 38) then outputChatBox ("Vous n'avez pas le droit d'utiliser cette arme.", source, 255, 0, 0, true) end end
  5. nic062

    Warp

    warpPedIntoVehicle
  6. Au plaisir de d'avoir pu aider
  7. Tu n'etais pas loin de la bonne solution function AntiRhino (vehicle, seat, jacker) if ( getElementModel (vehicle) == 432 ) then if not ( hasObjectPermissionTo (source, "function.kickPlayer")) then removePedFromVehicle (source) local x,y,z = getElementPosition(source) setElementPosition(source,x, y, z+3) outputChatBox ("Vous n'avez pas le droit d'utiliser ce véhicule.", source, 255, 0, 0, true) else ouputChatBox("A le droit") end end end addEventHandler ("onPlayerVehicleEnter", getRootElement(), AntiRhino) function AntiMiniGun (previous, current) if ( current == 38 ) then if not ( hasObjectPermissionTo (source, "function.kickPlayer")) then takeWeapon ( source, 38 ) outputChatBox ("Vous n'avez pas le droit d'utiliser cette arme.", source, 255, 0, 0, true) else ouputChatBox("A le droit") end end end addEventHandler ("onPlayerWeaponSwitch", getRootElement(), AntiMiniGun) Par contre je n'ai pas testé avec ton anti-MiniGun mais cela devrait marché sans soucis suite à ma modif. Bonne journée
  8. setModelHandling Je ne te met ni exemple, ni script pour la simple et bonne raison que j'estime qu'il doit y avoir un minimum de remerciements envers pour les personnes qui t'aident. Voici la liste de tes topics : https://forum.multitheftauto.com/viewtopic.php?f=128&t=63682 https://forum.multitheftauto.com/viewtopic.php?f=128&t=63526 https://forum.multitheftauto.com/viewtopic.php?f=128&t=63340 https://forum.multitheftauto.com/viewtopic.php?f=128&t=63355 https://forum.multitheftauto.com/viewtopic.php?f=128&t=63297 Aucun remerciements de ta part sur ces sujets. Quand on veut un serveur la moindre des choses c'est d'apprendre le language approprié.
  9. EN : Look at line 31, change this line with : if (string.find(message, word)) then FR : Ligne 31 : tu récuperes un tableau corrige en remplacent ta ligne 31 par celle ci : if (string.find(message, word)) then @+
  10. local names = {"James","John","Johnny","Cesar"} local subnames = {"Rodriguez","Johnshon","Thomson","Black"} function nick() local players = getElementsByType("player") local nbrNames = table.getn(names) local nbrSubnames = table.getn(subnames) for i, player in pairs(players) do setPlayerNametagText(player, ""..names[math.random(nbrNames)].."_"..subnames[math.random(nbrSubnames)].."") end end addCommandHandler("rpnick",nick) Tested, if you want allow the command only for admin : local names = {"James","John","Johnny","Cesar"} local subnames = {"Rodriguez","Johnshon","Thomson","Black"} function nick(thePlayer) local accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user."..accountname, aclGetGroup("Admin")) then local players = getElementsByType("player") local nbrNames = table.getn(names) local nbrSubnames = table.getn(subnames) for i, player in pairs(players) do setPlayerNametagText(player, ""..names[math.random(nbrNames)].."_"..subnames[math.random(nbrSubnames)].."") end end end addCommandHandler("rpnick",nick) Enjoy
  11. https://forum.multitheftauto.com/viewtopic.php?f=148&t=53694 Enjoy
  12. test this : https://community.multitheftauto.com/index.php?p= ... ls&id=1995 Don't forget this :
  13. But if there's many players on the server this dont work, I recommend this : local veh = {} function car(player, command, arg1) local x, y, z = getElementPosition(player) if veh[player] then destroyElement(veh[player]) end veh[player] = createVehicle(432, x, y, z) if arg1 == "in" then warpPedIntoVehicle(player, veh[player]) end end addCommandHandler("createtank", car) And if you type "/createtank in" you are warped into the tank.
  14. @WASSIm the space after the \n is not important but thank's for help @GamerDeMTA Yes client side for custom weapon, thank's too. I think is a real bug, I will report this bug this week on the bugtracker
  15. READ BEFORE POSTING IN SCRIPTING FORUM and Look at line 12, just add " ' " : resourceRoot = getResourceRootElement ( getThisResource ( ) ) Niveis = { [ '1 ' ] = 'Convidado' , [ '2 ' ] = 'Membro' , [ '3 ' ] = 'Comandante' , [ '4 ' ] = 'Sub-Lider ' , [ '5 ' ] = 'Lider' } permissoes = { [ 'Convidado' ] = { } , [ ' '] = { } , ['Comandante'] = {}, ['Sub-Lider'] = {}, ['Lider'] = {} } xLevels = { ['Convidado'] = '1', ['Membro'] = '2', ['Comandante'] = '3', ['Sub-Lider'] = '4', ['Lider'] = '5' } local gangs = {} local members = {} local rootNode = xmlLoadFile("gangs.xml") local children = xmlNodeGetChildren(rootNode) if children == false then return end for _,node in pairs(children) do local attributes = xmlNodeGetAttributes(node) if attributes.name and attributes.colorR then local name = attributes.name local colorRed = attributes.colorR local colgangreen = attributes.colgang local colorBlue = attributes.colorB local gangTag = attributes.tag local sublider = attributes.sublider local skin = attributes.skin local baseName = attributes.baseName gangs[name] = {} gangs[name]['name'] = tostring(name) gangs[name]['baseName'] = tostring(baseName) gangs[name]['tag'] = tostring(gangTag) gangs[name]['subLider'] = tostring(subLider) gangs[name]['skin'] = skin gangs[name]['color'] = {} gangs[name]['color']['r'] = tostring(colorRed) gangs[name]['color']['g'] = tostring(colgangreen) gangs[name]['color']['b'] = tostring(colorBlue) --createTeam(name, tonumber(col[1]), tonumber(col[2]), tonumber(col[3])) end end local rootNodem = xmlLoadFile("members.xml") local childrenm = xmlNodeGetChildren(rootNodem) if childrenm == false then return end for _m,nodem in pairs(childrenm) do local attributesm = xmlNodeGetAttributes(nodem) if attributesm.gangName and attributesm.accName and attributesm.level then local accName = attributesm.accName local gangName = attributesm.gangName local accLevel = attributesm.level members[accName] = {} members[accName]['gangName'] = gangName members[accName]['level'] = accLevel members[accName]['accName'] = accName end end function getPlayerFromID(id) return call(getResourceFromName("gameid"), "getPlayerFromID", tonumber(id)) end function getPlayerID(player) return getElementData(player,"id") end function onStart() call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Level",5,5,0.10) end addEventHandler("onResourceStart",resourceRoot,onStart) function gang (thePlayer,commandName,mode,playerid,...) if mode == "convidar" then if getPlayerTeam(thePlayer) then if playerid and getPlayerFromID(playerid) ~= thePlayer then CONVITE = getElementData(getPlayerFromID(playerid),"CONVITE") if CONVITE == false then outputChatBox("Convite Enviado.",thePlayer) outputChatBox("#A020F0[GANG] #ffffffVocê recebeu um convite para entrar na Gang "..getTeamName(getPlayerTeam(thePlayer)).."#00ff00! Digite /gang aceitar ou /gang recusar.",getPlayerFromID(playerid),255,255,255,true) setElementData(getPlayerFromID(playerid),"CONVITE",true) setElementData(getPlayerFromID(playerid),"GANGCONVITE",getPlayerTeam(thePlayer)) setElementData(getPlayerFromID(playerid),"PLAYERSENDCONVITE",thePlayer) Timer = setTimer(function() setElementData(thePlayer,"CONVITE",false) removeElementData(getPlayerFromID(playerid),"GANGCONVITE") removeElementData(getPlayerFromID(playerid),"PLAYERSENDCONVITE") outputChatBox("#A020F0[GANG] #ffffffSeu Convite Expirou.",getPlayerFromID(playerid)) end,120000,1) elseif CONVITE == true then outputChatBox("#A020F0[GANG] #ffffffEsse jogador já recebeu um convite para juntar-se a Gang",thePlayer,255,255,255,true) end end else outputChatBox('#A020F0[GANG] #ffffffVocê não possui uma Gang!',thePlayer,255,255,255,true) end elseif mode == "aceitar" then gang = getElementData(thePlayer,"GANGCONVITE") if gang then outputChatBox("#A020F0[GANG] #ffffffBem vindo a Gang "..getTeamName(gang),thePlayer,255,255,255,true) setPlayerTeam(thePlayer,gang) setElementData(thePlayer,"CONVITE",false) setElementData(thePlayer,"Level","Convidado") r,g,b = getTeamColor(gang) setPlayerNametagColor ( thePlayer, r, g, b ) removeElementData(thePlayer,"GANGCONVITE") killTimer(Timer) for i,v in ipairs(getPlayersInTeam ( gang )) do outputChatBox("#A020F0[GANG] #ffffff"..getPlayerName(thePlayer).." entrou em sua Gang: ("..Levels['1']..")",v,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffVocê não foi convidado para nenhuma Gang.",thePlayer,255,255,255,true) end elseif mode == "recusar" then gang = getElementData(thePlayer,"GANGCONVITE") if gang then playersend = getElementData(thePlayer,"PLAYERSENDCONVITE") outputChatBox("#A020F0[GANG] #ffffffVocê recusou o convite da Gang "..getTeamName(gang),thePlayer,255,255,255,true) outputChatBox("#A020F0[GANG] #ffffff"..getPlayerName(thePlayer).." recusou o seu convite para juntar-se a Gang",playersend,255,255,255,true) setElementData(thePlayer,"CONVITE",false) removeElementData(thePlayer,"GANGCONVITE") removeElementData(thePlayer,"PLAYERSENDCONVITE") else outputChatBox("#A020F0[GANG] #ffffffVocê não foi convidado para nenhuma Gang.",thePlayer,255,255,255,true) end elseif mode == "level" then if getPlayerTeam(thePlayer) then if playerid then level = ... if level then setPlayerLevel(thePlayer,getPlayerFromID(playerid),level) end end else outputChatBox('#A020F0[GANG] #ffffffVocê não possui uma Gang!',thePlayer,255,255,255,true) end elseif mode == "tag" then if getPlayerTeam(thePlayer) then if tonumber(xLevels[getAccountLevel(thePlayer)]) >= 3 then if playerid then tag = playerid if tag:len() <= 4 then setgangTag(thePlayer,getPlayerTeam(thePlayer),tag) for i,v in ipairs(getPlayersInTeam ( getPlayerTeam(thePlayer) )) do outputChatBox("#A020F0[GANG] #ffffffTag da gang setada para ["..tag.."] por "..getPlayerName(thePlayer),v,255,255,255,true) setElementData(thePlayer,"gang.tag","["..tag.."]") end else outputChatBox("#A020F0[GANG] #ffffff O Máximo permitido de letras são 4!",thePlayer,255,255,255,true) return end else outputChatBox("#A020F0[GANG] #ffffffUso correto. /gang tag [tag]",thePlayer,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffSomente o Lider,Sub-Lider ou Comandante pode alterar a tag da Gang.",thePlayer,255,255,255,true) end else outputChatBox('#A020F0[GANG] #ffffffVocê não possui uma Gang!',thePlayer,255,255,255,true)setgangColor(gang,r,g,b) end elseif mode == "skin" then if getPlayerTeam(thePlayer) then if getPlayerMoney(thePlayer) >= 10000 then if tonumber(xLevels[getAccountLevel(thePlayer)]) >= 3 then if playerid then skin = playerid setgangSkin(getPlayerTeam(thePlayer),skin) takeMoney(thePlayer,10000) for i,v in ipairs(getPlayersInTeam ( getPlayerTeam(thePlayer) )) do outputChatBox("#A020F0[GANG] #ffffffSkin da Gang setada para "..skin.." por "..getPlayerName(thePlayer),v,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffUso correto. /gang skin [skin]",thePlayer,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffSomente o Lider,Sub-Lider ou Comandante pode alterar a skin da Gang.",thePlayer,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffÉ necessario $10k para mudar a cor da Gang.",thePlayer,255,255,255,true) end else outputChatBox('#A020F0[GANG] #ffffffVocê não possui uma Gang!',thePlayer,255,255,255,true)setgangColor(gang,r,g,b) end elseif mode == "cor" then if getPlayerTeam(thePlayer) then if getPlayerMoney(thePlayer) >= 20000 then if tonumber(xLevels[getAccountLevel(thePlayer)]) >= 3 then if playerid then cor1 = playerid color = { ... } if color[1] and color[2] then setgangColor(getPlayerTeam(thePlayer),cor1,color[1],color[2]) takeMoney(thePlayer,20000) else outputChatBox("#A020F0[GANG] #ffffffUso correto. /gang cor [r] [g] [b] | Exemplo /gang cor 255 0 0 = #ff0000Vermelho.",thePlayer,255,255,255,true) end for i,v in ipairs(getPlayersInTeam ( getPlayerTeam(thePlayer) )) do outputChatBox("[GANG] Cor da Gang setada por "..getPlayerName(thePlayer),v,cor1,color[1],color[2],true) end else outputChatBox("#A020F0[GANG] #ffffffUso correto. /gang cor [r] [g] [b] | Exemplo /gang cor 255 0 0 = #ff0000Vermelho.",thePlayer,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffSomente o Lider,Sub-Lider ou Comandante pode alterar a cor da Gang.",thePlayer,255,255,255,true) end else outputChatBox("#A020F0[GANG] #ffffffÉ necessario $20k para mudar a cor da Gang.",thePlayer,255,255,255,true) end else outputChatBox('#A020F0[GANG] #ffffffVocê não possui uma Gang!',thePlayer,255,255,255,true)setgangColor(gang,r,g,b) end elseif mode == "kick" then if getPlayerTeam(thePlayer) then if playerid and ... and reason then reason = table.concat({...}, " ") if gangKickPlayer(thePlayer,getPlayerFromID(playerid)) then for i,v in ipairs(getPlayersInTeam ( getPlayerTeam(thePlayer) )) do outputChatBox(getPlayerName(getPlayerFromID(playerid)).." saiu da Gang. [KIKADO] (Motvio: "..reason..")",v,255,255,255,true) end
  16. Hello Everybody, I think there is a problem with the function getWeaponAmmo when it's used with a custom weapon created with createWeapon. It seems that the function always return 0. Here is an example : local theWeapon addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() theWeapon = createWeapon("m4", 1, 1, 3) setWeaponOwner(theWeapon, localPlayer) setWeaponClipAmmo(theWeapon, 10) setWeaponAmmo(theWeapon, 90) end) function handleCustomWeapon() if getKeyState("mouse1") then setWeaponState(theWeapon, "firing") else setWeaponState(theWeapon, "ready") end dxDrawText("getWeaponClipAmmo = "..getWeaponClipAmmo(theWeapon).."\ngetWeaponAmmo = "..getWeaponAmmo(theWeapon), 100, 200) setControlState("fire", false) end addEventHandler("onClientPreRender", getRootElement(), handleCustomWeapon) Can you confirm me or explain why my script doesn't work. Cordialy. ps : I use
  17. Pas de quoi, n'hesite pas en cas de soucis. Bonne Gestion
  18. Salut, Puis-je avoir le fichier des logs ce trouvant ici dans ce répertoire "server/mods/deathmatch/logs/server.log" merci
  19. pas grave que tu n'es pas de micro, juste moi te poser des questions et tu me répond par texte
  20. Ahh Mince, y'a t'il possibilité de parler sur Teamspeak 3 ou Skype éventuellement, ou meme mieux TeamViewer ?
  21. Il y'a un petit soucis : Verifie également que tes dossiers et fichiers sont bien placé. Tiens moi au jus
  22. D'accord, un de mes post devrait t'aider à avoir la bonne config https://forum.multitheftauto.com/viewtopic.php?f=128&t=62170#p592192 Sauf que là c'est pour un serveur que tu configure de A à Z je sais pas si tu peux faire ça chez Game-Host
  23. Alors concernant la ressource "freeroam" pas besoin de la telecharger et de la mettre sur le serveur est y est deja dans les fichiers de base (ici normalement dans /[gameplay]/freeroam ) Ensuite d'apres ton screen il semblerai que le dossier que tu me montre n'est d'autre que le dossier "resources" sur les serveur indépendant, c'est bien dans ce dossier que tu dois y mettre les ressources tel que huied. Si c'est toi qui à installé ces dossiers il y'a un probleme sur l'arborésence fais moi signe si c'est le cas sinon pas d'inquiétude. Concernant l'erreur, sans ressources installé de ta part, le serveur démarre t'il ? la "Configuration du serveur" se régle avec le fichier mtaserver.conf ouvre le avec un éditeur texte et regarde un peu. Tiens moi au jus Ps : Les modos n'aiment pas le double POST voir pire, le triple, n'hesites à utiliser l'edition de ton message
×
×
  • Create New...