SA-MP Forums Archive
[Include] Dynamic race system (Can also be used for missions!) - 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)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Dynamic race system (Can also be used for missions!) (/showthread.php?tid=262063)



Dynamic race system (Can also be used for missions!) - Lenny the Cup - 16.06.2011

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
You will need the following plugins/includes to use this script:I have made it simple to use with any command processor by making functions that you can call in your commands like so:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[ ])
{
    if(!strcmp(cmdtext, "/mycommandhere"))
    {
        return LR_CMD_RACECARS(playerid);
    }
}
Or (Depending on your command processor)
pawn Код:
CMD:mycommandhere(playerid, params[])
{
    return LR_CMD_RACECARS(playerid);
}
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.
Include
SQL schema


Re: Dynamic race system (Can also be used for missions!) - Phanto90 - 16.06.2011

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


Re: Dynamic race system (Can also be used for missions!) - Lenny the Cup - 16.06.2011

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


Re: Dynamic race system (Can also be used for missions!) - Basicz - 16.06.2011

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)
^
|
|


Re: Dynamic race system (Can also be used for missions!) - Lenny the Cup - 16.06.2011

I used phpMyAdmin to export the tables


Re: Dynamic race system (Can also be used for missions!) - Resort - 16.06.2011

Thanks for the release. =]


Re: Dynamic race system (Can also be used for missions!) - Donya - 16.06.2011

Quote:
Originally Posted by Phanto90
Посмотреть сообщение
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?


Re: Dynamic race system (Can also be used for missions!) - Phanto90 - 16.06.2011

Quote:
Originally Posted by Donya
Посмотреть сообщение
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.


Re: Dynamic race system (Can also be used for missions!) - Basicz - 16.06.2011

Hmm, can anyone make a test filterscript?
I don't really understand how it works.


Re: Dynamic race system (Can also be used for missions!) - Donya - 17.06.2011

Quote:
Originally Posted by Phanto90
Посмотреть сообщение
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!


Re: Dynamic race system (Can also be used for missions!) - Lorenc_ - 17.06.2011

This looks nice, an Include for racing is amazing. In mysql is great, though i really want to know if mysql can select rows/columns faster than SQLite.

Good work made, hope to see more from you


Re: Dynamic race system (Can also be used for missions!) - Gforcez - 17.06.2011

I Get some errors and Warnings:


Код:
error 001: expected token: ";", but found "-string-"
warning 215: expression has no effect
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
All on this line (Not edited)

Код:
sscanf("-1%""%""%""%0", "p<%>e<is[" #MAX_RACE_NAME "]s[41]s[" #MAX_PLAYER_NAME "]i>", Race[i]);



Re: Dynamic race system (Can also be used for missions!) - Stigg - 17.06.2011

Nice system, looking forward to the txt file supported version. Great job.


Re: Dynamic race system (Can also be used for missions!) - Lenny the Cup - 17.06.2011

Quote:
Originally Posted by Gforcez
Посмотреть сообщение
I Get some errors and Warnings:


Код:
error 001: expected token: ";", but found "-string-"
warning 215: expression has no effect
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
All on this line (Not edited)

Код:
sscanf("-1%""%""%""%0", "p<%>e<is[" #MAX_RACE_NAME "]s[41]s[" #MAX_PLAYER_NAME "]i>", Race[i]);
Yes, sorry, I forgot I re-defined MAX_PLAYER_NAME since it contains ( ) which isn't allowed in sscanf. It's fixed in the pastebin version now, I also added a missing timer and compiled it to an empty gamemode make sure it all works


Re: Dynamic race system (Can also be used for missions!) - Gemini - 17.06.2011

can you run multiple races?


Re: Dynamic race system (Can also be used for missions!) - Gforcez - 17.06.2011

Quote:
Originally Posted by Lenny the Cup
Посмотреть сообщение
Yes, sorry, I forgot I re-defined MAX_PLAYER_NAME since it contains ( ) which isn't allowed in sscanf. It's fixed in the pastebin version now, I also added a missing timer and compiled it to an empty gamemode make sure it all works
Thanks Mate!


Re: Dynamic race system (Can also be used for missions!) - Gemini - 17.06.2011

ehm.... how do I install this? Im new with mysql (downloaded it 5 mins ago)
How do i install the includes etc? Help please


Re: Dynamic race system (Can also be used for missions!) - Lenny the Cup - 17.06.2011

Quote:
Originally Posted by Gemini
Посмотреть сообщение
can you run multiple races?
Yes, each player can run their own individual race.

You can read about mysql here: http://www.mysql.com/


Respuesta: Dynamic race system (Can also be used for missions!) - misho1 - 26.07.2012

It Crash When I Compile


Re: Dynamic race system (Can also be used for missions!) - bye - 03.08.2012

Good