SA-MP Forums Archive
Sharing my newly done RP system - 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: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Sharing my newly done RP system (/showthread.php?tid=487547)



Sharing my newly done RP system - SamBeast - 13.01.2014

Hey, So I finished this today (im not gonna lie but I didn't test it %100 yet) and I would like to share this with you

Basically this is a system made for the Army & Military faction members in the RP server, it forces the Government Tax Vault to pay up the other military destroyed vehicles (like..... refunding the Military)
(You surely got to have a Tax Vault system in your script / mod)

This system makes the server more realistic + will make players drive more RPly. I hope you like it

pawn Код:
public OnCarDeath(vehicleid)
{
    if(IsAnNGCar(vehicleid))
    foreach(Player, i) // Defines Player ID
    {
        new employer[13];
        new DCar;
        new Model[592];
        switch(vehicleid)
        {
            case 470: DCar = 1000000; //you can change these values (Destroyed Vehicle Cost, or how much will it withdraw from the Gov.Tax Vault).
            case 433: DCar = 3000000;
            case 432: DCar = 10000000;
            case 425: DCar = 17000000;
            case 487: DCar = 8000000;
            case 520: DCar = 20000000;
            case 563: DCar = 15000000;
            case 592: DCar = 50000000;
        }
        switch(vehicleid)
        {
            case 470: Model = "Patriot"; //Vehicle models by ID, you can add w/e vehicle ID you need (make sure you edit the Model[] Array if you do)
            case 433: Model = "Barracks";
            case 432: Model = "Rhino Tank";
            case 425: Model = "Hunter";
            case 487: Model = "Maverrick";
            case 520: Model = "Hydra Jet";
            case 563: Model = "Black Hawk";
            case 592: Model = "Andromada";
        }
        switch(i)
        {
            case 1: employer = "SWAT"; //Faction names
            case 2: employer = "Black Ops";
            case 3: employer = "F.F.L";
            case 4: employer = "MRU";
            case 7: employer = "U.S Marines";
            case 11: employer = "U.S Army";
            case 13: employer = "SEAL Team";
        }
        new Float: VP; //Vehicle Power (or lets say Health)
        if(GetVehicleHealth(vehicleid, VP) == 0) //If the Vehicle's Health is Zero.........
        {
            new string[128];
            Tax -= DCar; //In here, the Vehicle's cost will be taken from the Tax Vault.
            SendClientMessageEx(i, COLOR_NG, " You have just destroyed your Duty Vehicle!");
            format(string, sizeof(string), "Government paid %d to refund a new %s for %s", DCar, Model, employer);
            SendClientMessageEx(i, COLOR_YELLOW, string);
        }
    }
    return 1;
}
+rep only if you liked it <3
and if you are willing to use it... Plz give credits to (SamBeast96)


Re: Sharing my newly done RP system - Excelize - 13.01.2014

You have to move this to Filterscripts/Gamemodes Section.


Re: Sharing my newly done RP system - SamBeast - 13.01.2014

Not really necessary, but its a good idea to make it as a filterscript, Thanks for the advice


Re: Sharing my newly done RP system - Excelize - 13.01.2014

Wait, so is this a GM or FS? Or just Pawn? If it's just Pawn put it in the Filterscripts category and change the title to "[PAWN]Newly Done RP system" Just make sure to get [PAWN] in there


Re: Sharing my newly done RP system - SamBeast - 13.01.2014

Uhu..... Sry, Im new (as you see) 'xD
Yeah its a PAWN (a part of my GM)
But I've found alot of misstakes in it.... Gotta fix them first and then will do edit the title.


Re: Sharing my newly done RP system - Excelize - 14.01.2014

Quote:
Originally Posted by SamBeast
Посмотреть сообщение
Uhu..... Sry, Im new (as you see) 'xD
Yeah its a PAWN (a part of my GM)
But I've found alot of misstakes in it.... Gotta fix them first and then will do edit the title.
Hey it's alright man. We're here to help you.


Re: Sharing my newly done RP system - SamBeast - 15.01.2014

The script is compiled, yet the system is not working when Vehicle gets wrecked.. Anything in the coding is wrong? :\


Re: Sharing my newly done RP system - yanir3 - 15.01.2014

Did you call the function in OnVehicleDeath?


Re: Sharing my newly done RP system - yoran765 - 16.01.2014

PHP код:
 new FloatVP//Vehicle Power (or lets say Health)
        
if(GetVehicleHealth(vehicleidVP) == 0//If the Vehicle's Health is Zero......... 
If the vehicle reaches 250 HP it will set fire. I doubt players will ever reach 0 HP. Might want to change it