SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Gamemode Scripts

Reply
 
Thread Tools Display Modes
Old 13/09/2017, 05:02 AM   #1
Arthur Kane
Gangsta
 
Join Date: Sep 2012
Location: Los Angeles
Posts: 677
Reputation: 93
Default Base Roleplay Script

Base Roleplay Script

I'd like to call this an "advanced" base-script for a role-play gamemode server. I wrote the entire script from scratch and started the development on August 11th, 2017. After spending months on learning PAWN, I decided to make my own script from scratch. I spent few months on scripting my primary script and did pretty good and reached 30,000 lines of code with little to no bugs which I was proud of. I decided to make another script for release and just to get opinions and criticism from other members of the SA-MP forums and track my progression.

Features are but not limited to:
  • Account System
    • Players register to the server with a primary master account.
    • Players may have up to 4 characters.
  • Property System
    • There are 3 property types. You could create a: apartment complex, apartment room inside the complex and a house.
    • Players can spawn at their owned properties in co. with the set spawn system.
    • Players can buy boombox's for their properties in co. with the dynamic XM-radio system.
    • Players may store up to 20 weapons in their property with a place position.
  • Business System
    • There are 7 business types. They are: restaurant, ammunation, club, bank, general store, dealership and DMV. Dealership and DMV are used for standalone and can't be owned / entered by players.
    • Business owners can place and put money into their business' cashbox.
    • Owners make revenue from their setable entrance fee that players pay when they enter.
    • Products. Business' have a product limit of 500. When their business is used, these products run out. In order to tax business owners and not completely give them a unlimited amount of revenue without loss, they need to order new products which will cost them money to do so.
  • Vehicle System
    • There are 2 vehicle types. Public and faction.
    • Faction vehicles spawn when the server loads. Players can park or spawn their public vehicles at anytime. (Limited to 1 vehicle only)
    • Players can own up to 5 vehicles at once.
    • Players who own a vehicle and are rank 1 of their faction may factionize the vehicle.
    • Vehicle Security
      • Vehicles include: a lock level, an alarm level and an immobilizer level.
      • Players who don't have the keys to a vehicle are prompted with a unscrambling method ("hotwiring") to turn the vehicles engine on when they /engine it.
      • Players can pay for to upgrade their security levels in the dealership or upgrade it later.

    • Vehicle Life
      • Vehicles have a engine and battery "life". Every time a vehicle is destroyed, both engine and battery deplete.
      • Vehicle features (i.e: XM-Radio) can't be used when engine or battery health are low.

    • Players can duplicate their vehicle key to lend to another player.
    • Players can tow their vehicle, locate it, scrap it for half the dealership price or sell to other players.
    • Players can buy a vehicle at a business that's a dealership.
    • Players can store up to 5 weapons in their vehicle.
  • XM-Radio System
    • There are a maximum of 17 XM-Radio categories and 18 stations per category.
    • Admins may create a category and station in game using their commands accordingly.
    • Players can use XM-Radios via: buy it for their property and / or buy it for their vehicle.
  • Death System
    • There are 3 internal player-states. Alive, brutally wounded and dead.
    • When players take damage which causes a significant amount of health loss, they're put into brutally wounded.
    • Players can accept death or be executed by other players.
    • Damages
      • Everytime a player takes damage from another player, it is logged. Ordinary players can check a players damage when that player is in brutally wounded state. Admins may check their damages at any time and also see who caused that damage to a player.
  • Faction System
    • There are 4 faction types. They are: illegal, police, medical and corrections.
      • Corrections refers to a prison correctional officer. It's yet to be made.

    • There is a maximum of 20 faction ranks. (1 being the highest, 20 being the lowest)
    • Factions leaders may add, remove or alter faction ranks.

    • There are 4 external "ranks". They are: faction alter rank, chat alter rank, tow rank, and join rank.
      • Faction alter rank: This is the rank that has permissions to change players ranks, edit faction information and et cetera.
      • Chat alter rank: This is the rank that has permission to turn the factions chat on and off.
      • Tow rank: This is the rank that has permission to tow (respawn) all faction vehicles.
      • Join rank: This is the rank that's given to a player when they join the faction. Usually the last rank available.

    • Admins and faction leaders may configure the faction accordingly with an in game command.
    • Faction chat. Each faction has their own faction chat. The color of the chat can be customized by the faction leaders.
  • There are 188 commands in the script to date.
  • There are 94 internal functions.

Dependencies & Credits:

Screenshots:
Notes:
  • This is just a "base" start to developing a role play gamemode. At the current moment of release, this wouldn't be an optimal script for game play on a real time server. I discourage any one who tries to use this for a server straight off the bat without any additional coding to it. It still needs some touching up, more features for players and et cetera. However, that's just my opinion. Do as you wish with it.

  • There are no known bugs for now. Spent an hour going through the server and code. If you encounter a bug and need help, report it in the thread.

Download:

Github. Database is included.

I would really like feedback from anyone, thanks!

Last edited by Arthur Kane; 27/09/2017 at 09:08 AM.
Arthur Kane is online now   Reply With Quote
Old 13/09/2017, 05:10 AM   #2
Dignity
High-roller
 
Dignity's Avatar
 
Join Date: May 2013
Location: Belgium
Posts: 1,771
Reputation: 1037
Default Re: Base Roleplay Script

Looks a lot like LS-RP. You made anything else that looks like their mode in this script?

Honest question, I think it's done pretty well.
__________________


Shoot me or Reyo a PM for more information.
Dignity is offline   Reply With Quote
Old 13/09/2017, 05:12 AM   #3
Arthur Kane
Gangsta
 
Join Date: Sep 2012
Location: Los Angeles
Posts: 677
Reputation: 93
Default Re: Base Roleplay Script

NGL, I wanted to learn scripting because I liked their script so much and wanted to try out what I could do.

But not much looks like theirs.
Arthur Kane is online now   Reply With Quote
Old 13/09/2017, 05:14 AM   #4
Dignity
High-roller
 
Dignity's Avatar
 
Join Date: May 2013
Location: Belgium
Posts: 1,771
Reputation: 1037
Default Re: Base Roleplay Script

Alright. You could try using enums for dialog ids rather than #defining them all one by one.

Code:
enum {
DIALOG_DEFAULT,
DIALOG_CONFIRM_SYS,
... 
} ;

The above increments the ID automatically without having to define the ID manually.
__________________


Shoot me or Reyo a PM for more information.
Dignity is offline   Reply With Quote
Old 13/09/2017, 09:10 AM   #5
SeanDenZYR
Big Clucker
 
Join Date: May 2016
Location: Philippines!!
Posts: 82
Reputation: 8
Default Re: Base Roleplay Script

Sounds like Italy Mafia, i'll try.
SeanDenZYR is offline   Reply With Quote
Old 13/09/2017, 09:10 AM   #6
Escobabe
Huge Clucker
 
Escobabe's Avatar
 
Join Date: Apr 2017
Location: Valhalla
Posts: 290
Reputation: 63
Default Re: Base Roleplay Script

Good job!
__________________
Discord: Join us! Forums: Join us!
Escobabe is offline   Reply With Quote
Old 13/09/2017, 11:12 AM   #7
R4nd4ll
Huge Clucker
 
R4nd4ll's Avatar
 
Join Date: Jul 2017
Location: Los Santos, The Federal Bureau of Investigation HQ
Posts: 202
Reputation: 70
Default Re: Base Roleplay Script

Testing it.

Edit : Nice one mate +Rep
__________________
A mapper

Is looking for a job

And i am a good Public Relations member too (if given the right powers)
I worked once for
Crystallize and brought his server to 20 players in 2 days only
R4nd4ll is offline   Reply With Quote
Old 13/09/2017, 12:08 PM   #8
JasonRiggs
Huge Clucker
 
Join Date: Jul 2016
Location: My bedroom.
Posts: 465
Reputation: 16
Default Re: Base Roleplay Script

Nice one Arthur, Updating it will make it great, I'll work on it and start my server with it.
__________________


Server IP: 185.12.178.71:7799
Website: nyakos-rp.weebly.com
Beta Launched!
JasonRiggs is offline   Reply With Quote
Old 13/09/2017, 12:51 PM   #9
cuber
Huge Clucker
 
cuber's Avatar
 
Join Date: Oct 2016
Location: Establishing connection...
Posts: 460
Reputation: 45
Default Re: Base Roleplay Script

Well done.

Last edited by cuber; 13/09/2017 at 01:27 PM.
cuber is offline   Reply With Quote
Old 13/09/2017, 01:25 PM   #10
Wolfe
Big Clucker
 
Join Date: Feb 2015
Posts: 163
Reputation: 55
Default Re: Base Roleplay Script

By skimming through the code it looks pretty neat, and it doesn't seem to be to bad for a beginner. However some tips/complaints I have is you should look into organizing your database better, and stop repeating the usage of 'str' and replace it with a proper name. You should also try to add some of your own touches to your gamemode (I understand the gamemode is simple, and nice but whenever you mimicking to the last detail it's not really that cool as it's been done before).

Here's some stuff that you could read up on that'd probably help you out:
- http://forum.sa-mp.com/showthread.php?t=631607 (These aren't a must, but if you want readable, clean, and maintainable code this would help.)
- http://forum.sa-mp.com/showthread.php?t=609888 (Will help limit the vast amount of stuff that could be removed from the 'chracters' table)
heh they're both from vince sorry

An example in your database:
In your 'characters' table you have things that could use association tables that'd make your database a lot more cleaner. For example here you are storing the characters weapons, and cars where you could make new tables and refer to the players character ID you store in the characters table to help with this.


You also prefix each thing you've put into the table with 'p'. This isn't something you want to get in the habit of it makes you database look bad, and there's no real use to it.
Wolfe 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
[GameMode] Base Roleplay Script [BEGINNERS] JustinAn Gamemode Scripts 88 18/11/2014 10:13 PM
[GameMode] Norton's Roleplay Base Script V2 iNorton Gamemode Scripts 59 28/03/2013 06:01 PM
[GameMode] SQLite Roleplay Script - Base Norn Gamemode Scripts 56 03/07/2012 08:29 PM


All times are GMT. The time now is 04:57 AM.


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