SA-MP Forums Archive
[FilterScript] Race FS + Race Editor - 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] Race FS + Race Editor (/showthread.php?tid=316636)

Pages: 1 2


Automatic Race FS + Race Editor - Flovv - 07.02.2012

Automatic Race Filterscript + Race Editor



Features

Requirements

In order to use this fs you will need:
-at least samp 0.3c
-Streamer Plugin by Incognito
-sscanf 2.5 Plugin by ******



Commands

/start race

will show you the race selection




/start race
is also used to actually begin the race


/race

is used to join a race


/race editor

will start the race editor




/race settings

will show the race settings dialog.



Here you can set autostart on/off, define an autostart time, define an autoend time, define the time to join a race before it starts, and some more selfexplaining settings


/end race

will abort a race and kick all players that joined out of the race


/end redit

will close the race editor during race creation process (closes automatically after succesful race creation)


/exit

is used to exit a race


/reload races

reloads the races files (e.g. when you put some new racefiles in that folder)



Video

http://*********/1tjjFv7LgK8



Future Plans

Known Bugs

i hope i fixed them all
but if you find one, please post it in this thread



History
Download & Install

In order to use this filterscript you will need to:

-add streamer plugin by Incognito to your server (link above in the requirements section)
-add sscanf2 plugin by ****** to your server (link above in the requirements section)
-compile the fs_race.pwn (only if you want to make changes in the script)
-put the fs_race.amx in your filterscripts folder
-create a subfolder called "races" in your /scriptfiles folder
-if you want to, put the race00.txt in the races folder to have a first race to look at
-add fs_race to the filterscripts being loaded in your server.cfg


These links will always provide the latest version of the filterscript.

Pastebin
Mediafire (precompiled FS with 50 races max. and 200 checkpoints per race max.)
contains:
fs_race.pwn (62KB)
fs_race.amx (181KB)
race00.txt (2KB)




For those who compile themselfes

This is the part where you can customize the script to your needs.

The most interesting point here would be the PlayerIsAdmin(playerid) part i guess.
As commented, just insert your method of checking if the player is an admin here.
Make sure to include everything you need to do so at the top of the script and there shouldn't be any problem.
At our server we use a mysql query to check if a player is an admin but i replaced it here with the IsPlayerAdmin
so it fits for everyone.

If you don't change this only RCON Admins will be able to start races, use the race editor and change the race settings.


pawn Код:
//********************************************************************
/////////////////////////////// SETTINGS /////////////////////////////
//********************************************************************

//use this to increase performance if your server has less than 500 slots or change it if your server has more than 500 slots

#undef MAX_PLAYERS
#define MAX_PLAYERS 500     //set to your max number of players


//set the maximum number of races/checkpoints to be loaded

#define MAX_RACES 50        //max number of races

#define MAX_CPS 201     //max number of checkpoints in a race

//use this function for whatever method you use to determine if a player is admin (just make sure to return true if player is admin or false if not)

PlayerIsAdmin(playerid)
{
    if(IsPlayerAdmin(playerid) == 1) return true;
    else return false;
}

//******************************************************************

////////////////////////// SETTINGS END ////////////////////////////
//******************************************************************


Credits

Incognito for his Streamer Plugin
****** for his sscanf2 Plugin



Feel free to edit to your personal needs and redistribute, as long as you give me credit for this


If you notice any bugs, or got suggestions just tell me here


Re: Race FS + Race Editor - saringan_cs - 08.02.2012

GG -9.99/10


AW: Race FS + Race Editor - Flovv - 08.02.2012

thx

added a small fix.

-autostart won't work if there aren't any races
-race will automatically be closed if all participants leave the race without finishing

the kart race track editor is making great progress so far


Re: Race FS + Race Editor - Ballu Miaa - 08.02.2012

Downloaded will check later and will post accordingly!


Re: Race FS + Race Editor - Madd Kat - 08.02.2012

Installed smoothly.

however when i made a small test race
and use auto start it would not start any race.

other issue is the starting point for my race was in ganton
but when i disabled auto start and used /start race
it spawned me to red country


but looks very nice, I did the example race first and it worked great.

and I have a question when auto race is set to on
is that for all races?

looking in the race file i get this


0.000000,0.000000,0.000000; Race Spawn


maybe this is why?>


AW: Race FS + Race Editor - Flovv - 08.02.2012

Hi, thx for that response. I looked it over and found the reason for the wrong race spawn. Had forgotten to set a MAX_CPS in the race editor sorry....

the 0.000000 at the spawn coordinates was very helpfull for that

This should be fixed by now. Just uploaded the fixed version to pastebin and mediafire.

About your autostart problem... i couldn't reproduce that

Did you get any errormessage as you started the autostart?

And the autostart will choose one of your races randomly to start. So by the time all races will be started


Re: Race FS + Race Editor - Madd Kat - 08.02.2012

it was because of the spawn point,
i manually edited it and restarted server.
so the auto start is working now

i will update to latest code and try some more

thk


Re: Race FS + Race Editor - Aloushi - 09.02.2012

/end editor not work


AW: Race FS + Race Editor - Flovv - 09.02.2012

Thx for the report.

I had a typo in the commands part of the script.

That command has now changed to /end redit.
There should be no more problems with that once you update to the newest version


I also edited my first post and uploaded the fixed version of the script to Pastebin and Mediafire.


Re: Race FS + Race Editor - LordSkiller - 12.02.2012

Bug after bug

Next time you should check it before you post it


AW: Race FS + Race Editor - Flovv - 12.02.2012

Well, sometimes you miss something. but those haven't been big bugs. All fixable within 10 minutes

So have you done any scripting? Maybe you show me so i can have a look at it. Trying to find something you might have overseen


Re: Race FS + Race Editor - Georgi166 - 12.02.2012

Bug Bug Bug Bug
You should smash those bugs


Re: Race FS + Race Editor - Zarky - 13.02.2012

Tested, No bugs found

Great FS. (Thumb Up)


Re: Race FS + Race Editor - LordSkiller - 14.02.2012

More FS of Flovv will follow soon =)


Re: Race FS + Race Editor - Yuryfury - 22.04.2012

The self placing checkpoint system in the race builder is interesting. Haven't seen any race systems out in a while. This one looks promising.


Re: Race FS + Race Editor - StAsMaNn - 10.08.2012

Mega cool script...


Re: Race FS + Race Editor - Shetch - 11.08.2012

Looks nice.


Re: Race FS + Race Editor - Soumi - 11.08.2012

Good job


Re: Race FS + Race Editor - HaiderABbas - 02.06.2013

awesome just upset with auto start after 1mint

and cps are so slow it comes after 5 seconds


Re: Race FS + Race Editor - RocketBoy - 29.01.2014

Greate job