Teleporting Weapons
#3

Thank you so much. It worked perfectly.
But how can I check if the player hits the ground or not? By so, the player wouldn't be TPed to the world's middle if he shot at the sky.

I tried:
PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    new 
path[256];
    
format(path,sizeof(path),"users/%s.ini",PlayerName(playerid));
    if(
IsPlayerAdmin(playerid) || dini_Int(path,"Admin Level") >= 3)
    {
        if(
plInfo[playerid][tpw] == true)
        {
            if(
hittype == BULLET_HIT_TYPE_NONE)
            {
                if(
weaponid == 25)
                {
                    new 
Float:fOriginXFloat:fOriginYFloat:fOriginZ,Float:fHitPosXFloat:fHitPosYFloat:fHitPosZ;
                    
GetPlayerLastShotVectors(playeridfOriginXfOriginYfOriginZfHitPosXfHitPosYfHitPosZ);
                    
SetPlayerPos(playeridfHitPosXfHitPosYfHitPosZ 3);
                }
            }
            else return 
0;
        }
    }
    return 
1;

But I am aware that it won't work because:
Quote:

Return Values:
0 - Prevent the bullet from causing damage.
1 - Allow the bullet to cause damage.
It is always called first in filterscripts so returning 0 there also blocks other scripts from seeing it.

Reply


Messages In This Thread
Teleporting Weapons - by PizzaMag - 03.04.2018, 23:00
Re: Teleporting Weapons - by ForCop - 04.04.2018, 07:14
Re: Teleporting Weapons - by PizzaMag - 04.04.2018, 15:53
Re: Teleporting Weapons - by ForCop - 04.04.2018, 18:22

Forum Jump:


Users browsing this thread: 1 Guest(s)