SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   Script Request Thread #5 (https://forum.sa-mp.com/showthread.php?t=187229)

BlueG 01/11/2010 08:54 PM

Script Request Thread #5
 
The 4th script request thread was getting too full, therefore I decided to open a new one.

This thread is for people to post gamemode and filterscript ideas, in an effort to find people willing to help them make it. Please keep all requests to this thread, and do NOT flame or bump!


Script request archive:

Script Request Thread #4

Script Request Thread #3

Script Request Thread #2

Script Request Thread #1

willsuckformoney 02/11/2010 12:14 AM

Re: Script Request Thread #5
 
5 already, spammers! Wonder is someone can make like updating textdraw for distance ran like this kinda....


Code:

Distance Ran:
-------------------------
|          |            |        Orange for where your at now
-------------------------


LarzI 02/11/2010 05:41 AM

Re: Script Request Thread #5
 
Quote:

Originally Posted by willsuckformoney (Post 895000)
5 already, spammers! Wonder is someone can make like updating textdraw for distance ran like this kinda....


Code:

Distance Ran:
-------------------------
|          |            |        Orange for where your at now
-------------------------


5 topics in 2-3 years isn't too bad...

About your question: It should be pretty simple actually.
All you need is an updating timer (or OnPlayerUpdate) to get the player's distance to the point, then take the percent of that distance, and update the textdraw each percent (or each 5th percent, 10th etc..)

So let's say the distance is 100 yards (easiest example)
You run 10 yards, and that spot for where are you now moves one "spot" to the right.

You could use GetPlayerDistanceToPoint to make this work easily.
pawn Code:
stock Float:GetPlayerDistanceToPoint(playerid, Float:x, Float:y, Float:z)
{
    new
        Float:pX,
        Float:pY,
        Float:pZ;

    GetPlayerPos(playerid, px, py, pz);
    return floatsqroot(( floatpower( x-pX, 2 ) + floatpower( y-pY, 2 )) + floatpower( z-pZ, 2 ));
}

Just get the percent of the distance.

pawn Code:
new iPercent = (( floatround( GetPlayerDistanceToPoint( playerid, x, y, z )) / distance_to_destination ) * 100 );

Then do as I said, update it every percent, every 5th percent, every 10th percent... Anything that will fit you well.

pawn Code:
if( iPercent > 9 && iPercent < 20 )
{
    //update
}
else if( iPercent > 19 && iPercent < 30 )
//continue

LarzI 02/11/2010 10:26 AM

Re: Script Request Thread #5
 
Quote:

Originally Posted by ****** (Post 895235)
There are also libraries specifically designed for making progress meters, it shouldn't be hard to use those.

And LarzI: How many times have I told you about floatsqroot?

Lots of times, but I always forget.
And I just copied the function from somewhere, just ******'d it.

willsuckformoney 02/11/2010 03:41 PM

Re: Script Request Thread #5
 
Will try later.

WillyP 02/11/2010 07:32 PM

Re: Script Request Thread #5
 
Quote:

Originally Posted by Brian_Furious (Post 895744)
It wasnt too full...Click Here The Script Request Thread #5 is already exits

Yeah, but a normal user made it, when BETA Testers or Moderators make it, people reply more :P

+ 800th post :D:D

This forum requires that you wait 120 seconds between posts. Please try again in 20 seconds.

Edit: Um, It wasn't my 800th post, even though before I posted this, I only had 799 posts, I posted here and I posted somewhere else but It's still only 800; nevermind :p

Haydz 03/11/2010 02:34 AM

Re: Script Request Thread #5
 
Could sombody make me a timer that counts down from 10 mins above the players cash, thanks

Deal-or-die 03/11/2010 05:30 AM

Re: Script Request Thread #5
 
i need a script that enables cops to cuff a player but, that player can still run but not sprint nor drive/ride i have asked people and most say 'yes, its possible"? if i could get this it would be AWESOME!, thanks.

ThunD3r 03/11/2010 10:40 AM

Re: Script Request Thread #5
 
Hi , i`m searching for a script that can make a new job , Prison Guard ,
i want that job to have some commands:
/on ( Makes the player on duty and teleports him at the prison )
/off ( Makes the player off duty and teleports him to his house / normal spawn place )
/Weapons ( Only when he`s on duty : gives him a sniper and a M4a1 )
/Alert [playername/id] ( Announces the server that a prissoner has escaped )
And also if possible , at payday , depending on how many minutes he guarded the prison to get a amount of money
10 minutes = 10.000 $
20 minutes = 20.000 $
30 minutes = 40.000 $
50 minutes = 50.000 $
If possible please help me please :( Thank You

willsuckformoney 03/11/2010 11:11 PM

Re: Script Request Thread #5
 
LarzI that just crashed my pawno.


All times are GMT. The time now is 04:15 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.