|
CA.Berettonawak
|
 |
« on: January 14, 2009, 06:59:28 PM » |
|
est_getkills est_getdeaths es_math 
|
|
|
|
|
Logged
|
Beret, keep yourself focusing on 1 project. Be sure to memorize that down since it sounds good. i love tuna juice  =CA= Pietro: back =CA= Pietro: sorry, was downstair sharing my chocolate with my cat =CA= Pietro: you should see his face when he ate it xD =CA= Berettonawak: just because you don't have hope doesn't mean we're doomed
|
|
|
[kmz]kamikaze
Level 1 Trained Beginner
Offline
Sweden
Posts: 30
|
 |
« Reply #1 on: January 25, 2009, 05:33:35 PM » |
|
Okey so I actually tried doing this little KDR thingy but when you have 0 deaths it wont tell you the KDR since it apperantly can't divide by 0.... any could help me out just a little? I kind of suck at coding  This works when the play died once or more GeSHi (eventscripts): es_xset temp 0;es_xset temp2 0;es est_GetKills temp event_var(userid);es est_GetDeaths temp2 event_var(userid);es_math temp / server_var(temp2);es_tell event_var(userid) Your KDR is: server_var(temp);if (server_var(temp) >= 4) then es_xdelayed 1 wcs_givexp event_var(userid) 100 0 1
This is the what it says when you got 0 deaths and 1 kill --> Your KDR is : 1.#INF00
|
|
|
|
« Last Edit: January 25, 2009, 05:47:59 PM by [kmz]kamikaze »
|
Logged
|
|
|
|
[kmz]kamikaze
Level 1 Trained Beginner
Offline
Sweden
Posts: 30
|
 |
« Reply #2 on: January 29, 2009, 02:30:01 PM » |
|
BUMP
Anyone???
|
|
|
|
|
Logged
|
|
|
|
|
Maxxi
|
 |
« Reply #3 on: January 29, 2009, 03:00:35 PM » |
|
BUMP
Anyone???
use rounddecimal with a 2 then you should get 1.00
|
|
|
|
|
Logged
|
|
|
|
|
Maxxi
|
 |
« Reply #4 on: January 29, 2009, 07:29:26 PM » |
|
stop hijacking his topic make ur own !
its still the same question 
|
|
|
|
|
Logged
|
|
|
|
|
Rasmus
|
 |
« Reply #5 on: January 29, 2009, 07:48:08 PM » |
|
est_getkills est_getdeaths es_math  just one problem  if kills or deaths are less than 1 then it will give you 0 as kdr  you might want a check for a specific amount of kills and/or deaths (like mani where you can set it to start giving rank after e.g. 10 kills)
|
|
|
|
|
Logged
|
where would you put the comma in the following telegram from a wife, to her husband in the navy? "Not getting any better hurry home!"
|
|
|
|
CA.Berettonawak
|
 |
« Reply #6 on: May 22, 2009, 02:37:09 PM » |
|
then use ifx true www.eventscripts.com/pages/IfxIfx true will only run the code if var != 0  so ifx true(deaths) do { es_math kills / deaths } 
|
|
|
|
|
Logged
|
Beret, keep yourself focusing on 1 project. Be sure to memorize that down since it sounds good. i love tuna juice  =CA= Pietro: back =CA= Pietro: sorry, was downstair sharing my chocolate with my cat =CA= Pietro: you should see his face when he ate it xD =CA= Berettonawak: just because you don't have hope doesn't mean we're doomed
|
|
|
[kmz]kamikaze
Level 1 Trained Beginner
Offline
Sweden
Posts: 30
|
 |
« Reply #7 on: May 23, 2009, 03:54:55 PM » |
|
Sry but im quite not following you :S like I said its been awhile =) could you please put it in the code I made? would really appreciate it, Ive tried alot of different things... I tried that ifx true(deaths) != 0 do es_xdelayed 1 es est_cash event_var(userid) + 10000 but that didnt really help :S Im probably doing it wrong but im not really that good at coding, in always learning a little bit at the time
|
|
|
|
|
Logged
|
|
|
|
[kmz]kamikaze
Level 1 Trained Beginner
Offline
Sweden
Posts: 30
|
 |
« Reply #8 on: May 23, 2009, 05:16:13 PM » |
|
uhm not really  cause that cant be done  well basicly somekind of workaround so it can count the KDR even if deaths are 0... so if you got 5 kills and 0 deaths it should say your KDR is 5... its really complicated but it shouldnt be impossible cause I think its been done on all ranking systems like mani_admins rank and so on Im trying to reach out to the eventscripts forums aswell :S NEVERMIND I FOUND THE SOLUTION  es_setinfo temp 0;es_setinfo temp2 0;es est_GetKills temp event_var(userid);es est_GetDeaths temp2 event_var(userid);es_math
temp / server_var(temp2) if server_var(temp2) == 0 then es_math temp / 1;es_tell event_var(userid) Your KDR is: server_var(temp);if
(server_var(temp) >= 4) then es_xdelayed 1 wcs_givexp event_var(userid) 100 0 1;if (server_var(temp) <= 3.9) then es_xdelayed 1 es est_cash
event_var(userid) + 10000 NOW ENJOY
|
|
|
|
« Last Edit: May 23, 2009, 05:31:34 PM by [kmz]kamikaze »
|
Logged
|
|
|
|
Stinkyfax
I <3 WCS
Level 7 Expert
   
Offline
United Kingdom
Posts: 1890
 XrushiovmyServer 84.55.62.45:27016(Warning: click connects through Steam)
|
 |
« Reply #9 on: May 23, 2009, 05:37:11 PM » |
|
uhm not really  cause that cant be done  well basicly somekind of workaround so it can count the KDR even if deaths are 0... so if you got 5 kills and 0 deaths it should say your KDR is 5... its really complicated but it shouldnt be impossible cause I think its been done on all ranking systems like mani_admins rank and so on Im trying to reach out to the eventscripts forums aswell :S NEVERMIND I FOUND THE SOLUTION  es_setinfo temp 0;es_setinfo temp2 0;es est_GetKills temp event_var(userid);es est_GetDeaths temp2 event_var(userid);es_math
temp / server_var(temp2) if server_var(temp2) == 0 then es_math temp / 1;es_tell event_var(userid) Your KDR is: server_var(temp);if
(server_var(temp) >= 4) then es_xdelayed 1 wcs_givexp event_var(userid) 100 0 1;if (server_var(temp) <= 3.9) then es_xdelayed 1 es est_cash
event_var(userid) + 10000 NOW ENJOY try: if( server_var(temp2) == 0) then temp2 = 1; ....
|
|
|
|
|
Logged
|
|
|
|
|
CA.Berettonawak
|
 |
« Reply #10 on: May 24, 2009, 09:26:06 AM » |
|
Actually none of that works... if I make temp2 = 1 then its staying as 1 forever.... so it will never get the deaths afterwards
I tried so many different ways but it doesnt count the KDR if I add more then 1 es_math it just takes the server_var(temp) which is set as kills... Ive tried like 50 ways with IF
I thought I had it done but I didnt completly test it I suppose... just saw it said your kdr is 0 which made me jump of joy lol...
Anyone got any ideas?
Show whole code when you say something doesn't work 
|
|
|
|
|
Logged
|
Beret, keep yourself focusing on 1 project. Be sure to memorize that down since it sounds good. i love tuna juice  =CA= Pietro: back =CA= Pietro: sorry, was downstair sharing my chocolate with my cat =CA= Pietro: you should see his face when he ate it xD =CA= Berettonawak: just because you don't have hope doesn't mean we're doomed
|
|
|
[kmz]kamikaze
Level 1 Trained Beginner
Offline
Sweden
Posts: 30
|
 |
« Reply #11 on: May 24, 2009, 03:00:35 PM » |
|
es_setinfo temp 0;es_setinfo temp2 0;es est_GetKills temp event_var(userid);es est_GetDeaths temp2 event_var(userid);es_math
temp / server_var(temp2) if server_var(temp2) == 0 then es_math temp / 1;es_tell event_var(userid) Your KDR is: server_var(temp);if
(server_var(temp) >= 4) then es_xdelayed 1 wcs_givexp event_var(userid) 100 0 1;if (server_var(temp) <= 3.9) then es_xdelayed 1 es est_cash
event_var(userid) + 10000 Maybe it would be easier to make it to an block instead  yeah I know its not impossible but I've run out of ideas... sat up from 00.00 to 06.00 this morning.. I could of easily just failed with 1 small thing.. and im not really that great on coding like you guys, im a real beginner thats why im trying so hard to learn all the time but then I just hit the roadblocks like this 
|
|
|
|
|
Logged
|
|
|
|
|
CA.Berettonawak
|
 |
« Reply #12 on: May 24, 2009, 07:13:10 PM » |
|
es_setinfo temp 0;es_setinfo temp2 0;es est_GetKills temp event_var(userid);es est_GetDeaths temp2 event_var(userid);es_math
temp / server_var(temp2) if server_var(temp2) == 0 then es_math temp / 1;es_tell event_var(userid) Your KDR is: server_var(temp);if
(server_var(temp) >= 4) then es_xdelayed 1 wcs_givexp event_var(userid) 100 0 1;if (server_var(temp) <= 3.9) then es_xdelayed 1 es est_cash
event_var(userid) + 10000 Maybe it would be easier to make it to an block instead  yeah I know its not impossible but I've run out of ideas... sat up from 00.00 to 06.00 this morning.. I could of easily just failed with 1 small thing.. and im not really that great on coding like you guys, im a real beginner thats why im trying so hard to learn all the time but then I just hit the roadblocks like this  how could THAT work? use that es est_GetKills wcs_tmp event_var(userid);es est_GetDeaths wcs_tmp1 event_var(userid);if (server_var(wcs_tmp1) != 0) then es_xmath temp / server_var(temp2);es_tell event_var(userid) Your KDR is: server_var(wcs_tmp);if (server_var(wcs_tmp) >= 4) then es_xdelayed 1 wcs_givexp event_var(userid) 100 0 1;if (server_var(wcs_tmp) <= 3.9) then es_xdelayed 1 es est_cash event_var(userid) + 10000
|
|
|
|
|
Logged
|
Beret, keep yourself focusing on 1 project. Be sure to memorize that down since it sounds good. i love tuna juice  =CA= Pietro: back =CA= Pietro: sorry, was downstair sharing my chocolate with my cat =CA= Pietro: you should see his face when he ate it xD =CA= Berettonawak: just because you don't have hope doesn't mean we're doomed
|
|
|
[kmz]kamikaze
Level 1 Trained Beginner
Offline
Sweden
Posts: 30
|
 |
« Reply #13 on: May 24, 2009, 08:11:21 PM » |
|
es est_GetKills wcs_tmp event_var(userid);es est_GetDeaths wcs_tmp1 event_var(userid);if (server_var(wcs_tmp1) != 0) then es_xmath wcs_tmp / server_var(wcs_tmp1);es_tell event_var(userid) Your KDR is: server_var(wcs_tmp);if (server_var(wcs_tmp) >= 4) then es_xdelayed 1 wcs_givexp event_var(userid) 100 0 1;if (server_var(wcs_tmp) <= 3.9) then es_xdelayed 1 es est_cash event_var(userid) + 10000 This doesnt really work either... still says that error when 0 deaths but if u have 0kills and 0deaths then it says KDR is: -
|
|
|
|
|
Logged
|
|
|
|
|
CA.Berettonawak
|
 |
« Reply #14 on: May 25, 2009, 09:13:37 AM » |
|
Haha  Sorry, didn't really read what i wrote... use this: es est_GetKills wcs_tmp event_var(userid);es est_GetDeaths wcs_tmp1 event_var(userid);if (server_var(wcs_tmp1) != 0) then es_xmath wcs_tmp / server_var(wcs_tmp2);es_tell event_var(userid) Your KDR is: server_var(wcs_tmp);if (server_var(wcs_tmp) >= 4) then es_xdelayed 1 wcs_givexp event_var(userid) 100 0 1;if (server_var(wcs_tmp) <= 3.9) then es_xdelayed 1 es est_cash event_var(userid) + 10000
|
|
|
|
|
Logged
|
Beret, keep yourself focusing on 1 project. Be sure to memorize that down since it sounds good. i love tuna juice  =CA= Pietro: back =CA= Pietro: sorry, was downstair sharing my chocolate with my cat =CA= Pietro: you should see his face when he ate it xD =CA= Berettonawak: just because you don't have hope doesn't mean we're doomed
|
|
|
|