Predator -
sansko - 25.12.2010
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);
}
}
}
Re: Predator -
sansko - 25.12.2010
Quote:
Originally Posted by MestreKiller
video or pic's?
|
not today, i'll do it tomorrow with two pc's
Re: Predator -
Matanel - 25.12.2010
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*
Re: Predator -
sansko - 25.12.2010
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
Re: Predator -
Matanel - 25.12.2010
CMD is shown in the filter works but it does not matter has not worked, But thank
Re: Predator -
Meinstad - 25.12.2010
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
Re: Predator -
HyperZ - 25.12.2010
Nice, i'll test it.
Re: Predator -
sansko - 25.12.2010
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
Re: Predator -
Meinstad - 25.12.2010
I used it on 0.3c
Re: Predator -
sansko - 25.12.2010
strange i dont get that bug
but ar you using srt 3?
Re: Predator -
Meinstad - 25.12.2010
No, I use RC6
Re: Predator -
sansko - 25.12.2010
i mean the mod srt but i dont get that bug on my pc
Re: Predator -
sansko - 26.12.2010
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
Re: Predator -
sansko - 27.12.2010
meinstadt can you give me your playerid when you where playing on the server?
Re: Predator -
[BG]PREDATOR - 27.12.2010
cool and name is like my nickname

9/10
Re: Predator -
justsomeguy - 27.12.2010
ehm could you make this work for o.3c?
Re: Predator -
WillyP - 27.12.2010
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.
Re: Predator -
justsomeguy - 27.12.2010
w8 who are you exacly? will? and thnx i'm a noob around here and especialy with scripting!
Re: Predator -
WillyP - 27.12.2010
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.
Re: Predator -
justsomeguy - 27.12.2010
ok but dont yell at me on server because it hurts my feelings!XD