[FilterScript] Predator
#1

This is my first predator missle release
its still buggy but it will be fixed in 1.0 and then it also will use mapandreas

controls:
/predator = gives you control over the missle placing
key left = let the missle go left
key right = let the missle go right
key up = let the missle go up
key down = let the missle go down
key fire = launch the missle

download is as attachment

edit: v1 is now live and uses map andreas
edit2: this code is the fixed version but will not be uploaded before it is tested
pawn Код:
//------------------------------
//Predator missle V1.0.01 by sansko
//------------------------------
#include <a_samp>
#include <mapandreas>
//------------------------------
new missle;
#define speed 15

forward movemissle(playerid);

public OnFilterScriptInit()
{
    MapAndreas_Init(MAP_ANDREAS_MODE_FULL);
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/predator", cmdtext, true, 10) == 0)
    {
        new Float:a, Float:b, Float:c ;
        new Float:f ;
        GetPlayerPos(playerid, a, b, c);
        MapAndreas_FindZ_For2DCoord(a,b,f);
        missle = CreateObject(3786, a, b, f+50, 0, 270, 0, 100);
        SetPlayerCameraPos(playerid, a, b, f+60);
        SetPlayerCameraLookAt(playerid, a, b, f);
        SetPVarInt(playerid, "mc", 1);
        SetTimer("movemissle", 100, true);
        TogglePlayerControllable(playerid, 0);
        return 1;
    }
    if (strcmp("/camreset", cmdtext, true, 10) == 0)
    {
        SetCameraBehindPlayer(playerid);
        SetPVarInt(playerid, "mc", 0);
        TogglePlayerControllable(playerid, 1);
                KillTimer("movemissle");
        return 1;
    }
    return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_FIRE)
    {
        if(GetPVarInt(playerid, "mc") == 1)
        {
        new Float:j, Float:k, Float:l;
        new Float:m, Float:n, Float:o;
                new Float:p;
        GetPlayerPos(playerid, j, k, l);
        GetObjectPos(missle, m, n, o);
        MapAndreas_FindZ_For2DCoord(m,n,p);
        MoveObject(missle, m, n, p, speed);
        SetCameraBehindPlayer(playerid);
        SetPVarInt(playerid, "mc", 0);
        TogglePlayerControllable(playerid, 1);
                KillTimer("movemissle");
        return 1;
        }
    }
    return 0;
}

public OnObjectMoved(objectid)
{
    if(objectid == missle)
    {
        new Float:p, Float:q, Float:r, Float:s;
        GetObjectPos(missle, p, q, r);
        MapAndreas_FindZ_For2DCoord(p,q,s);
        DestroyObject(missle);
        CreateExplosion(p, q, s, 7, 6.0);
        CreateExplosion(p, q, s, 7, 6.0);
        return 1;
    }
    return 0;
}

public movemissle(playerid)
{
    if(GetPVarInt(playerid, "mc") == 1)
    {
        new Float:g, Float:h, Float:i, Float:j;
        new keys, ud, lr;
        GetPlayerKeys(playerid, keys, ud, lr);
        GetObjectPos(missle, g, h, i);
        if(ud < 0)
        {
            MapAndreas_FindZ_For2DCoord(g, h, j);
            SetObjectPos(missle, g+1, h, j+50);
            SetPlayerCameraPos(playerid, g+1, h, j+60);
            SetPlayerCameraLookAt(playerid, g+1, h, j);
        }
        if(ud > 0)
        {
            MapAndreas_FindZ_For2DCoord(g, h, j);
            SetObjectPos(missle, g-1, h, j+50);
            SetPlayerCameraPos(playerid, g-1, h, j+60);
            SetPlayerCameraLookAt(playerid, g-1, h, j);
        }
        if(lr < 0)
        {
            MapAndreas_FindZ_For2DCoord(g, h, j);
            SetObjectPos(missle, g, h+1, j+50);
            SetPlayerCameraPos(playerid, g, h+1, j+60);
            SetPlayerCameraLookAt(playerid, g, h+1, j);
        }
        if(lr > 0)
        {
            MapAndreas_FindZ_For2DCoord(g, h, j);
            SetObjectPos(missle, g, h-1, j+50);
            SetPlayerCameraPos(playerid, g, h-1, j+60);
            SetPlayerCameraLookAt(playerid, g, h-1, j);
        }
    }
}
Reply
#2

Quote:
Originally Posted by MestreKiller
Посмотреть сообщение
video or pic's?
not today, i'll do it tomorrow with two pc's
Reply
#3

I downloaded and put my home server as a filter script Command "/predator" does not work for me what to do?

But from what you've explained a great look.

*Sorry for my English - I'm not so good English*
Reply
#4

Quote:
Originally Posted by Matanel
Посмотреть сообщение
I downloaded and put my home server as a filter script Command "/predator" does not work for me what to do?

But from what you've explained a great look.

*Sorry for my English - I'm not so good English*
did you load the fs, cause mine is working
Reply
#5

CMD is shown in the filter works but it does not matter has not worked, But thank
Reply
#6

Hello Soem pics of the predator;
When you type /predator you get these angle:

When you drop it by cliking you see these:

I found a bug:(pictures)

If you put the preditor over you and drop it:

You get fallen into ground and into another area:


Here is the pic in slideshow: /imageshack/slidesho...=samp034su.png

I'll rate it 5/6 if first FS
Reply
#7

Nice, i'll test it.
Reply
#8

thnx meinstad
i gonna test the bug myself to

b.t.w are you using SRT? and what version?

edit i dont get that bug but i'll try it on th 0.0,0.0,0.0 farm
Reply
#9

I used it on 0.3c
Reply
#10

strange i dont get that bug
but ar you using srt 3?
Reply
#11

No, I use RC6
Reply
#12

i mean the mod srt but i dont get that bug on my pc
Reply
#13

Update: 1.0 now live.
here is the file

it is using map andreas now and i dont have any problems with flickering screens anymore

BE SURE TO HAVE MAP ANDREAS
Reply
#14

meinstadt can you give me your playerid when you where playing on the server?
Reply
#15

cool and name is like my nickname 9/10
Reply
#16

ehm could you make this work for o.3c?
Reply
#17

Quote:
Originally Posted by justsomeguy
Посмотреть сообщение
ehm could you make this work for o.3c?
Re-compile?

And OFFT: Lol it's the person who I keep killing on GamerX LOL.
Reply
#18

w8 who are you exacly? will? and thnx i'm a noob around here and especialy with scripting!
Reply
#19

Quote:
Originally Posted by justsomeguy
Посмотреть сообщение
w8 who are you exacly? will? and thnx i'm a noob around here and especialy with scripting!
Yeah, [2F2F]Will. :>

And you'll learn to become a good coder.
Reply
#20

ok but dont yell at me on server because it hurts my feelings!XD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)