SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Closed Thread
 
Thread Tools Display Modes
Old 01/11/2010, 08:54 PM   #1
BlueG
Beta Tester
 
BlueG's Avatar
 
Join Date: Sep 2007
Location: Los Angeles, CA
Posts: 230
Reputation: 258
Default 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
BlueG is offline  
Old 02/11/2010, 12:14 AM   #2
willsuckformoney
High-roller
 
willsuckformoney's Avatar
 
Join Date: Dec 2009
Posts: 1,505
Reputation: 65
Default 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
-------------------------
__________________
Fuck the system.
willsuckformoney is offline  
Old 02/11/2010, 05:41 AM   #3
LarzI
High-roller
 
LarzI's Avatar
 
Join Date: Apr 2007
Location: Norway
Posts: 3,554
Reputation: 130
Default Re: Script Request Thread #5

Quote:
Originally Posted by willsuckformoney View Post
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
__________________


NEW: [FS] Simple Cellphones

if( strfind( title, "REP", true ) != -1 )
{________________________________________
Sigh();__________________________
}________________________________________



Last edited by LarzI; 02/11/2010 at 10:27 AM.
LarzI is offline  
Old 02/11/2010, 09:31 AM   #4
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 18,161
Reputation: 2540
Default Re: Script Request Thread #5

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?
Y_Less is online now  
Old 02/11/2010, 10:26 AM   #5
LarzI
High-roller
 
LarzI's Avatar
 
Join Date: Apr 2007
Location: Norway
Posts: 3,554
Reputation: 130
Default Re: Script Request Thread #5

Quote:
Originally Posted by Y_Less View Post
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 google'd it.
__________________


NEW: [FS] Simple Cellphones

if( strfind( title, "REP", true ) != -1 )
{________________________________________
Sigh();__________________________
}________________________________________


LarzI is offline  
Old 02/11/2010, 03:41 PM   #6
willsuckformoney
High-roller
 
willsuckformoney's Avatar
 
Join Date: Dec 2009
Posts: 1,505
Reputation: 65
Default Re: Script Request Thread #5

Will try later.
__________________
Fuck the system.
willsuckformoney is offline  
Old 02/11/2010, 07:32 PM   #7
WillyP
High-roller
 
WillyP's Avatar
 
Join Date: Jul 2010
Location: Durham, England
Posts: 2,232
Reputation: 63
Default Re: Script Request Thread #5

Quote:
Originally Posted by Brian_Furious View Post
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

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
WillyP is offline  
Old 03/11/2010, 02:34 AM   #8
Haydz
Gangsta
 
Haydz's Avatar
 
Join Date: Jul 2010
Location: New Zealand
Posts: 774
Reputation: 30
Default Re: Script Request Thread #5

Could sombody make me a timer that counts down from 10 mins above the players cash, thanks
__________________


HostName: Pilot's Life
Address: 162.243.250.233:7777
Max Players: 100
Mode: Pilot's Life
Map: San Andreas
Website: thepilotslife.com
Forums: thepilotslife.com/forums
Haydz is offline  
Old 03/11/2010, 05:30 AM   #9
Deal-or-die
Huge Clucker
 
Deal-or-die's Avatar
 
Join Date: Oct 2010
Location: An Island 1000's of miles away
Posts: 369
Reputation: 20
Talking 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.
__________________
/////////////////////////// | Mini Moot | \\\\\\\\\\\\\\\\\\\\\\\\\\\

"I'm in the country that basically invented the Internet, and your getting faster speeds on an island 1,000miles away"

Last edited by Deal-or-die; 03/11/2010 at 05:31 AM. Reason: if i could get this it would be GREAT, thanks. no, no no, it would be AWESOME!
Deal-or-die is offline  
Old 03/11/2010, 10:40 AM   #10
ThunD3r
Little Clucker
 
Join Date: Oct 2010
Posts: 2
Reputation: 3
Default 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
ThunD3r is offline  
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Script Request Thread #3 clean180ollie Help Archive 882 05/01/2010 05:08 PM
Script Request Thread #2 Dol Help Archive 807 28/07/2009 09:09 AM
Script Request Thread kaisersouse Help Archive 1112 20/03/2009 11:15 AM


All times are GMT. The time now is 09:43 AM.


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