[FilterScript] useful commands
#1

Hello SA-MP, you'll this command in your server it's better than using cheats.


"DELETED"

Код:
	if(!strcmp(cmdtext, "/fly", true))
	{
	    new Float:x, Float:y, Float:z;
	    if(PlayerInfo[playerid][pAdmin] >= 2)
		{
		if((flying[playerid] = !flying[playerid]))
		{
		    GetPlayerPos(playerid, x, y, z);
		    SetPlayerPos(playerid, x, y, z+5);
      		SetPlayerArmour(playerid, 1000000000.0);
		    SetPlayerHealth(playerid, 1000000000.0);
		    SetTimerEx("AdminFly", 100, 0, "d", playerid);
		}
		else
		{
		    GetPlayerPos(playerid, x, y, z);
		    SetPlayerPos(playerid, x, y, z+0.5);
		    ClearAnimations(playerid);
		    SetPlayerArmour(playerid, 100.0);
		    SetPlayerHealth(playerid, 100.0);
			return 1;
		}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command!");
		}
		return 1;
	}
Код:
new
	bool:flying[MAX_PLAYERS];
forward AdminFly(playerid);
forward DestroyMe(objectid);
forward Float:SetPlayerToFacePos(playerid, Float:X, Float:Y);
Код:
public AdminFly(playerid)
{
	if(!IsPlayerConnected(playerid))
		return flying[playerid] = false;

	if(flying[playerid])
	{
	    if(!IsPlayerInAnyVehicle(playerid))
	    {
			new
			    keys,
				ud,
				lr,
				Float:x[2],
				Float:y[2],
				Float:z;

			GetPlayerKeys(playerid, keys, ud, lr);
			GetPlayerVelocity(playerid, x[0], y[0], z);
			if(ud == KEY_UP)
			{
				GetPlayerCameraPos(playerid, x[0], y[0], z);
				GetPlayerCameraFrontVector(playerid, x[1], y[1], z);
    			ApplyAnimation(playerid, "PARACHUTE", "FALL_SkyDive_Accel", 4.1, 1, 1, 1, 1, 1);
				SetPlayerToFacePos(playerid, x[0] + x[1], y[0] + y[1]);
				SetPlayerVelocity(playerid, x[1], y[1], z);
			}
			else
			SetPlayerVelocity(playerid, 0.0, 0.0, 0.01);
		}

		SetTimerEx("AdminFly", 100, 0, "d", playerid);
	}

	return 0;
}
public Float:SetPlayerToFacePos(playerid, Float:X, Float:Y)
{
	new
		Float:pX1,
		Float:pY1,
		Float:pZ1,
		Float:ang;

	if(!IsPlayerConnected(playerid)) return 0.0;

	GetPlayerPos(playerid, pX1, pY1, pZ1);

	if( Y > pY1 ) ang = (-acos((X - pX1) / floatsqroot((X - pX1)*(X - pX1) + (Y - pY1)*(Y - pY1))) - 90.0);
	else if( Y < pY1 && X < pX1 ) ang = (acos((X - pX1) / floatsqroot((X - pX1)*(X - pX1) + (Y - pY1)*(Y - pY1))) - 450.0);
	else if( Y < pY1 ) ang = (acos((X - pX1) / floatsqroot((X - pX1)*(X - pX1) + (Y - pY1)*(Y - pY1))) - 90.0);

	if(X > pX1) ang = (floatabs(floatabs(ang) + 180.0));
	else ang = (floatabs(ang) - 180.0);

	ang += 180.0;

	SetPlayerFacingAngle(playerid, ang);

 	return ang;
}
i'm not a pro , but i think that's is.
hope you like it - Good luck
Reply
#2

Will be useful indeed.. but is there any function like that, if you type /getpos etc.
It will copy the cordinates of yours?
Reply
#3

Quote:
Originally Posted by LeagueOFC
Посмотреть сообщение
Will be useful indeed.. but is there any function like that, if you type /getpos etc.
It will copy the cordinates of yours?
/save

/rs

These.

EDIT: On topic, if this should be really useful, it should create a file with the cordinates, instead of just sending a client message.
Reply
#4

Quote:
Originally Posted by CrazyChoco
Посмотреть сообщение
/save

/rs

These.

EDIT: On topic, if this should be really useful, it should create a file with the cordinates, instead of just sending a client message.
No, i know them! I meant you type /getpos and it will "COPY" the cordinate. So you like can paste it.
Reply
#5

Good job.
Reply
#6

BUSTED!

This user didn't create it because I find it in a server called American Dream Roleplay and server is launched before this thread created, You are busted copycat.

NOTE: I'm not adversting
Reply
#7

I don't think this is useful at all.
For an RP server, definitely not.

Why the heck would you want people being able to fly around anyway?
Reply
#8

Quote:
Originally Posted by Cookland
Посмотреть сообщение
I don't think this is useful at all.
For an RP server, definitely not.

Why the heck would you want people being able to fly around anyway?
it is for admins not everyone.

Quote:
Originally Posted by ShadyX
Посмотреть сообщение
BUSTED!

This user didn't create it because I find it in a server called American Dream Roleplay and server is launched before this thread created, You are busted copycat.

NOTE: I'm not adversting
it's from Classified Gaming Roleplay.. -_-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)