Jump to content
  • 0

pomoc Zatýkání


Hazzard

Dotaz

Ahoj mám problém s funkcí pro zatýkání.. Ikdyž má hráč WL tak ho nejde zatknout.

Takto to mám.

if(newkeys == KEY_WALK){
    new Float:X,Float:Y,Float:Z;
	new id = GetClosestPlayer(playerid);
 	if(Prace[playerid] == 6)
	GetPlayerPos(id,X,Y,Z);
	if(IsPlayerInSphere(playerid,X,Y,Z,3)){
	if(GetPlayerWantedLevel(id) > 1)
	{
 	SetPlayerPos(id,263.9270,77.4691,1001.0391);
    SetPlayerInterior(id, 6);
	}
	}
	}
Link to comment
Share on other sites

5 odpovědí na tuto otázku

Recommended Posts

  • 0

ako je definované GetClosestPlayer ? ... btw...ja by som to robil  tak , že by som zatykal na maličký rádius a v ňom preveril všetkých hráčov či maju wl a keď hej tak šup...alebo si to spravil na obušok a kontroloval damage v OnPlayerTakeDamage

Link to comment
Share on other sites

  • 0

Skúste takto: Ťuknete do tlačítka a funkcia by mala prebehnúť.

if( ( (newkeys & KEY_WALK) != KEY_WALK ) && ( (oldkeys & KEY_WALK) == KEY_WALK ) )
{
    if( Prace[ playerid ] != 6 )
        return 1;

    new id = GetClosestPlayer( playerid );
    if( GetPlayerWantedLevel( id ) < 1 )
        return 1;

    new Float:fXYZ[ 3 ];
    GetPlayerPos( id, fXYZ[ 0 ], fXYZ[ 1 ], fXYZ[ 2 ] );
    if( IsPlayerInSphere( playerid, fXYZ[ 0 ], fXYZ[ 1 ], fXYZ[ 2 ], 3 ) )
    {
        SetPlayerPos( id, 263.9270, 77.4691, 1001.0391 );
        SetPlayerInterior( id, 6 );
    }
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...