How can I make a "racing" gamemode?
#1

Hello there. I'm new on this; however, I've already know the basics of the programming language.

The thing is: how can I get started in creating a "racing" gamemode? Not from scratch if possible; instead, based on how Grand Larceny gamemode handles incoming players.

This is what I have in mind right now:
  • I want to create a 20-players-maximum-race that borders all the San Andreas map. When a player enters to the server, it can choose the skin (character); and then spawn at some point in the East beach of Los Santos (the starting point of the race). No money or weapons the player will receive at first, and no vehicle should exist in the entire world (at first of course).
  • When all players are ready; then an administrator types a server command, passes a certain amount of time (announcing to all players that the race will start soon), a countdown begins; and when that countdown finishes, 20 vehicles spawn in a row and the race finally starts.
  • The race is made of checkpoints (almost exactly like how a race works in the normal game), and the vehicles must be indestructibles (if sunk in the water, then the vehicle teleports to the previously reached checkpoint).
  • The first player who reaches the final checkpoint (aka finish line), will receive a prize that I'll decide later.
  • If everybody wants to race again, then an administrator types the command; and this time, all players get teleported to their respective spawn locations (where they did that at first). The following events are the same as described above.
Now there are two things that I'm missing: the checkpoints' coordinates (I'll take care of this part), and what to do if the vehicle (a car) rollovers and sets on fire, because I still have no idea how to manage the disqualifications in a race.

Hope you could understand me since this is my very first post, and I will appreciate any help/idea/suggestion about how to get started.

Best regards.
Reply
#2

"how to get started"
  1. Download the SA-MP server package.
  2. Extract the package.
  3. Enter the folder the package is in if you aren't already in it.
  4. Open the file "server.cfg".
  5. Change "rcon_password" to any password you want.
  6. Remove the line of "filterscripts".
  7. Change the text after "gamemode0" to "racing".
  8. Go back to the main directory. Double click on the folder called "pawno" and execute pawno.exe.
  9. Inside the folder called "pawno", look for "new.pwn". Highlight it, press CTRL + C. Go to the main directory, go inside the folder called "gamemodes" and press CTRL + V.
  10. Change the name of the file you just pasted inside the folder "gamemodes" to "racing.pwn".
  11. Go back to the window that shows the IDE (pawno.exe) and click on open file.
  12. Find "racing.pwn" and open it.
  13. Now start scripting your racing gamemode!
  14. And when you want to compile and test out your awesome server press F5!
  15. Run "samp-server.exe" to start the server.
  16. Open the SA-MP client and click on add a new server.
  17. Type "localhost" and press ENTER.
  18. Connect to your server and have fun!
You have now officially started creating your racing gamemode. Congratulations!

And by the way, the things you are asking tips/ideas/suggestions/etc. on can't just be explained with words whatsoever. This section is for "help on your coding". Requests go here: https://sampforum.blast.hk/showthread.php?tid=447813
Reply
#3

Whoops. Anyway, it's my first time, so making any sort of mistake is something that I should expect.
All right, thank you for correcting me!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)