SA-MP Forums Archive
[FilterScript] Trampoline - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Trampoline (/showthread.php?tid=201021)

Pages: 1 2


Trampoline - VonKnox - 20.12.2010

[*****TRAMPOLINE*****]

Ok so this is the first thing I'm releasing here, this was one of my first scripts.

I'm not sure what you'd use this for but have fun with it, might be fun to see on a roleplay server or something.

Usage
1. Use "/trampoline" to spawn a trampoline infront of you.
2. Get on and have fun!

Pictures:

(Might add a short video if demand is high)










DOWNLOAD/INSTALL
To install simply paste both the AMX and PWN into your "filterscripts" folder inside your SA-MP server directory. Update your filsterscripts line in your server.cfg to include this filterscript on server start-up (or load it manually with the RCON command while in your server).

Trampoline should work for all players now, fixed (thanks to Hiddos)

Pastebin
AMX
PWN

Note: I will upload it to other places too, just let me know where you want it (as long as I don't have to pay for it or make stupid accounts to upload).

Feel free to post any suggestions for improvements.

- VonKnox


Re: Trampoline - Rokzlive - 20.12.2010

LOL AWESOME!


Re: Trampoline - Steven82 - 20.12.2010

LOL Nice i guess


Re: Trampoline - Gavibro - 20.12.2010

Nice but timer make a small lag..You can make when player press SHIFT to jump(shortcut to that function ).
And it work just for a player.And,to call a function with parameters with a timer,you need to use SetTimerEx ( SetTimerEx("Bounce",750,true,"i",playerid); ).Will look something like this: http://pastebin.com/WKk37PXv


Re: Trampoline - willsuckformoney - 20.12.2010

Quote:
Originally Posted by Rokzlive
Посмотреть сообщение
LOL AWESOME!
- Enough Said.


Re: Trampoline - VonKnox - 20.12.2010

Quote:
Originally Posted by Steven82
Посмотреть сообщение
LOL Nice i guess
Quote:
Originally Posted by Rokzlive
Посмотреть сообщение
LOL AWESOME!
Thanks.


Quote:
Originally Posted by Gavibro
Посмотреть сообщение
Nice but timer make a small lag..You can make when player press SHIFT to jump(shortcut to that function ).
And it work just for a player.And,to call a function with parameters with a timer,you need to use SetTimerEx ( SetTimerEx("Bounce",750,true,"i",playerid); ).Will look something like this: http://pastebin.com/WKk37PXv
Does this script work fine or is the lag created by the timer the only problem? I'm not sure what you mean with the SetTimerEx function and personally I prefer it so it automatically makes you jump, however I can release different versions using OnPlayerKeyStateChange if people prefer that...


Re: Trampoline - Lorenc_ - 20.12.2010

This is so cool! Nice release.


Re: Trampoline - ExeC - 20.12.2010

Great idea mate, it's really cool.


Re: Trampoline - Fool - 20.12.2010

At the time of scripting this you really wanted a trampoline, rofl.
AWESOME! good job.


Re: Trampoline - VonKnox - 20.12.2010

Quote:
Originally Posted by Porsche911
Посмотреть сообщение
At the time of scripting this you really wanted a trampoline, rofl.
AWESOME! good job.
Ahah as I said this was one of my first scripts - It didn't take very long to make, really.


Thanks for all the positive feedback, feel free to post any suggestions on what I can do to make it better in the future - if there is even anything..


Re: Trampoline - MestreKiller - 20.12.2010

video please?


Re: Trampoline - X35B - 20.12.2010

This would be a good demonstration of a trompoline for your mum to know what a trampoline actually is for your christmas present.


Re: Trampoline - Hiddos - 20.12.2010

Nice, however this code isn't going to work:

pawn Код:
public OnFilterScriptInit()
{
  SetTimer("Bounce", 750, true);
  return 1;
}

forward Bounce(playerid);
public Bounce(playerid)
{
        new Float:x, Float:y, Float:z;
        GetObjectPos(trampoline, x, y, z);
        if(IsPlayerInRangeOfPoint(playerid, 2.25, x, y, z+2.0))
        {
        SetPlayerVelocity(playerid, 0.0, 0.0, 0.5);
        }
}
playerid will always be '0' as no values are entered. This of course worked during testing as you were ID 0, but for others this will not work.

You need to use a loop:

pawn Код:
forward Bounce();
public Bounce()
{
    new Float:x, Float:y, Float:z;
    GetObjectPos(trampoline, x, y, z);
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 2.25, x, y, z+2.0))
        {
          SetPlayerVelocity(i, 0.0, 0.0, 0.5);
        }
    }
}



Re: Trampoline - VonKnox - 20.12.2010

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
Nice, however this code isn't going to work:

pawn Код:
public OnFilterScriptInit()
{
  SetTimer("Bounce", 750, true);
  return 1;
}

forward Bounce(playerid);
public Bounce(playerid)
{
        new Float:x, Float:y, Float:z;
        GetObjectPos(trampoline, x, y, z);
        if(IsPlayerInRangeOfPoint(playerid, 2.25, x, y, z+2.0))
        {
        SetPlayerVelocity(playerid, 0.0, 0.0, 0.5);
        }
}
playerid will always be '0' as no values are entered. This of course worked during testing as you were ID 0, but for others this will not work.

You need to use a loop:

pawn Код:
forward Bounce();
public Bounce()
{
    new Float:x, Float:y, Float:z;
    GetObjectPos(trampoline, x, y, z);
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i, 2.25, x, y, z+2.0))
        {
          SetPlayerVelocity(i, 0.0, 0.0, 0.5);
        }
    }
}
Thanks I will fix this and re-upload it ASAP.

EDIT: Re-uploaded it all, it's fixed now. Thanks Hiddos.


Re: Trampoline - schillow - 20.12.2010

haha that's funny


Re: Trampoline - Den_Deluxe - 20.12.2010

haha nice job


Re: Trampoline - =Ebrala= - 20.12.2010

Excellent ! ! !


Re: Trampoline - WillyP - 20.12.2010

Awesome :P


Re: Trampoline - MrDeath537 - 20.12.2010

LOL, nice xD


Re: Trampoline - Noss* - 21.12.2010

Lol xD I'm trying it now Good Job

EDIT:I think you should add a command to remove the trampoline