SA-MP Forums Archive
[FilterScript] Insure Vehicle v1.0! - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Insure Vehicle v1.0! (/showthread.php?tid=412218)



Insure Vehicle v1.0! - HavingGood - 01.02.2013

Hello sa-mp.com users!
I created a script for vehicle insurance
Script is a very simple
Lies in the fact that:

the player destroying the vehicle receives a given amount of money from the insurance


Код:
Commands:

/insurveh - You Insure vehicle
/cancelinsur - You cancel insure vehicle
Download:


Include > http://www.sendspace.com/file/ept48s
Pastebin script > http://pastebin.com/50abVd2Q
sendspace > amx > http://www.sendspace.com/file/09r0hx
sendspace > pwn> http://www.sendspace.com/file/tj582y

version zcmd soon


Cool script!



Re : Insure Vehicle v1.0! - Heni - 01.02.2013

Looks nice, gonna test it later !


Re: Insure Vehicle v1.0! - iGetty - 01.02.2013

This is terribly scripted and why are you checking if the player has insured a vehicle? Why not check if a vehicle is insured? EG:

pawn Код:
#include <a_samp>
#include <zcmd>

new isInsured[MAX_VEHICLES];

public OnVehicleSpawn(vehicleid)
{
    isInsured[vehicleid] = 0;
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    if(isInsured[vehicleid] == 0)
    {
        DestroyVehicle(vehicleid);
        SendClientMessage(playerid, -1, "Your vehicle was destroyed as it wasn't insured.");
    }
    else
    {
        SetVehicleToRespawn(vehicleid);
        SendClientMessage(playerid, -1, "Your vehicle respawned as it was insured.");
    }
    return 1;
}

command(insureveh, playerid, params[])
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        if(isInsured[GetPlayerVehicleID(playerid)] == 0)
        {
            isInsured[GetPlayerVehicleID(playerid)] = 1;
        }
    }
    return 1;
}
That's basically it.


Re: Insure Vehicle v1.0! - Saadat - 01.02.2013

+REP Nice work,
But! iGetty is right!


Re: Insure Vehicle v1.0! - ajam123 - 01.02.2013

Good! But i would like to take iGetty command


Re: Insure Vehicle v1.0! - iGetty - 02.02.2013

Lol, thanks you two xD