SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 02/02/2015, 08:47 PM   #5521
malaka
Huge Clucker
 
malaka's Avatar
 
Join Date: Dec 2010
Location: San Andreas ................................... Status: Retired
Posts: 293
Reputation: 35
Default AW: Re: PPC_Trucking V1

Quote:
Originally Posted by PowerPC603 View Post
Even public locations are businesses in real-life.
A hospital is a business, so is a police station.

Or would you like to keep a static fine for every speedcamera on the map like before?
[...]
Yes, hospitals mostly owned by private companys and actually you could do this for them. But they should be very expensive (buying and keeping them (eg. running costs). But for the police station, I didn't hear that people like you and me could buy a whole police station in real life.

Let the owner of the server set prices and tax rates. Maybe even through a comand (not sure if this could provocate any bugs).


Quote:
Originally Posted by PowerPC603 View Post
[...]
Players would in fact be able to apply for a job if the business is active already (owned by players).
They would be able to enter it, buy stuff like a pizza at a pizza-shop, or even apply for a job (send an invite request to the leader).
[...]
I wouldn't like that. I think businesses should automatically accept the application and give the player a contract for few in-game days so he can't switch his job every minute. I mean, they do only work, they can't really destroy the business. There is no need to control it, you know? Especially if the owner or his co-owners are offline for a very long time.

Quote:
Originally Posted by PowerPC603 View Post
[...]
I've already removed both systems from the script (hospitals and gas-stations).
[...]
I see. But I still like the idea of owning gas stations.

Quote:
Originally Posted by PowerPC603 View Post
[...]
And I have started on finishing the ban-system.
I had the system in place, but there was no ban-command yet.
But there is now.
It even supports both online and offline banning in the same command.
/ban <playername> <hours> <reason>
[...]
On my server I restricted those commands to specific admin levels. And I also limited the time to ban as I think it shouldn't be possible to ban someone for 5531 days. A permanent ban would be better but this should only be restricted to the owner or to the "head admin" as this is a very big punishment. I don't like the idea of having tons of administration tools while there are almost no benefits for players.

The community ( = players ) should have all the power and not (only) the administration. There are good things you could add to the server that doesn't require an admin to be online all the time. Like commands to vote to kick a player or to punish him or so. Yea this could be abused but you could also only allow player with certain score to use that.

But this is just my opinion. x)
malaka is offline   Reply With Quote
Old 02/02/2015, 09:08 PM   #5522
PowerPC603
High-roller
 
Join Date: Nov 2010
Location: Belgium
Posts: 1,734
Reputation: 238
Default Re: PPC_Trucking V1

I could add a system when someone joins a company, he won't be able to join a new one within 24 hours.
So if he leaves the company right after joining one, he won't be able to join another until his 24 hour waiting time has passed.
This could be implemented to prevent company-hopping.

Of course the ban-command is restricted to admins level 3 and higher.
It would certainly be possible to restrict permanent banning to level 4 or 5 admins.

Businesses cannot be destroyed, but all players could leave, transferring the company back to the government.
Businesses become companies, there won't be businesses left as in V1, where only 1 player owns them and generate money automatically.

So the pizzatent, burger shot and all the others become buyable companies.
The building is there, players only need to buy it to start the company.
The first one to buy the company automatically becomes the company-leader, who can accept new employees.

It would still be possible for unowned companies to sell products (such as hamburgers at burger shot).
Players could still enter unowned companies and buy food or whatever it sells.

Also companies won't automatically fire members out of the company, even if they didn't login for months, unless it goes bankrupt. Then it could everyone out and becomes available to be bought again by other players.
The company always holds it's own funds, earned by the members.
Members can also add funds themselves to the company.
The members should always be able to keep the funds of their company above 0.

Ok, then I just keep static police stations, where players can enter them, but not buy them.
And keep static fines for all speedcams, without connecting them to police stations.
The fine could be edited by lvl 6 admin of course.

And no, this won't introduce bugs if properly written.

For the tax-rate, I'll just use one fixed tax-rate for everything, like 6% as default.
It would be too complex to have different tax-rates for every system.
__________________
Gamemode: PPC_Trucking
Extras-file (for PPC_Trucking): /delproperty, /evict, /propertyid, /porthouse, /portbus, /properties
------------------------------------------------------------------------------------
PPC-Trucking-V2 (home-hosted, only open on occasion for testing purposes): ppctruckingv2.no-ip.info:7777
******* channel: https://www.*******.com/channel/UC-4...Mpglma8f0Ld-YQ
------------------------------------------------------------------------------------
Filterscripts: PPC_Speedometer - PPC_Housing - PPC_Business
PowerPC603 is offline   Reply With Quote
Old 03/02/2015, 08:02 PM   #5523
PowerPC603
High-roller
 
Join Date: Nov 2010
Location: Belgium
Posts: 1,734
Reputation: 238
Default Re: PPC_Trucking V1

I've completed the ban command.

The entire system is quite long: 174 lines of code.
It's been tested and works perfectly.

It also supports offline unbanning by entering a bantime of 0 hours.
You only need a part of their name like:
/ban power 0

This would bring up a list of all registered players which have "power" in their name.
Selecting a name from the list that shows up will unban that player, because the command was given a bantime of "0" hours.
Of course, if there is someone online who's name starts with "power", the ban-command will in this case fail (a proper message is displayed), because "0" hours is used to unban players.
Players who are currently playing aren't banned, so there was no reason to add online unbanning, as they wouldn't been able to play if they were banned.

It can ban online players for maximum 500 hours, or permanently ban them.
It can also ban offline players for maximum 500 hours, permanently ban them, or unban them.



I'm gonna add the reason to the database as well, as this isn't saved yet.
It would be nice to know why you've been offline/online banned when you try to login again.



For the vote-kick system, I'll add a small ban-time as well (max one hour), otherwise kicking a player won't keep them out for long, as they can just re-launch the game and be able to play again, waiting for another vote-kick.
This bantime will be editable by an admin lvl 6, as well as the amount of votes before a player is kicked.
__________________
Gamemode: PPC_Trucking
Extras-file (for PPC_Trucking): /delproperty, /evict, /propertyid, /porthouse, /portbus, /properties
------------------------------------------------------------------------------------
PPC-Trucking-V2 (home-hosted, only open on occasion for testing purposes): ppctruckingv2.no-ip.info:7777
******* channel: https://www.*******.com/channel/UC-4...Mpglma8f0Ld-YQ
------------------------------------------------------------------------------------
Filterscripts: PPC_Speedometer - PPC_Housing - PPC_Business
PowerPC603 is offline   Reply With Quote
Old 04/02/2015, 10:58 AM   #5524
malaka
Huge Clucker
 
malaka's Avatar
 
Join Date: Dec 2010
Location: San Andreas ................................... Status: Retired
Posts: 293
Reputation: 35
Default AW: PPC_Trucking V1

Quote:
Originally Posted by PowerPC603 View Post
I could add a system when someone joins a company, he won't be able to join a new one within 24 hours.
So if he leaves the company right after joining one, he won't be able to join another until his 24 hour waiting time has passed.
This could be implemented to prevent company-hopping.
[...]
Quote:
Originally Posted by PowerPC603 View Post
[...]
Businesses become companies, there won't be businesses left as in V1, where only 1 player owns them and generate money automatically.
[...]


Quote:
Originally Posted by PowerPC603 View Post
[...]
Also companies won't automatically fire members out of the company, even if they didn't login for months, unless it goes bankrupt. Then it could everyone out and becomes available to be bought again by other players.
[...]
Good point and very realistic, go for it!

Quote:
Originally Posted by PowerPC603 View Post
[...]
Ok, then I just keep static police stations, where players can enter them, but not buy them.
And keep static fines for all speedcams, without connecting them to police stations.
The fine could be edited by lvl 6 admin of course.
[...]
For the tax-rate, I'll just use one fixed tax-rate for everything, like 6% as default.
It would be too complex to have different tax-rates for every system.
Nice one. Maybe you should do different tax rates like wealth tax, house tax, tax for business stuff and for public transportation (bus, train and plane (if you think of NPC)) or even the tax for the gas station.

Quote:
Originally Posted by PowerPC603 View Post
I've completed the ban command.
[...]
So, the ban command is the first thing you do when you're working on a new gamemode? Isn't there something more important like the basic stuff? I don't know about you but I would start with the system itself and later on I would add some extras and the administration stuff.

Quote:
Originally Posted by PowerPC603 View Post
[...]
For the vote-kick system, I'll add a small ban-time as well (max one hour), otherwise kicking a player won't keep them out for long, as they can just re-launch the game and be able to play again, waiting for another vote-kick.
This bantime will be editable by an admin lvl 6, as well as the amount of votes before a player is kicked.
You could make it in a way so that if 5 players vote for kick he will be kicked and if 10 people vote for it or if he already got kicked, he will be banned for few hours based on the default settings.
malaka is offline   Reply With Quote
Old 04/02/2015, 03:15 PM   #5525
[HM]Nicky
Little Clucker
 
Join Date: May 2010
Posts: 38
Reputation: 7
Default Re: PPC_Trucking V1

Quote:
Originally Posted by PowerPC603 View Post
I've completed the ban command.

The entire system is quite long: 174 lines of code.
It's been tested and works perfectly.

It also supports offline unbanning by entering a bantime of 0 hours.
You only need a part of their name like:
/ban power 0

This would bring up a list of all registered players which have "power" in their name.
Selecting a name from the list that shows up will unban that player, because the command was given a bantime of "0" hours.
Of course, if there is someone online who's name starts with "power", the ban-command will in this case fail (a proper message is displayed), because "0" hours is used to unban players.
Players who are currently playing aren't banned, so there was no reason to add online unbanning, as they wouldn't been able to play if they were banned.

It can ban online players for maximum 500 hours, or permanently ban them.
It can also ban offline players for maximum 500 hours, permanently ban them, or unban them.



I'm gonna add the reason to the database as well, as this isn't saved yet.
It would be nice to know why you've been offline/online banned when you try to login again.



For the vote-kick system, I'll add a small ban-time as well (max one hour), otherwise kicking a player won't keep them out for long, as they can just re-launch the game and be able to play again, waiting for another vote-kick.
This bantime will be editable by an admin lvl 6, as well as the amount of votes before a player is kicked.


Releasee this im looking for offlineban
[HM]Nicky is offline   Reply With Quote
Old 04/02/2015, 05:44 PM   #5526
PowerPC603
High-roller
 
Join Date: Nov 2010
Location: Belgium
Posts: 1,734
Reputation: 238
Default Re: AW: PPC_Trucking V1

Quote:
Originally Posted by malaka View Post


So, the ban command is the first thing you do when you're working on a new gamemode? Isn't there something more important like the basic stuff? I don't know about you but I would start with the system itself and later on I would add some extras and the administration stuff.
It's because I already added register/login system and the ban-system is merged with it.
I can't test anything without loaded player-data. Or I would need to use GivePlayerMoney and GetPlayerMoney first everywhere a player earns money, and adjust everything again later on.

A player's IP and account are checked for a ban before the rest of the data is loaded (actual player-data like money, score, admin-level, ...).

Since I created features before and never really finished them (or I needed to make huge modifications to the existing system), I want to finish it before moving on.
Otherwise I would need to write a part of system A today, start working on system B, then move on to system C, and later on, continue working on system A, where stuff from part B also needs adjustments.

I would just move in circles and there may be features left eventually that are only partially finished, or perhaps even buggy.

Since the ban-system is already in there, I need to add the ban command first as it's directly related to the ban-system.

There will also be a /bans command, where the admin can browse the banned accounts and even unban them in-game.

Quote:
Originally Posted by [HM]Nicky View Post
Releasee this im looking for offlineban
I guess I could post the /ban command and it's related functions once I have added the reason to the database.
You just need to figure out the structure of the APlayerData array and the database itself to adjust it to your own code.
But it would show you how I got it working.
But it won't work with V1, as V1 still uses files and you can't browse directories (list files in directories) with default samp functions.
The /ban command uses MySQL to do the offline banning (in fact the entire script uses MySQL).
Using a database, it's simple, as it only takes a simple query to get all player-accounts which contain part of a player-name.
Using files, it's nearly impossible to get the same results.
Unless you know the EXACT filename (or exact playername), then it would be possible.

Quote:
You could make it in a way so that if 5 players vote for kick he will be kicked and if 10 people vote for it or if he already got kicked, he will be banned for few hours based on the default settings.
How could players vote 10 times when he'll be kicked at the count of 5 votes?



When that's finished, I'll start working on speedcams and police stations again.

After that, I'll see what I can do, perhaps start working on the companies again and add gas-stations as first company-type, so the refuelling works again.
There would be no point to have vehicles consume fuel already and not being able to refuel anywhere.

And after that, maybe start working on some classes and the job-system.
This will take time as it will be brand-new code, I can't copy-paste it from my previous V2 and make slight adjustments.

But in the end, when trucker class is working and I can define the jobtype inside the job itself, and allow the code to automatically use related functions, many classes may work at the same time, since several classes share the same job-type.
Like transporting some product from A to B, this will be a point-to-point jobtype.
The same can be done for point-to-multi-point jobtypes, where you load the product at one location and you need to drop it off at several destinations (like fuel perhaps, where you load the fuel at the refinery and deliver fuel to multiple gas-stations).
Then there will also be ending-route jobtypes, like the jobs with small planes (dropping packages and returning to homebase).
Also never ending routes like busdriver, these jobs keep looping around until the player himself finishes the job by going back to homebase.

And several other jobtypes as well.

Since these systems have their own code, but use data to work with, it could be made so several classes use the same code (possibly with a few exceptions here and there), and multiple classes work instantly, instead of creating split-up code per class like before.

Since V2 will have gradual loading, the entire job-system will be contained inside a timer that runs every half a second or so.
The /work command will still be used to setup the job-data, but the job itself is executed, checked and processed by the job-timer.
And it will hold many job-steps as well.
V1 only had jobstep 1 (going to load the products) and jobstep 2 (going to unload the products).

V2 will have much more jobsteps.
When the /work command has set the data, the jobstep will be set to JOB_STARTED.
Now the timer will take over and will update textdraws and create the first checkpoint.
The job will switch to JOB_GOINGTOLOAD.

This part will only check if you're within the checkpoint and you have a speed of 0.
Entering a checkpoint will no longer use TogglePlayerControllable, since I want to add a feature where players can leave the checkpoint early and depart with only a part of their vehicle loaded.

Once they're inside the checkpoint with a speed of 0, the job will be JOB_LOADING.
During this loading, the timer will check if you're still inside the checkpoint (speed won't matter) and gradually load your vehicle until it's full, or you leave the checkpoint.
Then it will switch to JOB_LOADED.

This step will delete the checkpoint and create a new one for your destination and update textdraws.
Then it becomes JOB_GOINGTOUNLOAD.

This will again check if you're inside a checkpoint with a speed of 0, which will then switch to JOB_UNLOADING.
Now you should stay inside the checkpoint until your vehicle is unloaded entirely.
If you leave the checkpoint early, you still won't get your money and you'll get a message you should keep unloading.
In case of a point-to-point job, when your vehicle is empty, the job will switch to JOB_UNLOADED.
This step will check if the job should end (in case of a point-to-point jobtype) or continue with JOB_GOINGTOUNLOAD in case of a point-to-multi-point jobtype.

In case the job should end, it will switch to JOB_FINISHED.
The JOB_FINISHED status will pay your money and end the job, then go to JOB_NONE.

In case of a point-to-multi-point jobtype, after unloading (the required amount of goods to unload at the destination will be displayed and could be random), it will again switch to JOB_GOINGTOUNLOAD, as there are more destinations to unload.
This goes on until your vehicle is empty, or the last destination has been reached.
At each unloading point, you would receive part of your payment as well.

This system will enable me to split up the job in multiple steps and create specific code for each step.
And since it's a timer, it will run all the time for all players and the job will automatically continue with the next step.

The timer will also be responsible to check if you're still inside your vehicle and check for fail-conditions.
__________________
Gamemode: PPC_Trucking
Extras-file (for PPC_Trucking): /delproperty, /evict, /propertyid, /porthouse, /portbus, /properties
------------------------------------------------------------------------------------
PPC-Trucking-V2 (home-hosted, only open on occasion for testing purposes): ppctruckingv2.no-ip.info:7777
******* channel: https://www.*******.com/channel/UC-4...Mpglma8f0Ld-YQ
------------------------------------------------------------------------------------
Filterscripts: PPC_Speedometer - PPC_Housing - PPC_Business

Last edited by PowerPC603; 04/02/2015 at 08:15 PM.
PowerPC603 is offline   Reply With Quote
Old 05/02/2015, 03:00 PM   #5527
GameOver153
Little Clucker
 
Join Date: Feb 2015
Posts: 22
Reputation: 0
Default Re: PPC_Trucking V1

Hi! I would like to learn how you can add a new class to the server?
Or you can provide a link to the automatic disconnection?
Sorry for my bad english :с
GameOver153 is offline   Reply With Quote
Old 05/02/2015, 03:03 PM   #5528
Locky_
High-roller
 
Locky_'s Avatar
 
Join Date: Jul 2012
Posts: 1,608
Reputation: 321
Default Re: PPC_Trucking V1

Power, you already have a list of new systems that entered the PPC v2 and also what has changed in the old systems?

Sorry for bad english.
__________________


Locky_ is offline   Reply With Quote
Old 05/02/2015, 03:24 PM   #5529
PowerPC603
High-roller
 
Join Date: Nov 2010
Location: Belgium
Posts: 1,734
Reputation: 238
Default Re: PPC_Trucking V1

Adding a new class isn't simple.
You have to add alot of code as every class is split up and uses it's own code.

What do you mean by automatic disconnection?


I have no new systems yet, except for the MySQL and offline banning.
I got these systems working now:
- IP-ban system
- account-ban system (players even can't create a new account when their other account is blocked, unless they change IP)
- vehicles consume fuel already
- speedometer is working (displays vehicle-name, speed, fuel and vehicle-health)
- /v command (quite expanded) as you can use it as "/v", "/v 562" or "/v elegy", or "/v moon" (moon relates to the moonbeam)
- /ban command (to ban online and offline players, also unbans players)
- anti-money/score/jetpack/weapons hack systems
- commands which were just added a few mins ago (mostly copy-paste from the older V2): /vcolor, /fuel, /fuelall, /repairall, /fixall, /healall, /engine, /detach, /flip, /repair, /admins, /setlevel, /announce, /asay

For now, class-selection is empty, job-system isn't written yet (or there would be a class-selection already).
No gas-stations for now, no police-stations, no speedcams, no houses yet, no businesses or companies.
It's quite basic right now.

I hope I can get started on the classes and job-system soon.
But I need gas-stations first, speeding system (speedcams and their related fine/ticket system) and police-stations so players can pay their fine when no cops are online.

After that, I could get started on the classes and the new job-system.
This will be quite complex as described above.

As soon as I have the basic job-system working, expanding it for new job-types shouldn't be a problem.
Multiple classes will be working at once, so it will expand pretty fast when it's all working nicely.
Then comes the major task to gather all the data, create locations, cargo-types, routes and everything needed to define the job-data for each class.

Once I have the classes working again with the new job-system and I have gathered enough data to create a few jobs, I could open the server so you guys can take a look at the new job-system and try it out.
I can't open it any sooner, because right now, there is nothing to do, except asking for a vehicle and driving around freely.
__________________
Gamemode: PPC_Trucking
Extras-file (for PPC_Trucking): /delproperty, /evict, /propertyid, /porthouse, /portbus, /properties
------------------------------------------------------------------------------------
PPC-Trucking-V2 (home-hosted, only open on occasion for testing purposes): ppctruckingv2.no-ip.info:7777
******* channel: https://www.*******.com/channel/UC-4...Mpglma8f0Ld-YQ
------------------------------------------------------------------------------------
Filterscripts: PPC_Speedometer - PPC_Housing - PPC_Business

Last edited by PowerPC603; 05/02/2015 at 04:30 PM.
PowerPC603 is offline   Reply With Quote
Old 05/02/2015, 04:32 PM   #5530
wahyumahadir
Little Clucker
 
Join Date: Dec 2012
Location: Indonesia
Posts: 47
Reputation: 1
Default Re: PPC_Trucking V1

my game mode have 1 error

Code
Code:
  	if (APlayerData[playerid][RulesRead] == false)
    {
        new Msg[2000];
		format(Msg, 2000, "%s1. Always drive on the right side on the road to avoid accidents.\n", Msg);
		format(Msg, 2000, "%s2. chingar or disrespect to the other players, they are his companions.\n", Msg);
		format(Msg, 2000, "%s3. Use the default language 'English'.\n", Msg);
		format(Msg, 2000, "%s4. Do not use or hackers will be banned permanently.\n", Msg);
		format(Msg, 2000, "%s5. Not flooding the chat, can be silent for an admin.\n", Msg);
		format(Msg, 2000, "%s6. Not stealing cars, subject to prison if there denounces.\n", Msg);
        format(Msg, 2000, "%s7. Never chingue or disrespect an administrator, you will be banned.\n", Msg);
		ShowPlayerDialog(playerid, DialogRules, DIALOG_STYLE_MSGBOX, "Accept:", Msg, "Accept", TXT_DialogButtonCancel);
    }
Error
Code:
error 076: syntax error in the expression, or invalid function call
Please help me
______________________
<div align="center"><a href="http://www.game-state.com/5.231.69.221:7777/" target="_blank"><img src="http://www.game-state.com/5.231.69.221:7777/n-560x95_FFFFFF_FFFFFF_000000_000000.png&amp;sign=1" border="0" alt="" /></a><br />
<a href="https://www.********.com/groups/423715987783036/" target="_blank">https://www.********.com/groups/423715987783036/</a></div>
</div>
wahyumahadir 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
[Ajuda] PPC_TRUCKING ThiagoMK PortuguÍs/Portuguese 4 30/07/2013 05:44 PM
Fix id Bug in PPC_Trucking Geeboi_Mehdi Client Support 11 18/05/2013 08:02 PM
PPC_Trucking Baumann Scripting Help 1 07/12/2012 03:28 PM
PPC_Trucking Baumann Scripting Help 1 02/12/2012 02:43 PM
PPC_Trucking help Private200 Scripting Help 1 16/11/2012 08:23 AM


All times are GMT. The time now is 04:23 PM.


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