[FilterScript] KS : Sistema de Dina [BASICO]
#1

Sobre o Ks

Ks System e um sistema basico de dinamites...

Ele Contem 2 Cmd

/PEGARDINAMITE (Com local certo pra pega-la)
/armardin (Arma ela...)

Print's

http://imgur.com/jd7iu1V,cjdvuZQ,g3r86Sv#1
(PS) As imagens no forum fico mt grande!

Codigo

pawn Код:
#include <a_samp>

new CostaDina;
new PegoDina[MAX_PLAYERS], ObDina[MAX_PLAYERS], TempoEx[MAX_PLAYERS];
new Float: kX[MAX_PLAYERS], Float: kY[MAX_PLAYERS], Float: kZ[MAX_PLAYERS];

forward TempoDinamite(playerid);

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("    CREAT BY: Krisky_.");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    print("\n--------------------------------------");
    print("    CREAT BY: Krisky_.");
    print("--------------------------------------\n");
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(IsPlayerAttachedObjectSlotUsed(playerid, 6)) RemovePlayerAttachedObject(playerid, CostaDina);
    PegoDina[playerid] = 0;
    return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/pegardinamite", cmdtext, true) == 0)
    {
        if(PegoDina[playerid] == 1) return SendClientMessage(playerid, 0xFF0000FF, "Voce ja pegou uma Dinamite!");
        if (IsPlayerInRangeOfPoint(playerid, 3.0, 1258.6782,-813.1119,84.1406))
        {
            CostaDina = SetPlayerAttachedObject(playerid, 6, 1654, 1, 0.1, -0.3, 0, 0, 40, 0, 1, 1, 1);
            PegoDina[playerid] = 1;
        }
        else
        {
             SendClientMessage(playerid, -1, "Vc Nao esta na area de Venda de Dinamite");
        }
    }

    if (strcmp("/armardin", cmdtext, true) == 0)
    {
        if(PegoDina[playerid] == 1)
        {
            GetPlayerPos(playerid, kX[playerid], kY[playerid], kZ[playerid]);
            GetXYInFrontOfPlayer(playerid, kX[playerid], kY[playerid], 0.5);
            ObDina[playerid] = CreateObject(1654, kX[playerid], kY[playerid], kZ[playerid] - 0.8,270,0,0);
            TempoEx[playerid] = SetTimerEx("TempoDinamite", 10000, 0, "d", playerid);
            SendClientMessage(playerid, -1, "Dinamite do Pavil curto! Corre desgraca!!!");
            ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 5.0, 0, 0, 0, 0, 0);
            PegoDina[playerid] = 0;
            if(IsPlayerAttachedObjectSlotUsed(playerid, 6)) RemovePlayerAttachedObject(playerid, 6);
        }
        else
        {
             SendClientMessage(playerid, 0x00FC0000, "Voce nao tem uma dinamite!");
        }
    }
    return 1;
}

GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if (GetPlayerVehicleID(playerid))
    {
        GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
    }
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}

public TempoDinamite(playerid)
{
    SendClientMessage(playerid, 0x00FFFFFF, "Dinamite Detonada");
    CreateExplosion(kX[playerid], kY[playerid], kZ[playerid], 10, 10);
    DestroyObject(ObDina[playerid]);
    return 1;
}
Reply


Messages In This Thread
KS : Sistema de Dina [BASICO] - by Krisky_ - 17.11.2014, 22:40
Re: KS : Sistema de Dina [BASICO] - by WendeLKILL - 18.11.2014, 00:21
Re: KS : Sistema de Dina [BASICO] - by Guiii - 18.11.2014, 23:06
Re: KS : Sistema de Dina [BASICO] - by zSuYaNw - 19.11.2014, 00:04

Forum Jump:


Users browsing this thread: 2 Guest(s)