Results 1 to 10 of 599

Thread: SAPP

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    suum cuique sehe's Avatar
    Join Date
    Aug 2011
    Location
    Hungary
    Posts
    217

    Re: SAPP

    Well yesterday I was working on this till 3am but I think it worth it in the end... You will be able to add 2*3 types of variables, string, int, float both for global and player. They are working just like the generic sapp variables.
    var_add <name> <type>, where type 0 - global string, 1 - global int, 2 - global float, 3 - player string, 4 - player int, 5 - player float

    Some bad examples for usage for globals:
    var_add time 1
    var_add min 1
    var_add sec 1

    events.txt:
    event_start 'var_set time 0'
    commands.txt:
    timeloop 'w8 1;var_set time +1;timeloop'
    time 'var_set min $time;var_set min /60;var_set sec $time; var_set sec `;say $n "Current game is running since $min minutes and $sec seconds!"' -1
    init.txt:
    timeloop


    and for player:
    var_add warnings 4
    events.txt:
    event_tk 'var_set warnings +1 $n;cevent warn'
    event_custom $ename:warn $warnings=3 'say $n "One more warn and you will be kicked, $name!"'
    event_custom $ename:warn $warnings=4 'k $n "Too many warnings."'
    commands.txt:
    warn #n 'var_set warnings +1 #n;say #n "You got a warning from admin $name!";cevent warn #n' 3

    A bit hacky but works fine, the rest is up to your fantasy... :P


    edit 2:
    Is it possible to make commands like assists accept a float? Not that I want to display a decimal in the scoreboard, but if I were insane enough to try and show somebody's health * 100 and rounded for instanc
    Crazy and cool idea, but it's not possible atm, I will might add a converting function tho for custom variables.
    Last edited by sehe; May 10th, 2014 at 08:47 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •