Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. Yes. But you need indicate scrips/files/... Also i will update it and create dialog box with save folder. So far, it is saved in the program folder.
  2. It's my sample meta generator, i did write it in visual studio. C++ language. Screen Details: 2 languages ( Русский/English ) Copy Clear Save etc Also, if you select the language, it is saved in folder program. Download Download Virus total
  3. No problem. Also in wiki have example https://wiki.multitheftauto.com/wiki/GetPedBonePosition You can use it. It draw nick name on the head. And you can see your nickname.
  4. You can create your custom name tags.
  5. function setAdminSkin ( thePlayer ) if exports.global:isPlayerFullAdmin( thePlayer ) then setElementModel ( thePlayer, 0 ) setPedStat( thePlayer, 23, 700 ) setPlayerNametagText ( thePlayer, 'STAFF' ) setPlayerNametagShowing( thePlayer, true ) addPedClothes ( thePlayer, 'tshirtproblk', 'tshirt', 20 ) addPedClothes ( thePlayer, 'player_face', 'head', 1 ) addPedClothes ( thePlayer, 'worktrcamogrn', 'worktr', 2 ) addPedClothes ( thePlayer, 'convproblk', 'conv', 3 ) addPedClothes ( thePlayer, 'neckdollar', 'neck', 13 ) addPedClothes ( thePlayer, 'watchcro2', 'watch', 14 ) addPedClothes ( thePlayer, 'boaterblk', 'boater', 15 ) end end addCommandHandler ( 'askin', setAdminSkin ) Ah forgot. It's change your nametag so you can't see nick name, but all see.
  6. setPlayerNametagText use in client side if you want show only you. setPlayerNametagText ( root, Admin, true ) Admin is defined variable? And why you use 3 arguments if have only 2. Also root not work here ( tested in run code and return false ). You should loop player elements and set name tag text .
  7. You can find decompiler in google.
  8. mysql = exports.mysql local prisonmarker = createMarker ( 187.14199829102, 1868.3699951172, 17.746978759766, "cylinder", 250, 0, 0, 0, 0, 0 ) function playerDeath() if getElementData(source, "dbid") then local name = string.gsub(getPlayerName(source), "_", " ") local eventStarted = false local playersJoinedEvent = { } local weaponEvent, weaponAmmo, eventEnded local adminPositionX, adminPositionY, adminPositionZ local playersData = { } setPlayerNametagText(source, tostring(name)) exports['anticheat-system']:changeProtectedElementDataEx(source, "nameTint", 0) if getElementData(source, "adminjailed") then spawnPlayer(source, 263.821807, 77.848365, 1001.0390625, 270, getElementModel(source), 0, getElementData(source, "playerid")+65400, getPlayerTeam(source)) setCameraInterior(source, 6) setCameraTarget(source) fadeCamera(source, true) else outputChatBox("Respawn in 10 seconds.", source) setTimer(respawnPlayer, 10000, 1, source) playersJoinedEvent = true spawnPlayer = false end end end addEventHandler("onPlayerWasted", getRootElement(), playerDeath) function respawnPlayer(thePlayer) if (isElement(thePlayer)) then local cost = 0 local faction = false if not exports.global:isPlayerSilverDonator(thePlayer) then local team = getPlayerTeam(thePlayer) if getTeamName(team) == "San Andreas Network" then _, cost = exports.global:takeMoney(team, math.random(150, 300), true) faction = getTeamName(team) else _, cost = exports.global:takeMoney(thePlayer, math.random(150, 300), true) end end local tax = exports.global:getTaxAmount() exports.global:giveMoney( getTeamFromName("Las Venturas Emergency Services"), math.ceil((1-tax)*cost) ) exports.global:giveMoney( getTeamFromName("Government of Los Santos"), math.ceil(tax*cost) ) mysql:query_free("UPDATE characters SET deaths = deaths + 1 WHERE charactername='" .. mysql:escape_string(getPlayerName(thePlayer)) .. "'") setCameraInterior(thePlayer, 0) local text = "You have recieved treatment from the Los Santos Medical Center." if cost > 0 then text = text .. " Cost: " .. cost .. "$" end if faction then text = text .. ", paid by " .. faction .. "." end outputChatBox(text, thePlayer, 255, 255, 0) -- take all drugs local count = 0 for i = 30, 43 do while exports.global:hasItem(thePlayer, i) do exports.global:takeItem(thePlayer, i) count = count + 1 end end if count > 0 then outputChatBox("The illegal substances you had have been handed over to investigators.", thePlayer, 255, 194, 14) end local theSkin = getPedSkin(thePlayer) local theTeam = getPlayerTeam(thePlayer) local fat = getPedStat(thePlayer, 21) local muscle = getPedStat(thePlayer, 23) setPedStat(thePlayer, 21, fat) setPedStat(thePlayer, 23, muscle) spawnPlayer(thePlayer,1185.296875, -1323.7158203125, 13.572407722473, 0, theSkin, 0, 0, theTeam) fadeCamera(thePlayer, true, 6) triggerClientEvent(thePlayer, "fadeCameraOnSpawn", thePlayer) end end function deathRemoveWeapons(weapons, removedWeapons) setTimer(giveGunsBack, 10005, 1, source, weapons, removedWeapons) end addEvent("onDeathRemovePlayerWeapons", true) addEventHandler("onDeathRemovePlayerWeapons", getRootElement(), deathRemoveWeapons) function giveGunsBack(thePlayer, weapons, removedWeapons, removedWeapons2) if (removedWeapons~=nil) then if tonumber(getElementData(thePlayer, "license.gun")) == 0 and getElementData(getPlayerTeam(thePlayer),"type") ~= 2 then outputChatBox("The employees have taken away weapons which you did not have a license for. (" .. removedWeapons .. ").", thePlayer, 255, 194, 14) else outputChatBox("The employees have taken away weapons which you are not allowed to carry. (" .. removedWeapons .. ").", thePlayer, 255, 194, 14) end end if removedWeapons2 ~= nil then outputChatBox("The employees have taken away your " .. removedWeapons2 .. " for safety purposes.", thePlayer, 255, 194, 14) end -- 28 for key, value in ipairs(weapons) do local weapon = tonumber(weapons[key][1]) local ammo = tonumber(weapons[key][2]) local removed = tonumber(weapons[key][3]) if (removed==0) then exports.global:giveWeapon(thePlayer, weapon, math.floor( ammo / 2 ), false) else exports.global:takeWeapon(thePlayer, weapon) exports.logs:logMessage("[Death] " .. getElementData(thePlayer, "gameaccountusername") .. "/" .. getPlayerName(thePlayer) .. " lost a weapon (" .. getWeaponNameFromID (weapon) .. "/".. tostring(ammo) .." ammo)", 28) end end end local eventStarted = false local playersJoinedEvent = { } local weaponEvent, weaponAmmo, eventEnded local adminPositionX, adminPositionY, adminPositionZ local playersData = { } function convertPlayerWeaponsToTable(player) local weapons = { } for slot = 0, 12 do local weapon = getPedWeapon( player, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo( player, slot ) if ( ammo > 0 ) then weapons[weapon] = ammo end end end return weapons end function playerJoinsEvent ( thePlayer, command ) if ( eventStarted == true and not playersJoinedEvent[thePlayer] and command == "joinevent" ) then local pX, pY, pZ = getElementPosition ( thePlayer ) local randomobjectnumber = math.random(1, 300) local playerSkin = getElementModel ( thePlayer ) playersData[thePlayer] = { position = { pX, pY, pZ }, skin = playerSkin, weapons = convertPlayerWeaponsToTable( thePlayer ) } if spawnPlayer( thePlayer, adminPositionX, adminPositionY, adminPositionZ, 0, tonumber( skinID ) ) then playerJoinedEvent = true setElementModel ( thePlayer, randomobjectnumber ) exports.global:giveWeapon ( thePlayer, weaponEvent, tonumber( weaponAmmo ) ) outputChatBox( "#FFFFFFEVENT: You successfully joined the event", thePlayer, 255, 255, 255, true ) playersJoinedEvent[thePlayer] = true end elseif ( eventStarted == false and not playersJoinedEvent[thePlayer] and command == "joinevent" ) then outputChatBox( "#FFFFFFEVENT: There is no event currently ongoing.", thePlayer, 255, 255, 255, true ) elseif ( eventStarted == true and playerJoinedEvent == true and command == "joinevent" ) then outputChatBox( "#FFFFFFEVENT: You are already in the event", thePlayer, 255, 255, 255, true ) end if ( eventEnded == false and not playersJoinedEvent[thePlayer] and command == "endevent" ) then loadOriginalData ( thePlayer ) eventEnded = true end if ( command == "quitevent" and eventStarted == true and playersJoinedEvent[thePlayer] )then --loadOriginalData ( thePlayer ) killPed( thePlayer ) outputChatBox( "#FFFFFFEVENT: You successfully quit the event.", thePlayer, 255, 255, 255, true ) end end addCommandHandler("joinevent",playerJoinsEvent) addCommandHandler("quitevent",playerJoinsEvent) function loadOriginalData ( thePlayer ) local savedData = playersData[thePlayer] if ( savedData and type ( savedData ) == "table" ) then local x, y, z = unpack ( savedData.position ) playersJoinedEvent[thePlayer] = nil local spawned = spawnPlayer( thePlayer, x, y, z, 0, savedData.skin) if (spawned ) then takeAllWeapons ( thePlayer ) for weapon, ammo in pairs ( savedData.weapons ) do exports.global:giveWeapon ( thePlayer, weapon, ammo ) end end end end function adminStartEvent(thePlayer, command, weaponId, ammoCMD) if ( eventStarted == false and command == "startevent" and weaponId ~= null ) then playersData = { } playersJoinedEvent = { } --Declaring booleans and variables weaponAmmo = ammoCMD weaponEvent = weaponId eventEnded = false eventStarted = true local weaponName = getWeaponNameFromID ( weaponEvent ) adminPositionX, adminPositionY, adminPositionZ = getElementPosition ( thePlayer ) --*********************** outputChatBox( "#FFFFFFEVENT: Event started by Admin", getRootElement( ), 255, 255, 255, true ) outputChatBox( "#FFFFFFEVENT: Weapon being used ".. weaponName, thePlayer,255, 255, 255, true ) end if ( eventStarted == false and command == "startevent" and weaponId == null ) then outputChatBox( "SYNTAX: /startevent [weaponID] [ammo]", thePlayer, 255, 194, 14, true ) end if ( eventStarted == true and command == "endevent" ) then eventStarted = false eventEnded = true playerJoinedEvent = false outputChatBox( "#FFFFFFEVENT: Event ended by an Admin", thePlayer, 255, 255, 255, true ) elseif ( eventStarted == false and command == "endevent" ) then outputChatBox( "#FFFFFFEVENT: There is no event in progress.", thePlayer, 255, 255, 255, true ) end end addCommandHandler( "startevent", adminStartEvent ) addCommandHandler( "endevent", adminStartEvent ) addEventHandler( "onPlayerSpawn", getRootElement( ), function ( ) if ( eventStarted == true and playersJoinedEvent[source] ) then loadOriginalData ( source ) end end ) addEventHandler( "onPlayerWasted", getRootElement( ), function ( ) if ( eventStarted == true and playerJoinedEvent == true ) then loadOriginalData ( source ) end end ) You mean it? See line 177 If you type cmd /quitevent you killed and respawned.
  9. I not understand what you want
  10. Problem already solved. I write him function.
  11. Because you have syntax error. if then else else end lol? viewtopic.php?f=148&t=40809 function playerDeath() if getElementData( source, "dbid" ) then local name = string.gsub( getPlayerName( source ), "_", " " ) setPlayerNametagText( source, tostring( name ) ) exports['anticheat-system']:changeProtectedElementDataEx(source, "nameTint", 0) if getElementData(source, "adminjailed") then spawnPlayer(source, 263.821807, 77.848365, 1001.0390625, 270, getElementModel(source), 0, getElementData(source, "playerid")+65400, getPlayerTeam(source)) setCameraInterior(source, 6) setCameraTarget(source) fadeCamera(source, true) else outputChatBox("Respawn in 10 seconds.", source) setTimer(respawnPlayer, 10000, 1, source) end end end addEventHandler("onPlayerWasted", getRootElement(), playerDeath) Variable respawnPlayer is defined?
  12. Kenix

    Again Help

    Also viewtopic.php?f=148&t=40809
  13. Kenix

    ColShapeLeave

    uShapeArea = createColRectangle( 41.2666015625, -2812.1865234375, 2900, 2200 ) setElementDimension( uShapeArea,0 ) setElementInterior( uShapeArea,0 ) function fLeaveShape( uShape, bDim ) if uShape == uShapeArea and bDim and getElementInterior( source ) == 0 then outputChatBox( "Nu ai voie sa iesi din LS!", source, 255, 255, 255 ) killPed ( source ) end end addEventHandler( 'onElementColShapeLeave', root, fLeaveShape )
  14. Updated. I think better don't change.
  15. You need install DirectX SDK. Put all header files/libs in directory VS.( Like this: C:\Program Files\Microsoft Visual Studio 9.0\VC ( in folders: include, lib ) ( I had the same problem. ) Also you can add all this files to your project in VS. VS = Visual studio
  16. https://forum.multitheftauto.com/viewtop ... b51ad4fdb0 https://wiki.multitheftauto.com/wiki/Scr ... troduction
  17. Show meta. This code hide/show ( all but not you ).
  18. Can you explain? What you choice? Client local state function fHide( ) state = not state for _, v in pairs( getElementsByType 'player' ) do if v ~= localPlayer then if state then setPlayerNametagShowing( v, false ) setElementAlpha( v, 0 ) else setPlayerNametagShowing( v, true ) setElementAlpha( v, 255 ) end end end end bindKey( 'F1', 'down',fHide )
  19. If use it in client side it hide all players only for you ( but all can see you ), if server side anybody hide and anybody can't see each other . I think you understand. If you know, you said this words, but you not say. You say it
  20. Nope. You do not know, what's the difference from the client and server?
×
×
  • Create New...