
Absence2
Members-
Posts
267 -
Joined
-
Last visited
Everything posted by Absence2
-
local xml1 = xmlLoadFile( "page.xml" ) local contents1 = xmlNodeGetValue( xml1 ) guiCreateGridList(0.03,0.03,0.94,0.95,contents1,true,page) You mean like this?
-
There's no image. Re-upload it on another host, - tinypic.com
-
Sorry for the double post but, bump!
-
Oh, I see, that did work, thanks
-
I noticed that the setPlayerNametagText affects my "custom" nametags so that's great! So I remade most of it into this: function setAdminSkin ( thePlayer ) local playerName = getPlayerName if exports.global:isPlayerFullAdmin( thePlayer ) then setElementModel ( thePlayer, 29 ) setPlayerNametagText ( thePlayer, '" .. playerName .. " (ADMIN)' ) end end addCommandHandler ( 'askin', setAdminSkin ) this seems to show the name ONLY,but not (ADMIN) =/ supposed to be: Idjot_Idjot (Admin)
-
I have those, but this is just some additional thing I intented to use in my event script for Admins vs Players events/wars. Well thanks for your help, I'll try it out with someone in a moment.
-
So I can't enable the nametag for myself somehow ?
-
#1 Nop, I was trying to set the text to 'Admin' but I think I covered that one. #2 I tested, sorry. I thought it would show if true and hide > false as without it didn't work, I re-checked on wiki and noticed that I did wrong. anyways, I got this now: Server: function setAdminSkin (thePlayer) if (exports.global:isPlayerFullAdmin(thePlayer)) then setPedSkin ( thePlayer, 0 ) setPedStat(thePlayer, 23, 700) setPlayerNametagShowing( root, true ) triggerClientEvent ( "tagName", getRootElement() ) 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) client: function tagAdminEvent () setPlayerNametagText ( root, "STAFF") end addEvent ( "tagName", true ) addEventHandler( "tagName", getRootElement(), tagAdminEvent ) No nametag is showing though
-
Hey, I'm working on this Admin skin thing for my event system, would this show a nametag saying "Admin" on whoever used this command? And can I make it visible for myself? function setAdminSkin (thePlayer) if (exports.global:isPlayerFullAdmin(thePlayer)) then setPedSkin ( thePlayer, 0 ) setPedStat(thePlayer, 23, 700) setPlayerNametagShowing( root, true ) setPlayerNametagText ( root, Admin, 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)
-
help please nono, that's the thing I want fixed if you die in event (onPlayerWasted) you get TPed back - loadOriginalData ( source ) and then you die after that. I'm trying to prevent that from happening. (You're not supposed to die after you get killed in event). You're just supposed to die in event and then go back to your normal position outside event without dieing Can't I cancel the playerDeath event? like.. addEventHandler( "onPlayerWasted", getRootElement( ), function ( ) if ( eventStarted == true and playerJoinedEvent == true ) then loadOriginalData ( source ) cancelEvent = playerDeath () cancelEvent = respawnPlayer () end end ) fixed EDIT: I noticed something else <.< if I /endevent, loadOriginalData ( source ) doesn't take effect. It just leaves me on the current spot with my "event guns". This is what I got: mysql = exports.mysql local prisonmarker = createMarker ( 187.14199829102, 1868.3699951172, 17.746978759766, "cylinder", 250, 0, 0, 0, 0, 0 ) function playerDeath() if (playerJoinedEvent == true) then cancelEvent (onPlayerWasted, 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" or eventStarted == true) 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 5 seconds.", source) setTimer(respawnPlayer, 5000, 1, source) end end end end addEventHandler("onPlayerWasted", getRootElement(), playerDeath) function respawnPlayer(thePlayer) if (playerJoinedEvent == true) then cancelEvent (onPlayerWasted, playerDeath) 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 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 ) end if exports.global:isPlayerFullAdmin( thePlayer ) then local playerName = getPlayerName(thePlayer) setElementModel ( thePlayer, 29 ) setPlayerNametagText ( thePlayer, playerName .. " (ADMIN)" ) 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 (command == "endevent" and eventStarted == true and eventEnded == false and playersJoinedEvent[thePlayer]) then loadOriginalData ( thePlayer ) eventEnded = true end if ( command == "quitevent" and eventStarted == true and playersJoinedEvent[thePlayer] )then loadOriginalData ( thePlayer ) outputChatBox( "#FFFFFFEVENT: You successfully quit the event.", thePlayer, 255, 255, 255, true ) end end addCommandHandler("joinevent",playerJoinsEvent) addCommandHandler("quitevent",playerJoinsEvent) addCommandHandler("endevent",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 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 )
-
if he's in the event and I disable the first script, he doesn't die in the event. if enabled, he dies. as Draken said, I'm trying to "detect" if he's in event wih /joinevent and then to ignore players in event or something when dieing, no idea how to explain go to page 1 (I want the player to do the same thing when the /quitevent and when he dies, but the first script messes that up, so I'm lost, that's what I need help with
-
I'm trying to do this somehow. But what I did just messed up the spawn after dieing
-
I know I had syntax error, I fixed it the second after I posted. I just forgot to update it. Hence the EDIT: Anyways, this is everything I got related to this: 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 ) 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 )
-
Last part there won't really be a problem. But isn't this the same thing as "canceling death"? o_o and do you mean something like this: 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) else playersJoinedEvent = true spawnPlayer = false end end end addEventHandler("onPlayerWasted", getRootElement(), playerDeath) EDIT: that didn't work at all ^ , it even made things worse lol
-
That sounds really hard, also I tried by turning off the respawn after death resource and it seems to be working fine while it's off. 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), "_", " ") 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) 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 Is there anything I can do about that then >.<? Or is "fake health" my only option?
-
Thank you but I still need help with one of the big ones: addEventHandler( "onPlayerWasted", getRootElement( ), function ( ) if ( eventStarted == true and playerJoinedEvent == true ) then loadOriginalData ( source ) end end ) If he dies within /joinevent (Basically the event), he dies. He's only supposed to "Die within the event" and just TP back to his position after he gets killed inside the event. Any idea how to do this? With this, he gets TPed back to his previous position THEN dies outside the event.
-
Yes, I noticed, it might involve this, the onPlayerWasted is still a problem. I really DIE if I die within the event which shouldn't happen , it should "kick" me from the event when I reach 0 hp and return me to the old position without killing me outside the event >.< The skin & gun seems to be solved from what I can see also I have a question, if someone /joinevent - their skins sets to 0, if they quit, it's normal. Can I change it somehow or use their default skin if they /joinevent? EDIT: noticed a second error, it now doesn't spawn me to my previous (old) position when I /quitevent or /endevent, it probably includes while dieing, can't really check that one as I die for real. (It adds me to the current position I am at, lol). ^ works now, I saw that you edited your post but it's just this, when dieing inside the event: function playerDied() if(eventStarted == true and playerJoinedEvent == true)then exports.global:takeAllWeapons(source) spawnPlayer(source,pX,pY,pZ,0,skinID) end end addEventHandler("onPlayerWasted",getRootElement(),playerDied) It kills you for real. =/ can't I cancel the event or something? When he hits 0 hp in the event he gets kicked from the event? or your verison: addEventHandler( "onPlayerWasted", getRootElement( ), function ( ) if ( eventStarted == true and playerJoinedEvent == true ) then loadOriginalData ( source ) end end )
-
Oh, I must of missed that one. I corrected it and tried. when I die, I spawn back at the position before /joinevent, but the thing is, I die and then I just die and spawn at hospital. Also it didn't solve the other two things, skins & guns. How to prevent that to happen and how to save skins & guns ? (I die after being teleported back to my previous position)
-
Exactly! The position is saved properly, skin and guns isn't though.
-
Hey, I have some issues with this script me & my friend are developing, we're having few problems with the onPlayerWasted and the commandhandler - quitevent local eventStarted = false local playerJoinedEvent = false local weaponEvent,ammo,eventEnded local pX,pY,pZ local adminPositionX,adminPositionY,adminPositionZ local weaponEquipped1,weaponEquipped2,weaponEquipped3,weaponEquipped4,weaponEquipped5,weaponEquipped6,weaponEquipped7,weaponEquipped8,weaponEquipped9,weaponEquipped10,weaponEquipped11,weaponEquipped12 function playerJoinsEvent(thePlayer, command,amount) local skin = setElementModel(thePlayer, tonumber(skinID)) if(eventStarted == true and playerJoinedEvent == false and command == "joinevent") then pX,pY,pZ = getElementPosition(thePlayer) spawnPlayer(thePlayer,adminPositionX,adminPositionY,adminPositionZ,0,skinID) playerJoinedEvent = true exports.global:giveWeapon (thePlayer,weaponEvent , tonumber(ammo)) outputChatBox("You successfully joined the event",thePlayer) elseif(eventStarted == false and playerJoinedEvent == false and command == "joinevent")then outputChatBox("#FF8000 |Event| : There is no event currently ongoing.",thePlayer, 42, 100, 100, true ) elseif(eventStarted == true and command == "joinevent" and playerJoinedEvent == true)then outputChatBox("#FF8000 |Event| : You are already in the event",thePlayer,42, 100, 100, true ) end if(eventEnded == false and playerJoinedEvent == true and command == "endevent")then spawnPlayer(thePlayer,pX,pY,pZ,0,skin) eventEnded = true end if(command == "quitevent" and eventStarted == true and playerJoinedEvent == true)then spawnPlayer(thePlayer,pX,pY,pZ,0,skinID) playerJoinedEvent = false exports.global:takeAllWeapons(source) outputChatBox("#008000|Event| : You successfully quit the event.",thePlayer,42, 100, 100, true ) end end addCommandHandler("joinevent",playerJoinsEvent) addCommandHandler("quitevent",playerJoinsEvent) addCommandHandler("endevent",playerJoinsEvent) function adminStartEvent(thePlayer, command, weaponId, ammoCMD) if(eventStarted == false and command == "startevent" and weaponId ~= null)then --Declaring booleans and variables ammo = ammoCMD weaponEvent = weaponId eventEnded = false eventStarted = true local weaponName = getWeaponNameFromID (weaponEvent) adminPositionX,adminPositionY,adminPositionZ = getElementPosition(thePlayer) --*********************** outputChatBox("#FF8000 |Event| : Event started by Admin",getRootElement(),42, 100, 100, true ) outputChatBox("#FF8000 |Event| : Weapon being used "..weaponName,thePlayer,42, 100, 100, true ) end if(eventStarted == false and command == "startevent" and weaponId == null)then outputChatBox("#FF0000 |Event|Syntax|: /startevent [weaponID][ammo]",thePlayer,42, 100, 100, true) end if(eventStarted == true and command == "endevent")then eventStarted = false eventEnded = true playerJoinedEvent = false outputChatBox("#FF8000 |Event| : Event ended by an Admin",thePlayer,42, 100, 100, true ) elseif(eventStarted == false and command == "endevent")then outputChatBox("#FF0000 |Event| : There is no event in progress.",thePlayer,42, 100, 100, true ) end end addCommandHandler("startevent",adminStartEvent) addCommandHandler("endevent",adminStartEvent) function playerDied() if(eventStarted == true and playerJoinedEvent == true)then exports.global:takeAllWeapons(source) spawnPlayer(source,pX,pY,pZ,0,skinID) end end addEventHandler("onPlayerWasted",getRootElement(),playerDied) So when you /quitevent, you basically return to your old position. We're do that aswell on function playerDied, if you die, you return there "without being killed", you just get thrown out of the event. We also have some skin problems. It doesn't save your current skin while entering the event with /joinevent (skin sets to 0), and you come out with skin ID 0 if you die or /quitevent ^ Same goes for guns. takeAllWeapons takes the ones you had before the event too. Any help here
-
http://www.vedicgaming.net/scripts/
-
I tested it on my server as it looked like a neat script, solid's verison works, including Kenix's, make sure you add it clientsided in meta.xml and it will work jus fine
-
This sounds like stolen scripts, I advise you not to use them to be honest. There are usually more than one backdoor, plus it's illegal and goes against the seller's TOS. What scripts are you using? I suppose you're talking about vG scripts, right?
-
Thank you very much , I appreciate it!
-
How do I make a GUI window open when I right click on a Ped? all I got is this: local laura = createPed( 211, 1488.5498046875, 1305.8798828125, 1093.2963867188, 275 ) setElementDimension( laura, 0 ) setElementData( laura, "name", "Laura Fredriksen" ) setPedAnimation ( laura, "DEALER", "DEALER_IDLE_01", -1, true, false, false ) setElementFrozen(laura, true) I don't know how to go further , couldn't find much on wiki either