Author Topic: How can I clear them?  (Read 2821 times)

0 Members and 1 Guest are viewing this topic.

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
How can I clear them?
« on: January 13, 2013, 10:35:32 am »
Example; you have lost %14 mana 28.00000000000000000000 and souls 11.00000000000000000000000
I want delete zeros, how?

Code is here; http://pastebin.com/MSwXM442


Bonecrusher: use pastebin.com when trying to post a code.
« Last Edit: January 13, 2013, 01:26:02 pm by Bonecrusher »
Is there anybody can write script?
Good, go and play soldat ^^

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: How can I clear them?
« Reply #1 on: January 13, 2013, 10:56:48 am »
Please edit your post and remove that code. Please attach the script to your post or use http://pastebin.com (or similar services to host your code).
As to stay on the topic this link may help you.
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: How can I clear them?
« Reply #2 on: January 13, 2013, 01:33:33 pm »
Please edit your post and remove that code. Please attach the script to your post or use http://pastebin.com (or similar services to host your code).
As to stay on the topic this link may help you.

I dont understand anything :S
What should I do?
Is there anybody can write script?
Good, go and play soldat ^^

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: How can I clear them?
« Reply #3 on: January 13, 2013, 02:49:03 pm »
Are you using beta or stable?
And if beta, then delphi or freepascal build?
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: How can I clear them?
« Reply #4 on: January 13, 2013, 04:40:30 pm »
No, I dont know use notepad+ or pascal etc..
Where should I correct in script, code is here, where is wrong?
Is there anybody can write script?
Good, go and play soldat ^^

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: How can I clear them?
« Reply #5 on: January 13, 2013, 05:17:06 pm »
I mean your server version.
Please paste (either in code tags or pastebin) the first 20 lines that server prints when starting
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: How can I clear them?
« Reply #6 on: January 14, 2013, 09:46:24 am »
pastebin blocked from my country, access is denied

soldat server 1.6.3-2.7.3
script core v.2.4 loaded. found 5 scripts!
other lines are normal writing
Is there anybody can write script?
Good, go and play soldat ^^

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: How can I clear them?
« Reply #7 on: January 14, 2013, 11:19:00 am »
Then please check whenever you have same problem with beta server.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: How can I clear them?
« Reply #8 on: January 14, 2013, 12:10:33 pm »
Ohh no, now, I dont download it, cause I dont want correct them, oohh long work needed :)
Thanks.
Is there anybody can write script?
Good, go and play soldat ^^

Offline rOy

  • Soldier
  • **
  • Posts: 120
Re: How can I clear them?
« Reply #9 on: January 16, 2013, 05:23:18 pm »
...Crap...
« Last Edit: January 18, 2013, 04:33:11 pm by rOy »

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: How can I clear them?
« Reply #10 on: January 17, 2013, 11:16:28 am »
Why can't people write properly?

--

RoundTo has been changed: it no longer removes trailing zeros (http://bugs.soldat.pl/view.php?id=15). To remove them, you must use a function that outputs a string. Luckily, Shoozza added formatfloat() to the 2.7.4 server. But if you don't want to wait, use this:

Code: [Select]
function formatfloat(input: single; digits: integer): string;
var intext: string;
begin
intext := floattostr(input);
result := getpiece(intext,'.',0) + '.' + copy(getpiece(intext,'.',1),1,digits);
end;
www.soldatx.com.br - The brazilian Soldat community.

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: How can I clear them?
« Reply #11 on: January 17, 2013, 12:57:18 pm »
How can I use it?
Where need to write? (in script, or where)
Is there anybody can write script?
Good, go and play soldat ^^

Offline rOy

  • Soldier
  • **
  • Posts: 120
Re: How can I clear them?
« Reply #12 on: January 18, 2013, 04:13:12 pm »
Hey

Nice Squiddy!

Btw here is fix ZRPG script (with Squiddy's fix)

Note: I not tested in game this script...

Good Luck [pigtail]
« Last Edit: January 18, 2013, 04:15:54 pm by rOy »

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: How can I clear them?
« Reply #13 on: January 21, 2013, 11:41:04 am »
No, I translated my script to Turkish.
I want squiddy fix, I want know how can I correct it.
Is there anybody can write script?
Good, go and play soldat ^^

Offline rOy

  • Soldier
  • **
  • Posts: 120
Re: How can I clear them?
« Reply #14 on: January 21, 2013, 07:07:03 pm »
No, I translated my script to Turkish.
I want squiddy fix, I want know how can I correct it.

Hey

Insert the script and I'll add the remaining element

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: How can I clear them?
« Reply #15 on: January 21, 2013, 07:09:57 pm »
Yeah, it would be a lot easier if you attached your current script :)
www.soldatx.com.br - The brazilian Soldat community.

Offline rOy

  • Soldier
  • **
  • Posts: 120
Re: How can I clear them?
« Reply #16 on: January 22, 2013, 09:58:28 am »
Hi
Missing you a lot

Code: [Select]
procedure UseSkill(ID: byte; SkillStrRaw: string);
var output: string; skill, curlvl: integer; oldmana,oldsouls: single; color: longint;
begin
skill := skillnumbyname(skillstrraw);
output := '';
color := $ffcc4444;
if skill >= 0 then begin
   curlvl := player[ID].skills[skill];
   if curlvl > 0 then begin
      if getplayerstat(ID,'alive') then begin
         if player[ID].mana >= skills[skill][curlvl].mcost then begin
            if player[ID].souls >= skills[skill][curlvl].scost then begin
               if player[ID].cooldown[skill] = 0 t

if player[ID].cooldown[skill] = 0 t ?

Script is not complete

Here is a complete + fix

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: How can I clear them?
« Reply #17 on: January 22, 2013, 10:02:56 am »
Attach it, not copy-paste it. It's terrible for reading :\
www.soldatx.com.br - The brazilian Soldat community.

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: How can I clear them?
« Reply #18 on: January 22, 2013, 10:38:43 am »
Script here;
Is there anybody can write script?
Good, go and play soldat ^^

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: How can I clear them?
« Reply #19 on: January 22, 2013, 12:20:34 pm »
This should fix all your problems. :)
www.soldatx.com.br - The brazilian Soldat community.

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: How can I clear them?
« Reply #20 on: January 22, 2013, 03:20:27 pm »
Yeah, it's working but not all.
It's writing again %0.00000000 when died.
Is there anybody can write script?
Good, go and play soldat ^^

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: How can I clear them?
« Reply #21 on: January 22, 2013, 11:32:18 pm »
Try this one then.
www.soldatx.com.br - The brazilian Soldat community.

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: How can I clear them?
« Reply #22 on: January 23, 2013, 05:52:22 am »
Ohh thanks a lot, it's working now, but always; I want learn how did you do it?
But so far, I didnt learn anything yet

Edit: Can you correct this script? (nextmap vote)
« Last Edit: January 23, 2013, 06:07:02 am by MrHamsTR »
Is there anybody can write script?
Good, go and play soldat ^^

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: How can I clear them?
« Reply #23 on: January 23, 2013, 02:23:19 pm »
Ohh thanks a lot, it's working now, but always; I want learn how did you do it?
But so far, I didnt learn anything yet
You did learn nothing because you know nothing about scripting, atleast from what I can see.

Here is my advice when you want to learn something:

If you want to learn some basics about scripts you should check this out: How to Write a Soldat Script

When you have gathered some basic knowledge you should go ahead and download (simple) scripts from the Scripting Releases section,

then try to understand them and learn from the code what you can do in which way.

It's important that you try out simple things, even when they are not useful for anyone, you will learn from it.

After you've gone through these steps you should be able to understand these bigger scripts like ZRPG from HackTank and be able to fix things by yourself.

This worked for me and probably for the most other people which have been writing soldat scripts in the past.

Edit: Can you correct this script? (nextmap vote)
First of all, you may do what I've said above.

After you have done that, you should try to fix the script by yourself.

When you have no success, give us some information about the errors when you start the server.

You will learn scripting better this way.
« Last Edit: January 23, 2013, 02:24:59 pm by Swompie »

Offline rOy

  • Soldier
  • **
  • Posts: 120
Re: How can I clear them?
« Reply #24 on: January 23, 2013, 04:56:39 pm »
Ohh thanks a lot, it's working now, but always; I want learn how did you do it?
But so far, I didnt learn anything yet

Edit: Can you correct this script? (nextmap vote)

Hey

Now I do not know what the problem is...
If it does not write % of what?
In that script missing (end time) - for vote
I've Nextmap script (from Squiddy) and en from idk who.

Offline squiddy

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 333
  • Flagger assassin
    • SoldatX
Re: How can I clear them?
« Reply #25 on: January 23, 2013, 05:01:30 pm »
Swompie said it all.
www.soldatx.com.br - The brazilian Soldat community.

Offline rOy

  • Soldier
  • **
  • Posts: 120
Re: How can I clear them?
« Reply #26 on: January 23, 2013, 05:42:38 pm »
Author: Mr.Squiddy
Core: 2.7.3 - server [1.6.3 soldat]
Translate: rOy

Code: [Select]
//Nextmap Voter Script, v1.2.0, by Squiddy ~ [BR]

const
color = $FF7F00; //cor a ser usada.
errorcolor = $FF0000; //cor dos erros.
voteperc = 65; //porcentagem necessária para mudar de mapa.

var
total, votetime: integer;
voting: boolean;
voted: array[1..32] of boolean;

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//go!

function getvotestat(converttostring: boolean): variant;
var int: integer;
begin
int := round(100 * total / ((numplayers - numbots) - spectators));
result := iif(converttostring,'Current ballot: '+inttostr(int)+'/'+inttostr(voteperc)+'%',int);
end;

procedure resetvotestats(resetids: boolean);
var s: byte;
begin
total := 0;
votetime := 0;
voting := false;
if resetids then for s := 1 to 32 do voted[s] := false;
end;

procedure addvoter(id: byte);
begin
voted[id] := true;
total := total + 1;
writeconsole(0,getvotestat(true),color);
votetime := 20;
if getvotestat(false) >= voteperc then begin
    resetvotestats(true);
    command('/nextmap');
    end;
end;

procedure removevoter(id: byte);
begin
if voted[id] then total := total - 1;
voted[id] := false;
votetime := 20;
end;

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

procedure activateserver();
begin
resetvotestats(true);
end;

procedure onplayerspeak(id: byte; text: string);
begin
text := lowercase(text);
if (text = '!nextmap') or (text = '!vote') or (text = '!nm') then begin
    if not voting then begin
        if getplayerstat(id,'team') <> 5 then begin
            voting := true;
            writeconsole(0,'The vote for the next map ('+nextmap+') started!',color);
            addvoter(id);
            end else writeconsole(id,'You can not vote as a spectator!',errorcolor);
        end else if not voted[id] then begin
        if getplayerstat(id,'team') <> 5 then addvoter(id) else writeconsole(id,'You can not vote as a spectator!',errorcolor);
        end else writeconsole(id,'You have already voted!',errorcolor);
    end;
end;

procedure apponidle(ticks: integer);
begin
if (((numplayers - numbots) - spectators) = 0) or (voting = false) then exit;
if getvotestat(false) < voteperc then begin
    if votetime > 0 then votetime := votetime - 1 else begin
        writeconsole(0,'The vote for the map "'+nextmap+'" ended '+inttostr(getvotestat(false))+'/'+inttostr(voteperc)+'%',errorcolor);
        resetvotestats(true);
        end;
    end;
end;

procedure onjoingame(id, team: byte);
begin
voted[id] := false;
end;

procedure onleavegame(id, team: byte; kicked: boolean);
begin
if voting then removevoter(id);
end;

procedure onmapchange(newmap: string);
begin
if voting then resetvotestats(true);
end;

DOWNLOAD:
« Last Edit: January 24, 2013, 05:19:29 am by rOy »

Offline MrHamsTR

  • Soldier
  • **
  • Posts: 209
  • One day, everything will end..
Re: How can I clear them?
« Reply #27 on: January 24, 2013, 02:14:41 am »
No, nextmap has same problem that %0.00000000.
Is there anybody can write script?
Good, go and play soldat ^^