
blurryshadow1
Members-
Posts
98 -
Joined
-
Last visited
Everything posted by blurryshadow1
-
"attempt to preform arithmetic on a boolean value"?!? help!!
blurryshadow1 replied to blurryshadow1's topic in Scripting
ahhh i see... well at least now i know how to reset things like money,deaths, and kills.. -
ok so what i did was made two .lua files and put the 1st code on one file and the second code on the other file. then i created a meta.xml file and got this <meta> <info gamemodes="gang" type="script" name="killsounds" author="blurryshadow1" version="1.0.0" description="killsounds" /> <script src="headshot.lua" type="server" /> <script src="headshot2.lua" type="client" /> <file src="headshot.mp3" /> </meta> i did it right?
-
im trying to combine the code where if you shoot the head its a one hit kill with another code that plays a sound whenever you get a headshot kill but i dont exactly know how to combine them can someone give me a hand? this one function headShot(attacker, weapon, bodypart, loss) if (bodypart == 9) then killPed(source, attacker, weapon, bodypart) if (weapon == 25) or (weapon == 26) or (weapon == 27) then--//Åñëå âûñòðåë èç äðîáîâèêîâ òî, ñðûâàåì ãîëîâó. setPedHeadless(source, true) end end end addEventHandler("onPlayerDamage", getRootElement(), headShot) combined with this function startMySound() sound = playSound( "headshot.mp3", false ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), startMySound ) ive edited the second one to try and fit the needs for combining but i dont know if im doing it right at all... i want to try and get it right the first time cause i rarely have anyone on my server so i can test stuff like this...
-
"attempt to preform arithmetic on a boolean value"?!? help!!
blurryshadow1 replied to blurryshadow1's topic in Scripting
it still doesnt work... that alright guys i guess i can live without the kills reseting..... i realized that money saves too so if deaths and kills didnt save it would be a little un even... you know? well thanks guys for trying.. edit: !!!!!!!!!!! I FIXED IT!!!!! i changed OnPlayerJoin to OnplayerLogin!!!! :D -
Of course, in this line: if (getPlayerCount() > 1) then It means that if there are more than 1 player in the server then blablabla If you are a cop, you can't get any wanted star ( except by a command ). If there are nobody in the server, so Theres nobody wanted ( in the server ). So don't touch it, it works fine well actually cops get wanted when they kill a wanted player and non wanted players, the only place they dont get a star in is when they enter a police vehicle pretty much. its something to do with the edited legal systems i have im pretty sure.. im going to have it fixed so that when a non wanted player or wanted player kills a wanted player they dont get any stars. (wanted count: 6.... lol)
-
"attempt to preform arithmetic on a boolean value"?!? help!!
blurryshadow1 replied to blurryshadow1's topic in Scripting
Try this ( replace Kills by the good elementData if it's wrong ): function resetKills() -- Set his kills to 0 ( I think it's a setElementData so ...) setElementData( source, "Kills", 0 ) end addEventHandler( "onPlayerConnect", getRootElement(), resetKills ) Citizen, onPlayerConnect is when a player connects, this should use onPlayerJoin instead. function resetKills() -- Set his kills to 0 ( I think it's a setElementData so ...) setElementData( source, "Kills", 0 ) end addEventHandler( "onPlayerJoin", getRootElement(), resetKills ) i dont know if its me not putting in the code right or the script but for some reason it still doesnt work.. -
i dont think so... i tried it with my old gamemode with all my old resources and it didnt work. it used to work just fine before... well i deleted the upper half of the script and i dont get any errors anymore... all though when i get a wanted star and enter in /wanted it still says no one is wanted. heres what it looks like now. addCommandHandler ("wanted", function (thePlayer, command) if (getPlayerCount() > 1) then local players = getElementsByType ("player") outputChatBox ("---", thePlayer, 0, 0, 255, false) outputChatBox ("Wanted list.", thePlayer, 0, 0, 255, false) for i,v in ipairs (players) do local level = getPlayerWantedLevel (v) if (level > 0) then outputChatBox (getPlayerName (v) .. " - " .. level, thePlayer, 0, 0, 255, false) end end outputChatBox ("---", thePlayer, 0, 0, 255, false) else outputChatBox ("Theres nobody wanted.", thePlayer, 0, 0, 255, false) end end) im kind of thinking maybe it only shows other players wanted lvls except yours... hmmm edit: it only shows when other players are are in the server...
-
i have this command on my server where you can type /wanted and you will be able to see the wanted level. but recently for some reason it hasnt been working... i get this two errors when ever i enter in /wanted ERROR: Client triggered serverside event PlayerChatting, but event is not added serverside ERROR: Client triggered serverside event PlayerNotChatting, but event is not added serverside heres the code if someone needs it addEventHandler ("onResourceStart", getRootElement(), function() end) addEventHandler ("onPickupUse", getRootElement(), function (playerWhoUses) if (source == copPickup) and (getPlayerWantedLevel (playerWhoUses) == 0) then giveWeapon (playerWhoUses, 3, 1, true) setPlayerNametagText (playerWhoUses, "[COP]" .. getPlayerName (playerWhoUses)) setElementData (playerWhoUses, "job", "police") outputChatBox ( "* " .. getPlayerName(playerWhoUses) .. " is a cop now!", getRootElement(), 0, 0, 255, false) outputChatBox ("Arrest wanted people by hitting them with your nightstick!", playerWhoUses, 0, 0, 255, false) outputChatBox ("Use /wanted to get the wanted list.", playerWhoUses, 0, 0, 255, false) elseif not (getPlayerWantedLevel (playerWhoUses) == 0) and (source == copPickup) then outputChatBox ("You can't become cop with this wanted level!", playerWhoUses, 0, 0, 255, false) end end) addCommandHandler ("wanted", function (thePlayer, command) if (getPlayerCount() > 1) then local players = getElementsByType ("player") outputChatBox ("---", thePlayer, 0, 0, 255, false) outputChatBox ("Wanted list.", thePlayer, 0, 0, 255, false) for i,v in ipairs (players) do local level = getPlayerWantedLevel (v) if (level > 0) then outputChatBox (getPlayerName (v) .. " - " .. level, thePlayer, 0, 0, 255, false) end end outputChatBox ("---", thePlayer, 0, 0, 255, false) else outputChatBox ("Theres nobody wanted.", thePlayer, 0, 0, 255, false) end end) there was also a point where it used to only work if you had a nightstick, then it worked if you didnt have it, then over time it just stopped working... id like it to work where anybody can type /wanted and see whos wanted.
-
"attempt to preform arithmetic on a boolean value"?!? help!!
blurryshadow1 replied to blurryshadow1's topic in Scripting
Try this ( replace Kills by the good elementData if it's wrong ): function resetKills() -- Set his kills to 0 ( I think it's a setElementData so ...) setElementData( source, "Kills", 0 ) end addEventHandler( "onPlayerConnect", getRootElement(), resetKills ) i dont think its working... i just added this onto the .lua file snake posted up there... -
ive got it all down, its just i cant figure out how to bind the stop button to the spawn button.... edit: i did it!!!!!! well i didnt bind it to the spawn button but i made it so that the music stops when you spawn this is actually my first script that i put together on my own thanks snake for helping.
-
id like to have some music playing in the backround from when you join and pick your character, and then have it end once you press spawn. how can i do that?
-
"attempt to preform arithmetic on a boolean value"?!? help!!
blurryshadow1 replied to blurryshadow1's topic in Scripting
okay edit: it works ... well i havent got to testing every different situation of getting killed but the situations where you die from explosions and falling from the sky works edit 2: one other problem now... the deaths and kills dont reset back to 0 when you leave the server it just adds on each time you visit... -
"attempt to preform arithmetic on a boolean value"?!? help!!
blurryshadow1 replied to blurryshadow1's topic in Scripting
unfortunatly its still the same outcome... except i found a few more problems too sadly... pretty much everything that consists of gaining higher deaths or kills on the scoreboard can give you this little error... -
i downloaded the gangwar [rus] from the resources section of mta's website and currently im in the process of translating it to english.. ok so well the thing is, when you die from gun shots, explosions, and falling off high places it glitches you up and it wont respawn you... when that happens i get this error ERROR: login\spawn_panel_s.lua:119: attempt to preform arithmetic on a boolean value can somebody help me fix it please? if you need the code here it is... ----------//\\----------- ---//GangWar gamemode by SpawN\\--- ----------\\//----------- --//Ñîçäà¸ì êîìàíäû áàíä Grove_Street = createTeam("Grove Street", 0, 179, 4) --setTeamFriendlyFire(Grove_Street , false) Ballas = createTeam("Ballas", 211, 0, 174) --setTeamFriendlyFire(Ballas , false) Aztec = createTeam("Aztec", 0, 219, 222) --setTeamFriendlyFire(Aztec , false) LSPD = createTeam("LSPD", 100, 149, 237) --setTeamFriendlyFire(LSPD , false) --//Òàáëèöà ðåñïàâíîâ. Respawns = {["Grove Street"] = {2498.6701660156, -1684.5754394531, 13.416213035583}, ["Ballas"] = {2172.3395996094, -1794.5, 13.361840248108}, ["Aztec"] = {1828.4742431641, -1682.5, 13.546875} ,["LSPD"] = {1579.728515625, -1635.6196289063, 13.560563087463}} Weapons1 = {} Weapons2 = {} Weapons3 = {} blipPlayers = {} --//Ñïàâí èãðîêà. function playerSpawn(GangName, SkinID, WeaponSlot1, WeaponSlot2, WeaponSlot3) spawnPlayer(source, Respawns[GangName][1],Respawns[GangName][2],Respawns[GangName][3], 0, SkinID, 0, 0) setPlayerTeam(source, getTeamFromName(GangName)) fadeCamera(source, true) setCameraTarget(source, source) if WeaponSlot1 then giveWeapon(source, WeaponSlot1, 350, true) Weapons1[getPlayerName(source)] = WeaponSlot1 end if WeaponSlot2 then giveWeapon(source, WeaponSlot2, 250, true) Weapons2[getPlayerName(source)] = WeaponSlot2 end if WeaponSlot3 then giveWeapon(source, WeaponSlot3, 50, false) Weapons3[getPlayerName(source)] = WeaponSlot3 end setPlayerMoney(source, getAccountData(getPlayerAccount(source),"money")) setPlayerNametagText(source, getPlayerName(source).."["..getElementData(source,"id").."]") local r,g,b = getTeamColor(getTeamFromName(GangName)) blipPlayers[getPlayerName(source)] = createBlipAttachedTo(source, 0, 3, r, g, b, 255, 0, 99999.0)--//Ïðèêëåèâàåì ê èãðîêó áëèï(èêîíêó), ïîä öâåò êîìàíäû. showPlayerHudComponent(source,"radar", true) showPlayerHudComponent(source,"area_name", true) for i = 69,79 do setPedStat(source, i, 999) end end addEvent("playerSpawn", true) addEventHandler("playerSpawn", getRootElement(), playerSpawn) --//Ðåñïàâí èãðîêà ïîñëå ñìåðòè. function RespawnPlayer(source, skin) local teamNeme = getTeamName(getPlayerTeam(source)) spawnPlayer(source, Respawns[teamNeme][1],Respawns[teamNeme][2],Respawns[teamNeme][3], 0, skin, 0, 0) if Weapons1[getPlayerName(source)] then giveWeapon(source, Weapons1[getPlayerName(source)], 350, true) end if Weapons2[getPlayerName(source)] then giveWeapon(source, Weapons2[getPlayerName(source)], 250, true) end if Weapons3[getPlayerName(source)] then giveWeapon(source, Weapons3[getPlayerName(source)], 50, false) end if (isPedHeadless(source) == true) then--//Äîáîâëÿåì èãðîêó ãîëîâó åñëå å¸ íåò. setPedHeadless(source, false) end end --//Ðåñïàâí èãðîêà ïîñëå ñìåðòè. function respawnDead(ammo, attacker, weapon, bodypart) if attacker then if (getElementType(attacker) == "player") then setPlayersStatsIFattackerPlayer(source, attacker) elseif (getElementType(attacker) == "vehicle") then setPlayersStatsIFattackerVehicle(source, attacker) end end if (getElementData(source,"F4") == false) then setTimer(RespawnPlayer, 5000, 1, source, getPlayerSkin(source)) elseif (getElementData(source,"F4") == true) then setTimer(triggerClientEvent, 5000, 1, "step1gangs", source) setElementData(source,"F4", false) end end addEventHandler("onPlayerWasted", getRootElement(), respawnDead) --//Óäîëÿåì ïðè ðåñïàâíå àâòîìîáèëÿ, äàííóþ î òîì êòî â íå¸ ñòðåëÿë, â ðåçóëüòàòå ÷åãî îíà âçîðâàëàñü. playersDamageVihecle = {}--//Òàáëèöà Àòàêóåùèõ àâòîìîáèëåé (åñëå ïîñëå íèõ òà÷êà çàãàðåëàñü). function onVehicleRespawn(exploded) if (getElementType(source) == "vehicle") then if playersDamageVihecle[source] then playersDamageVihecle[source] = nil if not playersDamageVihecle[source] then outputChatBox("#CC0033[ÑÅÐÂÅÐ]: #339933 Ýòó ìàøèóí óáðàëè ñ ìàñèâà, òðàíñïîðò âçîðâàíûé èãðîêàìè.!", getRootElement(), 0, 0, 0,true) end end end end addEventHandler("onVehicleRespawn", getRootElement(), onVehicleRespawn) --//Ôóíêöèÿ èçñåíÿþùÿÿ ñòàòèñòèêó èãðîêîâ. Óìåðøåãî è óáèéöû.(Åñëå àòàêóþùèé èãðîê) function setPlayersStatsIFattackerPlayer(HitPlayer, attacker) local accountAttacker = getPlayerAccount(attacker) local accountHitPlayer = getPlayerAccount(HitPlayer) setAccountData(accountHitPlayer, "Deaths", getAccountData(accountHitPlayer, "Deaths")+1) if (attacker ~= HitPlayer) then --//Åñëè ýòî íå ñàìîóáèéñòâî. setAccountData(accountAttacker, "Kills", getAccountData(accountAttacker, "Kills")+1) givePlayerMoney(attacker, 500) takePlayerMoney(HitPlayer, 500) end end --//Ôóíêöèÿ ñðîáàòûâàþùÿÿ êîãäà èãðîê, çàäàâëåí òà÷êîé. function setPlayersStatsIFattackerVehicle(HitPlayer, vehicle) local theAttacker = getVehicleOccupant(vehicle, 0) if (theAttacker) then setAccountData(getPlayerAccount(HitPlayer), "Deaths", getAccountData(getPlayerAccount(HitPlayer), "Deaths")+1) setAccountData(getPlayerAccount(theAttacker), "Kills", getAccountData(getPlayerAccount(theAttacker), "Kills")+1) takePlayerMoney(HitPlayer, 500) givePlayerMoney(theAttacker, 500) else setAccountData(getPlayerAccount(HitPlayer), "Deaths", getAccountData(getPlayerAccount(HitPlayer), "Deaths")+1) end end function quitPlayer() local playername = getPlayerName(source) destroyElement(blipPlayers[playername])--//Óäîëÿåì áëèï îáîçíà÷àþùèé ìåñòîïîëîæåíèå èãðîêà íà ðàäàðå. local theAccount = getPlayerAccount(source) setAccountData(theAccount, "money", getPlayerMoney(source)) end addEventHandler("onPlayerQuit", getRootElement(), quitPlayer) --//Áèíäèì êëàâèøó F4 function joinplayerBindkey() bindKey(source,"F4", "down", nextGang) end addEventHandler("onPlayerJoin",getRootElement(),joinplayerBindkey) --//F4 ñìåíà êîìàíäû. Ïîñëå ñìåðòè. function nextGang(player, key, keyState) if (getElementData(player,"F4") == false) or (not getElementData(player,"F4")) then outputChatBox("#CC0033[ÑÅÐÂÅÐ]: #339933Âû âêëþ÷èëè âûõîä â ìåíþ âûáîðà áàíäû, ïîñëå ñìåðòè.", player, 0, 0, 0,true) setElementData(player,"F4", true) elseif (getElementData(player,"F4") == true) then outputChatBox("#CC0033[ÑÅÐÂÅÐ]: #339933Âû âûêëþ÷èëè âûõîä â ìåíþ âûáîðà áàíäû, ïîñëå ñìåðòè.", player, 0, 0, 0,true) setElementData(player,"F4", false) end end function quitPlayer() local playername = getPlayerName(source) destroyElement(blipPlayers[playername])--//Óäîëÿåì áëèï îáîçíà÷àþùèé ìåñòîïîëîæåíèå èãðîêà íà ðàäàðå. local theAccount = getPlayerAccount(source) setAccountData(theAccount, "money", getPlayerMoney(source)) end addEventHandler("onPlayerQuit", getRootElement(), quitPlayer) --//Áèíäèì êëàâèøó F4 function joinplayerBindkey() bindKey(source,"F4", "down", nextGang) end addEventHandler("onPlayerJoin",getRootElement(),joinplayerBindkey)
-
DANG... you make it look so freakin easy.... nice skill man
-
My server suddenly shut off and it wont turn on anymore.
blurryshadow1 replied to blurryshadow1's question in Server
oh -
Need a jail timer script for my rpg server
blurryshadow1 replied to blurryshadow1's topic in Scripting
eh.... well i dont think theres a jail timer in that or anything cause the guy didnt seem to have any screenshots of being in jail.. but ill try it... -
My server suddenly shut off and it wont turn on anymore.
blurryshadow1 replied to blurryshadow1's question in Server
Remove it then, and you shouldn't experience those problems. hmmm.. it still works.... i just wonder why that section is there if we dont need to enter in anything on that part... and thanks -
My server suddenly shut off and it wont turn on anymore.
blurryshadow1 replied to blurryshadow1's question in Server
theres a value... its my computers ip adress -
My server suddenly shut off and it wont turn on anymore.
blurryshadow1 replied to blurryshadow1's question in Server
Because your router assigns you a dynamic IP What operating system are you using? What is your router brand/model? im using windows xp (hp pavillion dv2000) my router is a netgear router -
My server suddenly shut off and it wont turn on anymore.
blurryshadow1 replied to blurryshadow1's question in Server
how do you do that? -
im so noob at scripts... can anyone help me out on a jail timer?
-
it says "ERROR: could not start HTTP server on interface "(ip)" and port "(port number)"! server stopped! closing SQLite3 database can someone help me out please? all i was doing was playing on my server and it suddenly shut off and it wont start back on anymore... edit: nvm i found out my computers ip changed somehow.... why does it do that?