Scripts / Extra life issues

Author
Message
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 18th Oct 2016 16:27 Edited at: 18th Oct 2016 17:24
LOL well here we go im trying to add an extra life after so many kills that parts working fine the lives bit isnt :/ its adding 470 odd lives not 1 ive tried

SetPlayerLives(e,g_PlayerLives+1) and then after it gave me half a million i tried to set the lives to a number using

SetPlayerLives(e,5) and that did pretty much the same. can anyone tell me whats wrong here plz?

i could add it to an entity when you kill a boss but i kinda liked the idea of a kill count reward

Edit: ok found a workaround in the global you dont need the e in SetPlayerLives(e,5)
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 18th Oct 2016 18:01 Edited at: 18th Oct 2016 18:03
Get rid of the e. It's SetPlayerLives(v) so if you wanted to add one it should be SetPlayerLives(g_PlayerLives+1) i think

i5, NV960 2GB, 16GB memory, 2x 2TB Hybrid, Win10.
i3 , Intel integrated graphics, 6GB memory, 512GB Generic SATAIII Win8.1.
Intel Celeron (duel Core), Radeon integrated graphics, 4GB memory, 180gB Generic SATAII, WinVista.
Q6600, Intel integrated graphics, 8GB memory, 512GB Generic SATAII, Win7.
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 18th Oct 2016 19:40
lol well it did add 1 then another one etc etc lol would end up with about a million so k m8 i have just set it to s specified number and that seems to work fine
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on
AuShadow
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 18th Oct 2016 21:04 Edited at: 18th Oct 2016 21:06
If you don't tell it to stop then it won't and would keep going you need to have something to make it run once like

If kills <= 10 and killreward == 0 then
setplayerlives(g_playerlives + 1)
killreward = 1
end

This will make sure it only runs the setplayerlives command once and doesn't repeat by using the variable killreward.

NOTE: there will be errors in that above as I typed it on my phone so dont copy paste Into a script
PC Specs: Windows 10 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz
Honkeyboy
3D Media Maker
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: Doesnt know half the time ;)
Posted: 20th Oct 2016 19:27
Thanks AuShadow
Intel i5 4950 Quad core 3.3ghz AMD FX 6300 x6 cores 3.5ghz(unclocked)
8gb Ram 8gb Ram
AMD Radeon 7570 1gb AMD Radeon HD 6670 2gb
and a well fed mouse on a wheel

I only smile because i have absolutely no idea whats going on

Login to post a reply

Server time is: 2024-04-30 17:06:22
Your offset time is: 2024-04-30 17:06:22