SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 07/02/2012, 09:24 PM   #1
Flovv
Little Clucker
 
Join Date: Dec 2011
Posts: 8
Reputation: 1
Smile Automatic Race FS + Race Editor

Automatic Race Filterscript + Race Editor



Features
  • up to 50 races (precompiled version, as many as you want if you compile yourself)
  • up to 200 checkpoints per race (precompiled version, as many as you want if you compile yourself)
  • autostart races (no admin needs to be online)
  • 8 different types of vehicle classes for each race
  • ingame race editor (simple checkpoint placement without commands)
  • race file system (exchange races with friends/other servers)



Requirements

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



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://youtu.be/1tjjFv7LgK8



Future Plans
  • Advanced race editor (edit race settings/checkpoints of an existing race)
  • New kart/mower/golfkart vehicle class
  • Kart track editor
  • Different race modes (knockout, destruction derby, chase)
  • Entry fee (maybe general or specific for every race)



Known Bugs

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



History
  • v 1.0 - first FS Version
  • v 1.1 - small bugfixes, command to end the raceeditor was changed to /end redit


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 Y_Less 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 Code:
//********************************************************************
/////////////////////////////// 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
Y_Less 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

Last edited by Flovv; 09/02/2012 at 05:31 PM. Reason: bugfix
Flovv is offline   Reply With Quote
Old 08/02/2012, 07:54 AM   #2
saringan_cs
Big Clucker
 
Join Date: Dec 2011
Location: http://imageshack.us/photo/my-images/820/ggcopy.png/
Posts: 158
Reputation: 1
Default Re: Race FS + Race Editor

GG -9.99/10
saringan_cs is offline   Reply With Quote
Old 08/02/2012, 04:24 PM   #3
Flovv
Little Clucker
 
Join Date: Dec 2011
Posts: 8
Reputation: 1
Default AW: Race FS + Race Editor

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
Flovv is offline   Reply With Quote
Old 08/02/2012, 04:39 PM   #4
Ballu Miaa
High-roller
 
Ballu Miaa's Avatar
 
Join Date: Apr 2010
Location: New Delhi,India
Posts: 1,909
Reputation: 313
Default Re: Race FS + Race Editor

Downloaded will check later and will post accordingly!
__________________
My Skype and Avovix account has been hacked and taken over. Contact me here as soon as possible if you are from Avovix Staff.


I will take half payment as an advance to script for you.
Click here to request my Scripting Service.

Ballu Miaa is offline   Reply With Quote
Old 08/02/2012, 09:56 PM   #5
Madd Kat
Big Clucker
 
Madd Kat's Avatar
 
Join Date: Feb 2012
Location: In The D
Posts: 166
Reputation: 15
Default Re: Race FS + Race Editor

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?>
Madd Kat is offline   Reply With Quote
Old 08/02/2012, 10:58 PM   #6
Flovv
Little Clucker
 
Join Date: Dec 2011
Posts: 8
Reputation: 1
Default AW: Race FS + Race Editor

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
Flovv is offline   Reply With Quote
Old 08/02/2012, 11:12 PM   #7
Madd Kat
Big Clucker
 
Madd Kat's Avatar
 
Join Date: Feb 2012
Location: In The D
Posts: 166
Reputation: 15
Default Re: Race FS + Race Editor

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
Madd Kat is offline   Reply With Quote
Old 09/02/2012, 03:12 PM   #8
Aloushi
Gangsta
 
Aloushi's Avatar
 
Join Date: Apr 2011
Location: Lebanon
Posts: 550
Reputation: 49
Default Re: Race FS + Race Editor

/end editor not work
__________________
  • Im Bored
Aloushi is offline   Reply With Quote
Old 09/02/2012, 05:35 PM   #9
Flovv
Little Clucker
 
Join Date: Dec 2011
Posts: 8
Reputation: 1
Default AW: Race FS + Race Editor

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.
Flovv is offline   Reply With Quote
Old 12/02/2012, 11:50 AM   #10
LordSkiller
Little Clucker
 
Join Date: Feb 2012
Posts: 2
Reputation: 0
Default Re: Race FS + Race Editor

Bug after bug

Next time you should check it before you post it
LordSkiller 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] PRaceSystem + Race Editor v1.3 Phanto90 Filterscripts 202 13/04/2014 08:37 AM
[FilterScript] PRace System + Race Editor v1.1 Phanto90 Filterscripts 48 18/03/2011 02:09 PM
[Race]How to get Player Position in Race (example: 3rd/10) Basss Help Archive 5 17/07/2009 09:23 PM


All times are GMT. The time now is 09:20 PM.


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