SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 16/06/2011, 11:31 AM   #1
Lenny the Cup
Huge Clucker
 
Join Date: Jan 2008
Posts: 232
Reputation: 16
Default Dynamic race system (Can also be used for missions!)

Hello!

I've decided to release my race system, so here you go I haven't been testing it for a long time though, so feel free to leave any suggestions
  • Requirements
You will need the following plugins/includes to use this script:
  • Usage
I have made it simple to use with any command processor by making functions that you can call in your commands like so:
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[ ])
{
    if(!strcmp(cmdtext, "/mycommandhere"))
    {
        return LR_CMD_RACECARS(playerid);
    }
}
Or (Depending on your command processor)
pawn Code:
CMD:mycommandhere(playerid, params[])
{
    return LR_CMD_RACECARS(playerid);
}
  • Callbacks
I will put these into two different categories, one named base and one named optional. Base means they're required to be called in the script for the thing to work, optional means they can be used if you want them.
  • Base
  • LR_LoadRaces() - Has to be called OnGameModeInit
  • LR_OnPlayerEnterRaceCheckpoint(playerid)
  • LR_OnDialogResponse(playerid, dialogid, response, listitem)
  • Optional
  • IsVehicleAllowedInRace(model, raceid)
  • LR_CMD_ADDRACE(playerid, params[])
  • LR_CMD_ADDCHECKPOINT(playerid, params[])
  • LR_CMD_LOADRACEFORALL(playerid)
  • LR_CMD_LOADRACEFORPLAYER(playerid)
  • LR_CMD_JOINRACE(playerid)
  • LR_CMD_LEAVERACE(playerid)
  • LR_CMD_READY(playerid)
  • LR_CMD_READYALL()
  • LR_CMD_RACECARS(playerid)
  • Download
Include
SQL schema
__________________
Lenny / Lenny Carlson @ LS-RP.com
My pastebin - All my released scripts
pawn Code:
-,-----,
/----/ |                                           ,---,   ,----,
|    | |      ,------, ,----,  ,----, ,----,  ,---/---/ \ /---/ |
|    | |     /-----/ |/----/ \/---/ |/----/ \/--- \   \  /   / /
|    | |     |  ,__|/ |     \|    | ||     \|    | \   \/   / /
|    | |____ |  ---,/||      \    | ||      \    | |\      / /
|    |____/ ||  ,__|/ |   ^\      | ||   ^\      | | |    | |
|         | ||  ---,/||   | \     | /|   | \     | | |    | |
|_________|/ |_____|/ |___,/ \____,/ |___,/ \____,/  |____,/

Last edited by Lenny the Cup; 16/06/2011 at 04:18 PM.
Lenny the Cup is offline   Reply With Quote
Old 16/06/2011, 11:36 AM   #2
Phanto90
Huge Clucker
 
Phanto90's Avatar
 
Join Date: Mar 2011
Location: Milan, Italy
Posts: 352
Reputation: 31
Default Re: Dynamic race system (Can also be used for missions!)

Nice althought i don't suggest to use mysql for a race system, especially to store checkpoint coords (there are also users that cannot administrate their own database, or simply don't want)
Maybe create another version that stores coords simply in a txt files
Anyway nice job
__________________


Latest Releases
FilterscriptsIncludesMaps
PRaceSystem v1.3 PBlock v1.1Electronic Shop
PVotekick v1.1PInventory v1.1
________________________
I don't script for money, stop asking for it.

Phanto90 is offline   Reply With Quote
Old 16/06/2011, 11:43 AM   #3
Lenny the Cup
Huge Clucker
 
Join Date: Jan 2008
Posts: 232
Reputation: 16
Default Re: Dynamic race system (Can also be used for missions!)

Yes, I might add a define and work with textfiles if this turns out to be popular, I only put it here to share though since I don't mind it being used outside my private server
__________________
Lenny / Lenny Carlson @ LS-RP.com
My pastebin - All my released scripts
pawn Code:
-,-----,
/----/ |                                           ,---,   ,----,
|    | |      ,------, ,----,  ,----, ,----,  ,---/---/ \ /---/ |
|    | |     /-----/ |/----/ \/---/ |/----/ \/--- \   \  /   / /
|    | |     |  ,__|/ |     \|    | ||     \|    | \   \/   / /
|    | |____ |  ---,/||      \    | ||      \    | |\      / /
|    |____/ ||  ,__|/ |   ^\      | ||   ^\      | | |    | |
|         | ||  ---,/||   | \     | /|   | \     | | |    | |
|_________|/ |_____|/ |___,/ \____,/ |___,/ \____,/  |____,/
Lenny the Cup is offline   Reply With Quote
Old 16/06/2011, 12:34 PM   #4
Basicz
Gangsta
 
Basicz's Avatar
 
Join Date: Aug 2010
Location: Indonesia, Surabaya.
Posts: 630
Reputation: 33
Default Re: Dynamic race system (Can also be used for missions!)

Looking very nice!
But can you make it on a normal text file, without MYSQL?
Btw, how to make a beautiful ASCII text like that!

Quote:
Originally Posted by Pantho90
(there are also users that cannot administrate their own database, or simply don't want)
^
|
|
Basicz is offline   Reply With Quote
Old 16/06/2011, 12:55 PM   #5
Lenny the Cup
Huge Clucker
 
Join Date: Jan 2008
Posts: 232
Reputation: 16
Default Re: Dynamic race system (Can also be used for missions!)

I used phpMyAdmin to export the tables
__________________
Lenny / Lenny Carlson @ LS-RP.com
My pastebin - All my released scripts
pawn Code:
-,-----,
/----/ |                                           ,---,   ,----,
|    | |      ,------, ,----,  ,----, ,----,  ,---/---/ \ /---/ |
|    | |     /-----/ |/----/ \/---/ |/----/ \/--- \   \  /   / /
|    | |     |  ,__|/ |     \|    | ||     \|    | \   \/   / /
|    | |____ |  ---,/||      \    | ||      \    | |\      / /
|    |____/ ||  ,__|/ |   ^\      | ||   ^\      | | |    | |
|         | ||  ---,/||   | \     | /|   | \     | | |    | |
|_________|/ |_____|/ |___,/ \____,/ |___,/ \____,/  |____,/
Lenny the Cup is offline   Reply With Quote
Old 16/06/2011, 10:43 PM   #6
Resort
Little Clucker
 
Join Date: Jun 2011
Posts: 15
Reputation: 0
Default Re: Dynamic race system (Can also be used for missions!)

Thanks for the release. =]
Resort is offline   Reply With Quote
Old 16/06/2011, 10:50 PM   #7
Donya
Gangsta
 
Join Date: Mar 2011
Posts: 798
Reputation: 31
Default Re: Dynamic race system (Can also be used for missions!)

Quote:
Originally Posted by Phanto90 View Post
Nice althought i don't suggest to use mysql for a race system, especially to store checkpoint coords (there are also users that cannot administrate their own database, or simply don't want)
Maybe create another version that stores coords simply in a txt files
Anyway nice job
i dont see why, mysql was made to store thousands of rows?

i have a 360,000 row table. it takes like 75 ms to select from it, nothing to much.

anyways, got any videos :P?
Donya is offline   Reply With Quote
Old 16/06/2011, 11:17 PM   #8
Phanto90
Huge Clucker
 
Phanto90's Avatar
 
Join Date: Mar 2011
Location: Milan, Italy
Posts: 352
Reputation: 31
Default Re: Dynamic race system (Can also be used for missions!)

Quote:
Originally Posted by Donya View Post
i dont see why, mysql was made to store thousands of rows?

i have a 360,000 row table. it takes like 75 ms to select from it, nothing to much.

anyways, got any videos :P?
You are absolutely right, but many users don't even know what is a database, so the "public release range" will be less than with a second release with a modifyied system. I'm not suggesting to delete what he has done, but modify and release a second version that supports .txt files

And consider that you should have a dabatase running on the same machine where your running samp server if you want good timing result and not all host offer this possibility.
__________________


Latest Releases
FilterscriptsIncludesMaps
PRaceSystem v1.3 PBlock v1.1Electronic Shop
PVotekick v1.1PInventory v1.1
________________________
I don't script for money, stop asking for it.

Phanto90 is offline   Reply With Quote
Old 16/06/2011, 11:22 PM   #9
Basicz
Gangsta
 
Basicz's Avatar
 
Join Date: Aug 2010
Location: Indonesia, Surabaya.
Posts: 630
Reputation: 33
Default Re: Dynamic race system (Can also be used for missions!)

Hmm, can anyone make a test filterscript?
I don't really understand how it works.
Basicz is offline   Reply With Quote
Old 17/06/2011, 01:31 AM   #10
Donya
Gangsta
 
Join Date: Mar 2011
Posts: 798
Reputation: 31
Default Re: Dynamic race system (Can also be used for missions!)

Quote:
Originally Posted by Phanto90 View Post
You are absolutely right, but many users don't even know what is a database, so the "public release range" will be less than with a second release with a modifyied system. I'm not suggesting to delete what he has done, but modify and release a second version that supports .txt files

And consider that you should have a dabatase running on the same machine where your running samp server if you want good timing result and not all host offer this possibility.
hmm, i guess so. mysql does slow down while selecting from a home server. a .txt support will be good too, for other users i guess.

good work anyways!
Donya is offline   Reply With Quote
Reply

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
[FilterScript] Dynamic NPC System Fab10 Filterscripts 12 21/01/2014 02:58 PM
Dynamic race checkpoint help THE_KNOWN Help Archive 2 26/01/2011 09:32 AM
Dynamic GPS system dice7 Screenshots and Videos 8 11/06/2010 08:01 AM


All times are GMT. The time now is 07:55 PM.


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